The ITransportRsp interface is used to interact with specific Transport response parameters contained in the in-process COM Server Transport response component, which is returned when the Transport command is invoked. This interface provides methods which enable the client application to extract the XML result parameters that correspond to the executed transport function.
Client applications may also interact with the Transport response component via the IAppIntRsp interface. For more information about working with command and response components and their COM interfaces, see Command and Response components.
coclass TransportRsp {
[default] interface ITransportRsp;
interface IAppIntRsp;
};
DLL | FnAppIntTransportCmd.dll |
See Also | ITransportCmd Interface |
The ITransportRsp interface defines the following methods:
Method | Description |
---|---|
GetResult | Extracts and returns the value of the specified parameter from the XML results. |
GetResultXml | Returns the result text obtained from transport function execution. |
The following is a fragment from the complete example for the Transport command.
...
typedef std::vector< _bstr_t > ResultTagList;
...
// 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 TransportRsp component
ITransportRspPtr spITransportRsp(spIAppIntRsp);
_ASSERTE(spITransportRsp != 0);
ResultTagList tagList;
tagList.push_back(_bstr_t(_T("/response/objectset/document/properties/property[symname = \"DocumentTitle\"]/value")));
tagList.push_back(_bstr_t(_T("/response/objectset/document/properties/property[symname = \"Name\"]/value")));
for (unsigned int i = 0; i < tagList.size(); i++) {
_bstr_t tagPathName = tagList[i];
_bstr_t bstrResultValue = spITransportRsp->GetResult(tagPathName);
std::cout << "tag=" << (tagPathName.length() ? (LPCSTR) tagPathName : _T("")) << std::endl;
std::cout << "value=" << (bstrResultValue.length() ? (LPCSTR) bstrResultValue : _T("")) << std::endl;
}
_bstr_t bstrResultXml = spITransportRsp->GetResultXml();
std::cout << "resultText=" << (bstrResultText.length() ? (LPCSTR) bstrResultText : _T("")) << std::endl;
...