Yes, this works well.  Just be sure to increment the counter in the
fault handler as well so that in case of an error you run your
completion code.  You can even track which calls have returned
successfully and which error(very rare), and can inform the user, or
even re-send the failed call, or whatever.  

 

I use an array, push in a callId on send, associate that callId with the
call via AsyncToken, and on result/fault, remove the element. (keep a
list of faults if desired)

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jerusalem_pilgrim
Sent: Tuesday, April 29, 2008 10:13 AM
To: [email protected]
Subject: [flexcoders] Re: Synchronous web service calls

 

Why can't you just use a "web service calls" counter in your code? 
Every time a request goes out, increment it, every time you get a
response, decrement it. The "Print Receipt" button only gets enabled
if the counter is back to 0.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "byte.sensei" <[EMAIL PROTECTED]> wrote:
> data to produce a PDF receipt. The problem is, if a user clicks "Print

> Receipt" before all the save order web services have finished, then 
> they only get a partial receipt. There's also not an easy way to 
> determine if all the web service calls are finished, so I can't 
> disable/enable the button based on that.

 

Reply via email to