Hi,

i would like to use QtSoap for communication between a GUI and a serverengine - but i have to admit that i havn't worked with SOAP before, so please be indulgent
I have a Problem extracting values from the SOAP-Message. I took a look at Trolltec's example that comes with QtSoap. It's about using Google's SOAP interface - unfortunately Google shut it down, and i dont have a API Key for SOAP. Therefore i tiried to create a SoapMessage by myself:
Qt Code:
  1. QtSoapSimpleType *type1 = new QtSoapSimpleType(QtSoapQName("key"), 20);
  2. QtSoapSimpleType *type2 = new QtSoapSimpleType(QtSoapQName("value"), 40);
  3.  
  4. QtSoapMessage response;
  5. response.setMethod(QtSoapQName("Response"));
  6. response.addMethodArgument(type1);
  7. response.addMethodArgument(type2);
To copy to clipboard, switch view to plain text mode 

I sent this message to my client and tried to extract the added values:
Qt Code:
  1. soapMessage.setContent(data);
  2. const QtSoapType &res = soapMessage.returnValue();
To copy to clipboard, switch view to plain text mode 

Now it should be possible to get the value of the method arguments with res["argument name"], but all i get is an empty string. If i try to validate the result with res.Valid() it returns true, so it should be correct. Am I doing anything wrong?

Ah - here is the SOAP message i created:
Qt Code:
  1. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" >
  2. <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  3. <Response>
  4. <key xsi:type="xsd:int" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >20</key>
  5. <value xsi:type="xsd:int" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >40</value>
  6. </Response>
  7. </SOAP-ENV:Body>
  8. </SOAP-ENV:Envelope>
To copy to clipboard, switch view to plain text mode