PDA

View Full Version : Why there are differences in SOAP messages between Qt and .NET ?



TorAn
26th August 2010, 17:35
I have simple webservice written in .NET and two clients for it. One is written in .NET, another in Qt with the help of QtSoap. Service has two parameters, both of String type. Qt client does not work - server receives nulls as parameters values in the webservice method. I captured the traffic in both cases and it is clear that Qt client encapsulates parameter values as:

<testparam xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">somevalue</testparam>

, where .NET client encapsulates it as:
<testparam>somevalue</testparam>

That's why my Qt client causes problems in .NET service.

Question: how to make QtSoap to send parameters as <param>value</param>?
Ideally - how to make Qt request to be equal to .NET request?

Any help is grealy appreciated. Thanks.

This is POST from .Net client
POST /TPSite/DataStatsUpload.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4454)
VsDebuggerCausalityData: uIDPo8flIjo2l6RLgfLB4F8ORr4AAAAAUPNNr2oT9k268m5ox8 fvoTdvJa1cz/tOovY3XD0Q7B4ACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://testwebsite.org/testStats"
Host: localhost:1090
Content-Length: 350
Expect: 100-continue
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><testStats xmlns="http://testwebsite.org/"><testparam>1</testparam><datastats>2</datastats></testStats></soap:Body></soap:Envelope>


This is POST from Qt client
POST /TPSite/dataStatsUpload.asmx HTTP/1.1
Content-Type: text/xml;charset=utf-8
SOAPAction: http://testwebsite.org/testStats
Content-Length: 578
Connection: Keep-Alive
Accept-Encoding: gzip
Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: localhost:1090

<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">
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<testStats xmlns="localhost/TPSite/dataStatsUpload">
<testparam xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">csp</testparam>
<datastats xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">stats</datastats>
</testStats>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>