IAppIntRsp Interface

Each time an Application Integration command is executed by calling IAppIntCmd::Invoke, a newly instantiated response component is returned. IAppIntRsp is the standard interface used by a command, which enables the client application to determine whether the command succeeded and to retrieve information about any error that may have occurred during execution of the command. Additional interfaces which provide data specific to a particular command response may also be used.

For more information about working with command and response components and their COM interfaces, see Command and Response components.

Reference

TLB File FnAppIntCmd.tlb
See Also IAppIntCmd Interface

Methods

The IAppIntRsp interface defines the following methods:

Method Description
GetDescription

Returns the description of the response returned by the invoked command.

GetErrorDetails If an error occurred when the invoked command was executed, this method returns the details of the error (if available).
GetErrorMsg If an error occurred when the invoked command was executed, this method returns the error message that describes the error.
GetErrorName If an error occurred when the invoked command was executed, this method returns the name of the error.
GetHResult

Returns an HRESULT value indicating whether or not execution of the invoked command was successful.

GetName

Returns the name of the response returned by the invoked command.

Example

   ...
   // Execute the command and capture the response component
   std::cout << "Executing the command..." << std::endl;
   IAppIntCmdPtr spIAppIntCmd(spICommandNameCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);
// Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The command failed to execute." << std::endl; // Examine the error information provided in the standard response component _bstr_t bstrErrorName = spIAppIntRsp->GetErrorName(); std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl; _bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg(); std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl; _bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails(); std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl; _ASSERTE(0); } else { std::cout << "The command succeeded." << std::endl; // Obtain the response name and description from the standard response component _bstr_t bstrResponseDescription = spIAppIntRsp->GetDescription(); std::cout << "ResponseDescription=" << ( bstrResponseDescription.length() ? (LPCSTR) bstrResponseDescription : _T( "" ) ) << std::endl; _bstr_t bstrResponseName = spIAppIntRsp->GetName(); std::cout << "ResponseName=" << ( bstrResponseName.length() ? (LPCSTR) bstrResponseName : _T( "" ) ) << std::endl; // Obtain the specific response information contained // in the custom command response component ICommandNameRspPtr spICommandNameRsp(spIAppIntRsp);
... }