Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problem using qtSoap
Forum Updated to NodeBB v4.3 + New Features

Problem using qtSoap

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 6.6k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hasnain
    wrote on last edited by
    #1

    problem i am facing while using qtsoap is that i am get request refused, web sertvice i am trying to connect is developed in java and is currently running on a local machine , here is the code

    qt .h File
    @#ifndef WSCLIENT_H
    #define WSCLIENT_H

    #include <QMainWindow>
    #include<qtsoap.h>

    namespace Ui {
    class wSClient;
    }

    class wSClient : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit wSClient(QWidget *parent = 0);
    ~wSClient();

    private slots:
    void getResponse(const QtSoapMessage &);

    private:
    Ui::wSClient *ui;
    QtSoapHttpTransport http;
    };

    #endif // WSCLIENT_H
    @

    Qt .cpp file

    @#include "wsclient.h"
    #include "ui_wsclient.h"

    wSClient::wSClient(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::wSClient)
    {
    ui->setupUi(this);
    connect(&http, SIGNAL(responseReady(const QtSoapMessage &)),
    this, SLOT(getResponse(const QtSoapMessage &)));

    QtSoapMessage request;
    request.setMethod("loginCheck",
                      "http://192.168.10.119:8080/ChatAppWebService");
    request.addMethodArgument("userName", "", "Saad");
    request.addMethodArgument("password","","abc");
    
    http.setHost("192.168.10.119");
    

    // http.setAction("http://192.168.10.119:8080/ChatAppWebService/chatAppService");
    http.submitRequest(request, "chatWSpackage/chatApp/loginCheckRequest");

    qDebug("sending request");
    

    }

    wSClient::~wSClient()
    {
    delete ui;
    }

    void wSClient::getResponse(const QtSoapMessage &message)
    {
    if (message.isFault()) {
    qDebug("Error: %s", qPrintable(message.faultString().toString()));
    }
    else {
    QString res = message.returnValue().toString();
    // QDateTime dt = QDateTime::fromString(res, Qt::ISODate);
    // if (dt.isValid())
    // res = QLocale::c().toString(dt.date());

        qDebug(res.toLatin1().constData());
    }
    

    // QCoreApplication::quit();
    }@

    method name if "loginCheck"

    and Soap Address is
    @
    <soap:address location="http://192.168.10.119:8080/ChatAppWebService/chatAppService"/>
    @
    please help me. And is there some way of generating C++ class(stub) from WSDL. I tried using gsoap but it is very complex.

    [edit: Soap address returned / Denis Kormaev]

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      yogesh
      wrote on last edited by
      #2

      I tried qt soap 2 years ago, it had some features missing (not a bug) with large scale and complex business web services because it was under development. Then I had to use gsoap. gsoap is great and could be complex for some users though is very powerful.

      Your web service seems to be simple one so qt soap should suffice. You need to provide more inputs in order to let others know about exact problem.

      If your server is refusing your request, you need to first make sure that everything is fine with your web service. You can test your web service by either web browser or some other web tool.

      And there is no issues if WS is developed using JAVA.

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

        I would recommend trying KDSoap, which we (KDAB) just released it. See http://www.kdab.com/products/kd-soap for more details.
        It does include a code generator in order to generate a C++ class from a WSDL file, and is a much more complete solution than Qt Soap: support for sync and async calls, support for RPC and document types of communication, etc.

        KDSoap is available under the GPL license from ftp://ftp.kdab.com/pub/kdsoap (for opensource applications and for evaluation purposes), and under a commercial license from http://www.kdab.com/products/license-prices

        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