Hi

I am attempting to use qtsoap to talk to a MFC SOAP service...

The lack of WSDL support is a pain (anyone know what happened to http://www.clausmark.com/feast_en.phtml?), so I am packet sniffing a working client to see what I should be sending.

To create the soap message I am building a DOM document, and then using request.setContent(xmlDocument) to add the document to the SOAP message.

This works fine with a simple request like:

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. <MyProc xmlns="http://tempuri.org/">
  4. <Index>0</Index>
  5. <Duration>0</Duration>
  6. <MediaId>test</MediaId>
  7. </MyProc >
  8. </SOAP-ENV:Body>
  9. </SOAP-ENV:Envelope>
To copy to clipboard, switch view to plain text mode 


But I have run into difficulty with a more complicated example.

When I packet sniff the data, the test client uses a namespace in the middle of the XML, however, the "Configuration" element itself doesn't have a prefix:

Qt Code:
  1. <InitialiseMyStuff xmlns="http://tempuri.org/">
  2. <Index>0</Index>
  3. <Configuration xmlns:a="http://schemas.datacontract.org/2004/07/MyTest.MyTestApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  4. <a:TestA>0</a:TestA>
  5. <a:TestB>1</a:TestB>
  6. <a:TestC>2</a:TestC>
To copy to clipboard, switch view to plain text mode 

I can't work out how to create the "Configuration" element as above,
xmlDocument.createElementNS("http://schemas.datacontract.org/2004/07/MyTest.MyTestAppt", "a:Configuration") gives me:

Qt Code:
  1. <a:Configuration xmlns:a="http://schemas.datacontract.org/2004/07/MyTest.MyTestApp">
To copy to clipboard, switch view to plain text mode 

And when I try this with setContent, the a: are stripped from the child nodes.

Any ideas?