resty gwt - How can I create synchronous calls to rest via javascript using GWT? -


I'm calling my GWT client for the web service being hosted on a different server of Javascript which requires the answer And sung on the UI I used to do it comfortably through living organisms but I am unable to capture the response when the JavaScript method is called from HTML which in turn invokes the rest call. Besides, I want to make sure that if I bring two calls from Javascript after the second call (which calls each other) then the second call is only made when the call is completed first. Is there any way to achieve that?

I think there are 2 different problems in your question: / P>

A) that Unable to capture the response

B) Create a sequence of calls

for A) Should you give us more information, code snippets, is it related to your problem? B) These are my suggestions.

If you are using 2 asynchronous calls then there is no way to guarantee that the second will return before the second one. Still you can get some sort of synchronization differently.

I see 2 options

1) Wait for the first call to launch the second call. This means by sending the second call on the onsoot of the first call (and possibly even if your argument is unsuccessful).

This option is not optimal in terms of performance because you may have to wait before the unnecessary time, the second request is sending, depending on if it comes to the reply of the first request to send you the second information. Needs some information.

2) Send the call independently, then save the boolean (OK1 and oak 2) within the onuscut method of each call. Call the same method within 2 ofSuccess methods: afterBothSuccess ()

Check the value of 1 and 2 right inside this method

  If (Ok1 & amp; oak 2) // Here you are guaranteed that both of your calls are returned successfully    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -