8 Replies Latest reply on Mar 17, 2009 4:48 PM by Devin Columbus

    HTTPService Desperation

    Devin Columbus
      This is a desperate situation for me...

      I have a few HTTPService's ready to be called when necessary... however, I have noticed that after about 5 minutes, the service (any of them) is sent again. I have tried to implement concurrency="single" and also a httpService.disconnect(); after each of the responses... no go. This is so frustrating! This is a VERY desperate situation for me. I would appreciate some knowledge!
        • 1. Re: HTTPService Desperation
          Gregory Lafrance Level 6
          Describe how you are using your HTTPService. How are they sent, as in what triggers calling the send() method for them? Need more info on your situation.
          • 2. Re: HTTPService Desperation
            Devin Columbus Level 1
            I've defined and HTTPService as an MXML Component with an id of myService. I simple call a function that executes myService.send();

            Here's a sample HTTPService that I'm calling:

            <mx:HTTPService id="myService"
            resultFormat="text" concurrency="single">
            • 3. Re: HTTPService Desperation
              Gregory Lafrance Level 6
              Yes, but I'd like to know more about what calls the send() function of this HTTPService, the timing etc. What contains that component, how is send() called in your case, etc.
              • 4. Re: HTTPService Desperation
                Devin Columbus Level 1
                I'm not able to post my exact code due to restrictions but this is the exact process:

                Calls a function to create a PopUp that controls the creation of variables and media ...

                Varialbes are created are sent to a Bindable textfield @ parentApplication and a root Function is called.

                @root Function:
                Removes the previous PopUp, creates a new StatusPopUp and executes the request to my HTTPService. The service is set up per the above code.

                HTTPService result:
                The result removes the StatusPopUp, parses the xml response, and creates a final Alert.

                That's the process...
                • 5. Re: HTTPService Desperation
                  Gregory Lafrance Level 6
                  So user clicks a button, fills in some information in a popup, closes the popup, and a new status popup appears, and the HTTPService is called? Can't imagine why it gets sent multiple times.

                  I still think it should be possible to boil this down to a greatly simplified sample app that still at least shows the structure of the app.
                  • 6. Re: HTTPService Desperation
                    Devin Columbus Level 1

                    That's a barebones duplicate of what I'm doing in my other app... and this far I have not noticed it happen. This really sucks. There are differences between the two:

                    1) I'm using CF as my server-side script.

                    2) We're using sessions for user login and such.

                    I cannot duplicate the exact environment, but this will at least give you insight into how my App is structured.
                    • 7. Re: HTTPService Desperation
                      Gregory Lafrance Level 6
                      I can't imagine how an HTTPService is being called twice, unless it's send it being called by some event that fires twice when you think it should be called once.

                      You might be able to have a Boolean variable okToSend set to true, and set it to false after the result handler finishes, that way it won't fire twice. But then you need a way for it to be set back to true when appropriate.
                      • 8. Re: HTTPService Desperation
                        Devin Columbus Level 1
                        Well, I learned something new... after creating my own trace function and writing a log to the server, i found out that when you create a popup and initiate a Timer class, that Timer class is not remove along with the Popup. Thus the HTTPService was called once when i manually called it, and once more when the Timer officially ran out.

                        Word to Adobe: when a child is removed from the display list, so should everything within that child be also. Real nice.

                        Thank you for your help anyways, Greg. You led me to this conclusion.