Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "Host not found" using QtSoap
QtWS25 Last Chance

"Host not found" using QtSoap

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toran
    wrote on last edited by
    #1

    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:

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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dfaure
      wrote on last edited by
      #2

      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) :-)

      David Faure (david.faure@kdab.com)
      KDE/Qt Senior Software Engineer
      KDAB - Qt Experts - Platform-independent software solutions

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved