10-09-2013 01:56 PM
Any one know how pass username and password into Soap webservice parsing??
I put the sample code
m_soap.setAction("http://tempuri.org/RecuperarTextos"); m_soap.setHost("wsf.cdyne.com"); QtSoapMessage request; request.setMethod(QtSoapQName("RecuperarTextos")); request.addMethodArgument("ZIP", "http://ws.cdyne.com/WeatherWS/", zipCode); // Submit the method request to the web service. m_soap.submitRequest(request, "http://webcond.lbc.bo/WSSYSASIN/WS_SYSASIN.asmx");
Solved! Go to Solution.
10-10-2013 04:53 AM
I suspect that you'd have to use the QNetworkAccessManager* QtSoapHttpTransport::networkAccessManager () associated with your QtSoapHttpTransport object; it has a SIGNAL : void authenticationRequired(QNetworkReply * reply, QAuthenticator * authenticator) which gets called if the remote server requires authentication and challenges you. You should be able to use the QAuthenticator object to set the credentials based on the authentication needed.
This is HTTP based authentication of course using the WWW-Authenticate HTTP header scheme.
10-10-2013 05:17 AM
Sorry, not got anything to hand. The documentation on these object/signals/methods seems fairly complete so you should start there.
10-10-2013 11:57 AM
I suggest that you examine the WSDL of the SOAP service that you're communicating with and ensure that you're building a SOAP request that matches the WSDL. I see a ".asmx" suffix in your code snippet which suggests that you may be communicating with a WCF implementation. You need to take care when trying to interwork with WCF implementations.
10-10-2013 01:00 PM
I attached sample app which i fetch issue.
Please check because i not get clear idea what you said.So i request to you please check my sample app and asap reply me.
10-10-2013 03:03 PM - edited 10-10-2013 03:07 PM
@jomurray The .asmx suffix is for the older ASP.net web service, I believe the newer WCF uses .svc
@shahumang8 If you put the .asmx URL in your browser you should be able to click on the methods and check on the message layout. I prefer to create my SOAP envelopes manually, have you tried?
10-11-2013 05:55 AM
I agree with @pg1181. If you're intending to interwork with a SOAP Web Service like this you should exercise it using the web page generated by the application server - http://webcond.lbc.bo/WSSYSASIN/WS_SYSASIN.asmx in this case - to get a feel for how the service works.
I usually use a tool such as SoapUi ( http://www.soapui.org/ ) where you can actually parse the WSDL itself and see the SOAP requests and responses being sent to annd ceived from the service.
On that note I notice that you're using http://webcond.lbc.bo/WSSYSASIN/WS_SYSASIN.asmx as the URI of the WSDL -- this isn't going to work. The HTML of the web page will be returned and you'll get a parsing failure when this is parsed instead of the WSDL itself prior to making the SOAP call.
You should use http://webcond.lbc.bo/WSSYSASIN/WS_SYSASIN.asmx?ws