Results 1 to 2 of 2

Thread: QT mobile and gSOAP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    18
    Thanks
    2

    Default QT mobile and gSOAP

    Greetings from a newbie to mobile app / QT developer.:

    I have questions concerning building a mobile application that talks to a SOAP server. However, there is a prologue to my question:

    PROLOGUE TO THE QUESTIONS BEGINS:
    ================================================== ==========================
    [1] A non-mobile(desktop based) application could have an architecture as follows:

    Software Stack:
    -------------------------
    QT (Fat Client) <=> internet <=> SOAP Server<=> business logic<=>Database.

    Hardware Stack:
    -------------------------
    The hardware required is a computer connected to the internet,
    internet<=>Physical Machine (hosting the soap server and the database)

    [2] A mobile sms - based application

    Software Stack( and I could stand corrected on this) :
    -------------------
    QT (Fat Cient) <=> sms gateway <=>SOAP Server<=> business logic<=>Database.
    Hardware Stack:
    -----------------------
    mobile_phone<=>GSM Modem<=>Physical Machine (hosting the soap server and the database)

    ================================================== =========================
    PROLOGUE TO THE QUESTIONS ENDS

    Having said and done this, Coming to the main question of this post:

    [1] What would be the hardware/software stack for a fat client application (written in QT) on a mobile phone to talk to a soap server installed on a PC connected to the internet. ?


    Thanking you in advance for your time,.

    -AJ

  2. #2
    Join Date
    Aug 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: QT mobile and gSOAP

    Hi,

    its quite difficult to answer you!! I have not understand so much!!

    Do you actually need help to use gSoap in Qt?
    Do you need help to communicate from a Qt app to a gSoap one?

    I can point you in both directions since I have intensively developed using Qt and gSoap.

    Using gSoap in QT (a sample code)...
    Qt Code:
    1. #include "src/gsoap/soapOtalierService.h"
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication a(argc, argv);
    6.  
    7. int soapMessage = SOAP_OK;
    8. std::string queryString = getenv("QUERY_STRING");
    9. OtalierService service;
    10.  
    11. if(queryString == "wsdl")
    12. {
    13. service.http_content = "text/xml";
    14. soap_response(&service, SOAP_FILE);
    15.  
    16. FILE *fd = 0;
    17. fd = fopen("Otalier.wsdl", "rb");
    18. bool fileRead = true;
    19. while(fileRead)
    20. {
    21. size_t r = fread(service.tmpbuf, 1, sizeof(service.tmpbuf), fd);
    22. if (!r || soap_send_raw(&service, service.tmpbuf, r))
    23. {
    24. fileRead = false;
    25. }
    26. }
    27.  
    28. fclose(fd);
    29. soap_end_send(&service);
    30.  
    31. }else
    32. {
    33. //soap_set_omode(&service, SOAP_C_UTFSTRING);
    34. service.serve();
    35. }
    36.  
    37. QTimer::singleShot(0, qApp, SLOT(quit()));
    38. a.exec();
    39.  
    40. return soapMessage;
    41. }
    To copy to clipboard, switch view to plain text mode 

    The code speaks by itself the trick using Qt and events is in using

    QTimer::singleShot(0, qApp, SLOT(quit()));
    a.exec();

    which is going to do only an execution of the code and terminate the whole thing, the rest is the gSoap code needed. The executable is served as a cgi with apache.

    To communicate the QT app with a gSoap service can be done in some ways, one could be write the entire SOAP XML request and make a request to the service. The other aproach is write a client using gsoapcpp2 and the last one is just passing cgi vars, I used the last one at my first atempt but later on I became more sophisticated

    Hope this helps

Similar Threads

  1. gsoap help me !
    By yunpeng880 in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2009, 19:09
  2. how c# access Gsoap'web service?
    By yunpeng880 in forum Qt Programming
    Replies: 2
    Last Post: 16th December 2008, 10:44
  3. qmake: how to call gsoap
    By niko in forum Newbie
    Replies: 4
    Last Post: 26th April 2008, 11:03
  4. Qt + gSoap + Visual Studio 2005
    By xgoan in forum General Programming
    Replies: 3
    Last Post: 17th December 2007, 18:27
  5. QMake and GSoap
    By srccode in forum Newbie
    Replies: 1
    Last Post: 14th April 2006, 00:19

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.