Hi,
I am a new bee this technology. How to access the web service and parsing before UI rendering. UI control is based on the webservice result.
Any one help me. Thanks a lot.
Hi,
I am a new bee this technology. How to access the web service and parsing before UI rendering. UI control is based on the webservice result.
Any one help me. Thanks a lot.
Assuming your web service uses the commonly available SOAP, you can use QtSoap![]()
BP (25th September 2010)
BP (25th September 2010)
You might want to check if the service can be accessed through http. If so, you can simply use QNetworkAccessManager to interact with the service.
BP (25th September 2010)
Hi,
Thanks enlightende_j.
I am using the QNetworkAccessManager for getting the webservice. And using QJson for parse the data.Those webservice are calling by after the UI rendering. But I want to call these webservice before the UI. How to Do this one?.
For examples, My screen have combobox. The combobox values are based on the webservice result. but , what happened here the webservice is called after the UI rendering so the combobox is empty.![]()
![]()
please help me... Thanks a lot
BP :
I had a discussion about QNAM/SOAP usage with wysota some time ago. I recommend to search the forum for this thread, may be you will find the discussion useful. Solution that I came up with is:
Create a class that supports event processing.
the main thing this class does is that it instantiates event processing.Qt Code:
{ ... private: boost::scoped_ptr<QNetworkAccessManager> _http; }To copy to clipboard, switch view to plain text mode
The way I am processing requests is that I am adding it to the queue declared in the webserviceThread and I am having timer firing every half-second to check the exitence of a new request.Qt Code:
void webserviceThread::run() { exec(); }To copy to clipboard, switch view to plain text mode
Now you can declare the instance of webserviceThread anywhere and use it for communicating with your web server. In my case I have this:Qt Code:To copy to clipboard, switch view to plain text mode
Wysota recommended usage of main thread for event processing, but I found this to be easier in terms of encapsulation of all QNAM/webservice logic inside one class.Qt Code:
{ public: datamanager() { ... _dmcenter.start(); } private: webserviceThread _dmcenter; }To copy to clipboard, switch view to plain text mode
I tried to run example this. but it did not run.please help me
You need to help yourself first. What did not run? What happened? What did you expect? What is the problem?
sorry squidge, actually i did not read it carefully before ask question. now , i am using qtsoap to connect service. i did it well.
Bookmarks