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.
Printable View
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.
It depends on the technology used for the webservice.
Assuming your web service uses the commonly available SOAP, you can use QtSoap :)
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.
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.Code:
{ ... private: boost::scoped_ptr<QNetworkAccessManager> _http; }
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.Code:
void webserviceThread::run() { exec(); }
Now you can declare the instance of webserviceThread anywhere and use it for communicating with your web server. In my case I have this:Code:
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.Code:
{ public: datamanager() { ... _dmcenter.start(); } private: webserviceThread _dmcenter; }
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.