PDA

View Full Version : qtsoap with .net webservice



drbergie
19th September 2007, 14:43
Hallo.
I downloaded the enterprise qtsoap library from trolltech's website, and got the call to webservices working, only to a point.

I am trying to talk to a asp.net 2.0 webservice from a Qt application. The webservice talks SOAP 1.1, and so does my library.

The problem that I am getting is that the webservce does not seem to return any info. It sends the method call. Hangs, and then disconnects me from the host, after a few minuets.

I added some debug output in the qtsoap code, to try and see what is going on. The first thing that caught my attention wat the returned soap message:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<Faultcode xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >SOAP-ENV:VersionMismatch</Faultcode>
<Faultstring xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >XML parse error</Faultstring>
<SOAP-ENV:Faultdetail xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<ParseError xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >unexpected end of file at line 1, column 1</ParseError>
</SOAP-ENV:Faultdetail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


It seems that a version mismatch is occurring. Could it be that the server does not talk my version (Schema) of SOAP?

The ASP.net definition of the webservice is as follows. This is what it wants to see.


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTestSite xmlns="http://www.emss.co.za/VodacomComplianceServices">
<id>int</id>
</GetTestSite>
</soap:Body>
</soap:Envelope>

Another thing that was more disconcerting is that the QHttp::request method returns an id of 1 the first (and only) time i call it. Then when the QHttp::requestFinished signal is received, the ID that it gets is 2. Strange.

Any help in this regard will be helpful!

marcel
19th September 2007, 14:49
First, the SOAP versions are different: http://www.w3.org/1999/XMLSchema-instance vs http://www.w3.org/2001/XMLSchema-instance.

Regarding the QHttp::request, do you have any firewall on the server with the ASP webservice?
Anyway, the "1" is the http request ID, used to identify which request finished when you get requestFinished.

If you get 2, it means it is for another http operation you start.
You will get 1 only when the request is finished, and since you don't get it, I assume the request didn't finish yet.

drbergie
19th September 2007, 14:57
The fire wall can't be the problem. the webservice server is also a webservice, so the https (443) port is open. This is the port that I am connecting with.

The soap version thing: if it is not configurable on server side, then I am going to have to rewrite qtsoap for the new version?

drbergie
20th September 2007, 07:52
It seems that the problem is that the webservice is on a Sequre port. A valid message is sent to the server, but because it is not encrypted, the message is not seen as valid.

Any tips on getting Qtsslsocket working with qsoap?

All Jinx
27th September 2007, 10:05
I encoutered the same problem and I tried to modify the QtSoap source code for using with Https.

Without success :(

drbergie
27th September 2007, 10:13
I think the only clean solution is to move to qt 4.
They have (apparently) HTTPS support built into there QHttp class.

All Jinx
27th September 2007, 16:59
I'm already using Qt4 and I tried to modify the Qt Soap source code without success :(
The web Service was made with nuSoap library and works fine with the proxy generated by visual studio...

drbergie
28th September 2007, 07:07
Are you using the QT4 qsoap library?
If you are, and it still does not work, then perhaps a Qt support person should answer for this.

alemark
17th December 2007, 18:19
I'm already using Qt4 and I tried to modify the Qt Soap source code without success :(
The web Service was made with nuSoap library and works fine with the proxy generated by visual studio...
Hi,

you might also want to take a look at this:
http://www.clausmark.com/feast_en.phtml

FEAST can also be used in a pure client role. The advantage over Qt SOAP is that is supports generating the client (and server) code based on the WSDL description (that you should get from nuSoap)

/Niklas

QPlace
18th December 2007, 02:26
This issue is of importance to me as well, because shortly I will have to do the same thing - interacting with .net webservice from qt client. Per suggesion I looked at FEAST website and, besides general description of what it is, did not find any downloads of the product or an option to purchase it. Another vaporware?

alemark
18th December 2007, 14:03
FEAST ships right now. Pls. contact Clausmark for a quotation.

There is also a demo under
http://www.clausmark.com/feast_demo_en.phtml

and a solution brief under

http://dist.trolltech.com/pdf/ClausmarkSolutionBrief_web.pdf

/Niklas

arpit_theone
12th February 2009, 08:46
I was getting the exactly same error message. Here how I resolved it.

I was using asp.net developement server i.e. I have started the service in debug mode,so it was launched at port 1408 not the web port 80.
So I used

QtSoapHttpTransport::setHost(const QString &host, QHttp::ConnectionMode mode, int port)
& gave 1408 as port.