Results 1 to 4 of 4

Thread: QtSoapHttpTransport and Proxy authentication

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QtSoapHttpTransport and Proxy authentication

    Hi all,

    I developed a client program able to send Soap request and to get a response from a Web Server, using the QtSoap module.

    "QtSoapHttpTransport" Class anyway seem not ho handle proxy authentication..
    (I mean, there is a method ..like setHost wich take as parameters proxy name, proxy port, username and pwd)

    is it like this? If so, how can we manage to get throught proxy ?

    Did Any of you experience something related to this problem ?

    thank you for your help..

    Roby

  2. #2
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtSoapHttpTransport and Proxy authentication

    Quote Originally Posted by rmagro View Post
    Hi all,

    I developed a client program able to send Soap request and to get a response from a Web Server, using the QtSoap module.

    "QtSoapHttpTransport" Class anyway seem not ho handle proxy authentication..
    (I mean, there is a method ..like setHost wich take as parameters proxy name, proxy port, username and pwd)

    is it like this? If so, how can we manage to get throught proxy ?

    Did Any of you experience something related to this problem ?

    thank you for your help..

    Roby



    Any Idea ??

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtSoapHttpTransport and Proxy authentication

    Quote Originally Posted by rmagro View Post
    Any Idea ??
    try to get IE proxy settings from
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsCurre ntVersion\Internet Settings
    parameters:
    ProxyEnable
    ProxyOverride
    ProxyServer


    I suppose on a dialog you must take params and fill QAuthenticator...

    Qt Code:
    1. void HttpSoapConnection::slotAuthenticationRequired( QNetworkReply *reply, QAuthenticator *authenticator )
    2. {
    3. Q_UNUSED( reply );
    4.  
    5. kWarning() << "Got http authentication request for" << authenticator->realm() <<
    6. "while connecting to" << endpoint_;
    7. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtSoapHttpTransport and Proxy authentication

    Thank you Patrick for your help.

    I have already abtained the information about Proxy configuration on the windows Registry..
    but I do not understand than the solution proposed..

    What I mean is..
    I was expecting using the QtSoapHttpTransport class some method like
    setProxy (ot setUser) like it is in QHTTP class..

    but those similar methods are not there..right?

    Can you then give a simple how to use the solution proposed..

    I have something similar to the example proposed in the QT DOC
    Qt Code:
    1. void WeatherFetcher::findTemperature(const QString &city)
    2. {
    3. QtSoapMessage message;
    4. message.setMethod("getTemperature", "http://weather.example.com/temperature");
    5. message.setMethodArgument("city", "", city);
    6.  
    7. // transport is a private member of WeatherFetcher, of type QtSoapHttpTransport
    8. transport.setHost("www.example.com");
    9. connect(&transport, SIGNAL(responseReady()), SLOT(readResponse()));
    10.  
    11. transport.submitRequest(message, "/weatherfetcher/fetch.asp");
    12. }
    13. This is an example implementation of the readResponse() slot in the WeatherFetcher class:
    14. void WeatherFetcher::readResponse()
    15. {
    16. const QtSoapMessage &response = transport.getResponse();
    17. if (response.isFault()) {
    18. cout << response.faultString().toString().toLatin1().constData() << endl;
    19. return;
    20. }
    21.  
    22. const QtSoapType &returnValue = response.returnValue();
    23. if (returnValue["temperature"].isValid()) {
    24. cout << "The current temperature is "
    25. << returnValue["temperature"].toString().toLatin1().constData()
    26. << " degrees Celcius." << endl;
    27. }
    To copy to clipboard, switch view to plain text mode 

    Many thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.