Advertisement
rturrado

Using gsoap for parsing an XDM tree in C++

Nov 11th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. // Start session
  2. // Obtain a session ID
  3. Xdm::MyBsiStartSessionRequest bsiRequest;
  4. Xdm::MyBsiStartSessionResponse bsiResponse;
  5. soapError = soap_call___bsi_USCOREwsdl__StartSession( connection.soaphandle()
  6. , this->GetConnectionURI()
  7. , "StartSession"
  8. , &bsiRequest
  9. , &bsiResponse);
  10.  
  11. // Header
  12. // Set session ID
  13. mygsoap_set_header(connection.soaphandle(), bsiResponse.StartSessionResult->SessionID->__item);
  14.  
  15. // GetData request
  16. Xdm::MyGetDataRequest getDataRequest;
  17. Xdm::MyGetDataResponse getDataResponse;
  18. // Xpath: /xdm:Device/xdm:Information/dd:ModificationNumber
  19. // Types: /ixa:Device_t/xdm:ComponentGroup/
  20. static uint32_t deviceInformationModificationNumber = 0;
  21. getDataRequest.Path = "/xdm:Device/xdm:Information/dd:ModificationNumber";
  22. // GetData call
  23. soapError = soap_call___ixa_USCOREwsdl__GetData( connection.soaphandle()
  24. , this->GetConnectionURI()
  25. , "GetData"
  26. , &getDataRequest
  27. , &getDataResponse);
  28. if (SOAP_OK == soapError)
  29. {
  30. // Deserialize IXA device
  31. CScopedSoapStringReader sss(getDataResponse.GetDataResult);
  32. ixa__Device_USCOREt ixaDevice;
  33. mygsoap_set_namespaces_xdm(&sss.GetSoap());
  34. soapError = soap_read_ixa__Device_USCOREt(&sss.GetSoap(), &ixaDevice);
  35.  
  36. {
  37. // Deserialize XDM component
  38. CScopedSoapStringReader sss(ixaDevice);
  39. struct xdm__ComponentGroup xdmComponentGroup;
  40. mygsoap_set_namespaces_xdm(&sss.GetSoap());
  41. soapError = soap_read_xdm__ComponentGroup(&sss.GetSoap(), &xdmComponentGroup);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement