2 Replies Latest reply on Nov 18, 2009 3:10 AM by Matt Le Fevre

    HTTP Service Failing

    MrFork

      Hello All,

       

      I have a function in my application that calls various http services (PHP running on apache - WAMP)

       

      For some unknown reason, sometimes the first HTTP request fails, and its always the first. My function is as follows;

       

      public function sendAllHttpRequests():void
              {   
                  getCompleteRedemptionDataMerchant.send();
                  getSummaryRedemptionData.send();
                  getCampignsHTTP.send();
                  getGoogleData.send();
                  getWhereFrom.send();
                  getTopPerforming.send();
                  getDropOff.send();
                  getCompletePageViewData.send();
                  getCompleteRedemptionDataDate.send();
              }

       

      The HTTP requests are using a mixture of queries to an SQL database and the Google Analytics API. Does anyone have an idea why this might be happening? Or is there another method I could use that would ensure all data is loaded correctly?

       

      PLEASE HELP! Thanks

       

      Craig

        • 1. Re: HTTP Service Failing
          MrFork Level 1

          Ok I think I have fixed it, simply created a fault handler and called the HTTP service again, effectively creating its own loop.

           

          I think flex / actionscript has some serious procedural issues

          • 2. Re: HTTP Service Failing
            Matt Le Fevre Level 4

            i've had several problems with HTTPServices in the past where they are for no reason refusing to act normally if i automate their sending.

             

            The only solutions i've so far come up with to this bizarre behaviour are;

             

            1: sending the requests off manually, be it button press or whatever. (Annoying)

            2: using the setTimeout function to delay them to ensure they are the only thing occuring at one time. (Very messy and poor code)

            3: wrapping the send request in a try&catch and as you said, on failure simply just doing the request again. (Shouldn't be necessary)