Connect QT to WebService

Source: Internet
Author: User

Maybe it was because you didn't need it. You didn't even think about how to access WebService through qt ....

To solve this problem, because the current version of QT does not provide a class library for direct access... first, some necessary knowledge,


My Connected Server is an IIS server that uses only the string helloworld () and string gethello (string Str) interfaces created in vs2010.


Qt on XML document operations and WebService principles, features and communication methods... this can look at the http://user.qzone.qq.com/380411306/blog/1273588842? Ptlang = 2052 & aduin = 952147772 & adsession = 1273588927 & adtag = client. qq.2785 _ friendtip_qzonefolder.0


I have made three attempts for this ,,,

First,

Use the qnetworkaccessmanager class of QT to establish a connection with WebService ,,

Then use the qnetworkreply class to implement communication With WebService. Of course, this communication is only asynchronous stream communication, and you will receive the entire XML web page of WebService ,,,

Next, parse XML according to the SOAP protocol rules, and communicate with WebService according to the SOAP protocol rules.

Finally, serialize the self-written request XML and send it to WebService,

So far, the first attempt has not been successful, because it is not very familiar with soap during this attempt, but it is certain that this approach is feasible...


Second,

I used a third-party C ++ open-source gsoap library, which was provided by a netizen. His blog: Ghost ....


Third,

I found the qsoap source code that has not been released in the QT open-source community. It can be compiled and configured and used directly in the QT program, which is very convenient ..

It can be found here: http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtsoap

It provides two application methods:

They are source code introduction and first compile and generate. dll, and then introduce the program...

Related Classes:

 

Qtsoapmessage
Qtsoapqname
Qtsoaptype
Qtsoaparray
Qtsoaparrayiterator
Qtsoapstruct
Qtsoapstructiterator
Qtsoapsimpletype
Qtsoaphttptransport

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.