2 Replies Latest reply on Oct 15, 2010 7:08 AM by Devtron

    Concurrent HTTPService requests - is it possible?

    Devtron Level 3

      I am a bit confused. I have several HTTPService objects that invoke different web services.


      I cannot seem to fire more than one at a time. If I fire off an HTTPService, then fire off another one, it seems that the first request is destroyed.


      I have the need to use a WebService I have written to handle the update of some data. I need to call this service six times (for each of the six calendar controls I have).


      I have argued with my architect that I should have ONE service to handle all six loads of data, at once. But currently it is written to handle only ONE month, hence my need to fire off this web service 6 times.


      Is this even possible? I use HTTPService objects...would I need to change the data access object to something like WebService object?

      How can I call six webservices, at once, without running into concurrency problems? Any ideas, I am completely lost on this one...help!


      By the way, my web services are written in .NET. I do not use ColdFusion or BlazeDS or anything else to layer my server. I speak directly to my web services via HTTPService objects. FYI.

        • 1. Re: Concurrent HTTPService requests - is it possible?
          Claudiu Ursica Level 4

          So even though Flash Player uses threads, the execution model for Actionscript

          does not. So it is only normal that your call fire one after each other. From my

          point of view you are right your service should take an input parameter and

          allow you to make calls for as many months you need. The only reasonable reason

          for your architect to deny that is that he doesn't have the resources to

          refactor the service. Otherwise he probably knows that making remote calls is

          expensive so minimizing their number would be something to take into account.

          There si a concurency property on

          HTTPServiceconcurrency="multiple|single|last"play with that see if it helps.Is

          your service a REST Service or WebService. Ussually when .net is involved you

          use the WebService class or generate the service with flash builder. I was able

          to handle situations like yours in both cases (HTTPService/WebService) so it

          should work.




          • 2. Re: Concurrent HTTPService requests - is it possible?
            Devtron Level 3

            ^ Thank you so much. That was some great information and I will try to use the concurrency property on my HTTPService objects.


            I have been able to find very little info on this subject and I see it as being rather important. I noticed in other FLEX apps I have demoed and looked at, that there are multiple service calls happening, concurrently, so this leads me to believe it can happen. I just dont know how to make it happen for my application. Thanks for the tip.


            Also, I believe we are using WebService, not REST service. I noticed there are WebService objects in FLEX, where you can define multiple services in one object. I may need to switch to those type of objects instead of HTTPService. I am unsure.


            I would much rather make my application web service calls more transactional. I would rather it pass the 6-month data in one call, rather than 6 one month calls. It just seems that 1 call would be more efficient than 6. 6 calls would also require a lot more logic and more work. I am curious to see if I can make it work though, I'll run a test and find out. Thank you.