Re: soap and web services
If you are a commercial user, you can use the QtSoap solution (unfortunately you have to pay for it). Otherwise you have to create appropriate xml wrapping for the method yourself based on an example query and then send it over network with proper headers to the webservice server.
Re: soap and web services
Re: soap and web services
Could you simplify the alternative suggested with a brief example?
Thx
Re: soap and web services
I was fighting with web-services recently and ended (since I am not yet a commercial user and don't have access to qtsoap) just duplicating "post" method with QNetworkManager. I spent quite some time trying, until I installed http sniffer and it showed me exactly where I was wrong. After the sniffer pointed to the difference between request made from the browser and from my Qt code the rest was trivial.
In short, I suggest you to do the same. Install the sniffer, catch the request to the web-service made from the browser and then use QNetworkManager to construct "post" request...
Re: soap and web services
Someone knows how to translate the following code usign QSoap??
Code:
String request = " here should be the xml request";
String url = " here is the we service provider url";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndPointAddress(new URL(url));
call.setOperationName(new QName("Anagrafica", "execute")
String response = (String)call.invoke(new Object[] {request});
"Anagrafica" is the service and "execute" is the method to be invoked..
Thanka a lot for your time,
Roby
Re: soap and web services
With QtSoap it would be something like:
Code:
QtSoapHttpTransport transport;
transport.setHost(url.host(), url.port());
connect(&transport, SIGNAL(reponseReady()), this, SLOT(...)));
QtSoapMessage msg;
msg.setMethod("Anagrafica:execute");
transport.submitRequest(msg, url.path());
Re: soap and web services
many thanks for your suggestion..
I will try and let you know about my progress
THX
Roby
Re: soap and web services
Quote:
Originally Posted by
wysota
With QtSoap it would be something like:
Code:
QtSoapHttpTransport transport;
transport.setHost(url.host(), url.port());
connect(&transport, SIGNAL(reponseReady()), this, SLOT(...)));
QtSoapMessage msg;
msg.setMethod("Anagrafica:execute");
transport.submitRequest(msg, url.path());
where should I put my xml request in this case?
Re: soap and web services
I'm not sure I understand :) QtSoapMessage is a request. If you mean the actual data to send then you have to form a proper structure using QtSoapStruct or similar.
Re: soap and web services
What I meant is that in the axix example I provided there was an XML request that represented the actual data to send..
Using QtSoap where Should I put my xml request (yeah, the actual data to send or "payload" if you prefer).
Should I use something like QtSoapMessage::setContent or something else?
THX
Quote:
Originally Posted by
wysota
I'm not sure I understand :) QtSoapMessage is a request. If you mean the actual data to send then you have to form a proper structure using QtSoapStruct or similar.
Re: soap and web services
You have to construct the xml structure using QtSoap, not using external xml mechanisms. You fill objects which are then transformed into a properly formed xml based soap request.
Re: soap and web services
Ok.. and can you suggest how to do something like that..
Thx
Roby
Quote:
Originally Posted by
wysota
You have to construct the xml structure using QtSoap, not using external xml mechanisms. You fill objects which are then transformed into a properly formed xml based soap request.
Re: soap and web services
Oh come on! Please read the docs and see the examples. I already told you everything you need to know.