An elegant design pattern would be to implement a request queue. All the requests that your webservice needs to send should be put in a queue. This queue can be a collection.Each item of this collection should have the following properties - -Request data -Operation/Webmethod Name -Function pointer to call in case of successful call(this is optional depending upon where you process your results) -unique identifier like an incremented counter - flag which says response awaited In the singleton class you can implement a timer based functionality which will poll the queue at regular intervals and pick up the item from this queue and call the required operation. You can attach the unique id to an asynctoken returned from the send operation. Once the result is received, you can remove it from the queue. If its a fault,you can either place it last or send it again depending on how you intend to implement it. Hope this helps...
On Sat, Feb 20, 2010 at 4:48 AM, handitan <[email protected]> wrote: > > > Hi all, > > I need some advices on how-to solve the issue that I am having. > On my Flex application, I have a singleton class that contains 1 WebService > instance which serves every services. > > It has been working fine but I miss-out a very important issue that I > should have think of beforehand which is being able to resend the service > again that was failed either due to a TimeOut or the infamous "2032" > > On the web, I found an example that I think it put me on the right track: > > http://flexmonkeypatches.com/flex-webservice-with-auto-repeat-and-increasing-timeout/ > > It's a good solution but I just need to investigate more on how-to > incorporate this to my singleton class because: > 1) On each service call, I save lots of infos on the AsyncToken such as > resultHandler, faultHandler, etc. > 2) On that example, resending the service call by doing "op.send(args)." I > don't know yet on how-to copy over all saved infos from the previous > service-call's token into this new one. > > That's the approach that I am taking right now. > But I am open to any suggestion. > > Thanks! > > >

