Qt6 topics merged with General

"Host not found" using QtSoap

  • I have an empty website(asp.net v3.5) on local machine.

    There is a webservice which I am trying to use from Qt-based app.

    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:

    @MyEaster::MyEaster(QObject *parent) : QObject(parent), http(this)
    connect(&http, SIGNAL(responseReady(const QtSoapMessage &)),
    this, SLOT(getResponse(const QtSoapMessage &)));

    QtSoapMessage request;
    request.setMethod("tdstats", "http://localhost:54254/Web/");
    request.addMethodArgument("value", "", "csp");
    request.addMethodArgument("stats", "", "stats");

    http.setHost("http://localhost/", false, 54254);
    http.submitRequest(request, "web/submitDataStats.asmx");
    void MyEaster::getResponse(const QtSoapMessage &message)
    if (message.isFault()) {
    qDebug("Error: %s", qPrintable(message.faultString().toString()));
    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.

  • I think that setHost takes a hostname, not a URL. Try http.setHost("localhost", 54254);

    Hmm, QtSoap is still using QHttp? That surprises me.

    Oh well, another reason to switch to KDSoap once I release it (in a few weeks) :-)

Log in to reply