The GetProperty method extracts and returns the value of the property specified using XPath syntax. When the SelectProperties command is executed by invoking the SelectProperties command component, the selected properties and their values are stored as XML in the SelectProperties response component.
_bstr_t bstrProperty = spISelectPropertiesRsp->GetProperty(_bstr_t bstrXPathProperty);
... typedef std::vector< _bstr_t > PropertyList; ... // 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 information contained in the custom SelectPropertiesRsp component ISelectPropertiesRspPtr spISelectPropertiesRsp(spIAppIntRsp);
_ASSERTE(spISelectPropertiesRsp != 0); std::cout << "Details for the properties selected by the user:<< std::endl; PropertyList selectedProperties;
selectedProperties.push_back(_bstr_t(_T("/response/objectset/document/properties/property[symname = \"DocumentTitle\"]/value")));
selectedProperties.push_back(_bstr_t(_T("/response/objectset/document/properties/property[symname = \"Name\"]/value")));
for (unsigned int i = 0; i < selectedProperties.size(); i++) {
_bstr_t bstrPropertyName = selectedProperties[i];
_bstr_t bstrProperty = spISelectPropertiesRsp->GetProperty(bstrPropertyName);
std::cout << "property=" << (bstrPropertyName.length() ? (LPCSTR) bstrPropertyName : _T("")) << std::endl;
std::cout << "value=" << (bstrProperty.length() ? (LPCSTR) bstrProperty : _T("")) << std::endl;
}
_bstr_t bstrPropertiesXml = spISelectPropertiesRsp->GetPropertiesXml();
std::cout << "Properties XML=" << (bstrPropertiesXml.length() ? (LPCSTR) bstrPropertiesXml : _T("")) << std::endl;...