Results 1 to 3 of 3

Thread: "Host not found" using QtSoap

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default "Host not found" using QtSoap

    I have an empty website(asp.net v3.5) on local machine.
    http://localhost:54254/web/

    There is a webservice which I am trying to use from Qt-based app.
    http://localhost:54254/Web/submitDataStats.asmx

    When I am using .net client everything works as expected. I can reach both of these addresses through the browser and my .net client consumes this service without any problem.

    For usage of this webservice from Qt4.6.3 client I downloaded and compiled qtsoap-2.7_1-opensource

    I am using "Easter" example project, just slightly modifying it:

    Qt Code:
    1. MyEaster::MyEaster(QObject *parent) : QObject(parent), http(this)
    2. {
    3. connect(&http, SIGNAL(responseReady(const QtSoapMessage &)),
    4. this, SLOT(getResponse(const QtSoapMessage &)));
    5.  
    6. QtSoapMessage request;
    7. request.setMethod("tdstats", "http://localhost:54254/Web/");
    8. request.addMethodArgument("value", "", "csp");
    9. request.addMethodArgument("stats", "", "stats");
    10.  
    11. http.setHost("http://localhost/", false, 54254);
    12. http.setAction("http://localhost:54254/web/submitDataStats/tdstats");
    13. http.submitRequest(request, "web/submitDataStats.asmx");
    14. }
    15. void MyEaster::getResponse(const QtSoapMessage &message)
    16. {
    17. if (message.isFault()) {
    18. qDebug("Error: %s", qPrintable(message.faultString().toString()));
    19. ...
    20. }
    To copy to clipboard, switch view to plain text mode 
    Problem:

    message argument in getResponse returns "Host not found". No matter how I change the parameters the error is the same - "host not found".

    Any help or advise with this issue will be greatly appreciated.

  2. #2
    Join Date
    May 2010
    Posts
    24
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "Host not found" using QtSoap

    You should try:
    Qt Code:
    1. http.setHost("localhost", false, 54254);
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to alexisdm for this useful post:

    TorAn (19th August 2010)

  4. #3
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "Host not found" using QtSoap

    Thank you, it did work. After you pointed this out it is pretty clear that one should not specify http protocol in QtSoapHttpTransport method call

Similar Threads

  1. [WebKit] catch "page not found" error
    By maston in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2010, 15:44
  2. "Cannot run program "C:\Qt\4.3.3\bin\qmake": file not found
    By PeteH in forum Installation and Deployment
    Replies: 1
    Last Post: 7th February 2009, 00:48
  3. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  4. socket programming... getting "no route to host"
    By babusunlux in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 20:39

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
  •  
Qt is a trademark of The Qt Company.