Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified
Accepted Solution

How to pass username and password into Soap?

Hello,

 

      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");

 

BlackBerry Development Advisor
jomurray
Posts: 133
Registered: ‎09-06-2010
My Device: Z30

Re: How to pass username and password into Soap?

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. 

 

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to pass username and password into Soap?

Hi Jomurry,

Can you provide me some sample app??
BlackBerry Development Advisor
jomurray
Posts: 133
Registered: ‎09-06-2010
My Device: Z30

Re: How to pass username and password into Soap?

Sorry, not got anything to hand. The documentation on these object/signals/methods seems fairly complete so you should start there.

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to pass username and password into Soap?

Hi Jomurray,

 

        Thanks for reply.

 

        I try it but i got this error SOAP-ENV:VersionMismatch So let me know what a problem in code??

BlackBerry Development Advisor
jomurray
Posts: 133
Registered: ‎09-06-2010
My Device: Z30

Re: How to pass username and password into Soap?

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.

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to pass username and password into Soap?

Hello,

 

      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. 

Super Contributor
pg1181
Posts: 398
Registered: ‎01-12-2011
My Device: Q10

Re: How to pass username and password into Soap?

[ Edited ]
BlackBerry Development Advisor
jomurray
Posts: 133
Registered: ‎09-06-2010
My Device: Z30

Re: How to pass username and password into Soap?

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?wsdl to ensure that you get the WSDL XML itself. You should verify all this with SoapUi or a similar tool so that you get a feel for how the web service is supposed to work before invoking it from an application.

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to pass username and password into Soap?

Hi Jomurry,

 

   Still i not get understand.

 

    As per our message i use wrong methode to parse soap???

 

    If yes then provide me step which place i do wrong???