views:

488

answers:

2

My HTTPService resultHandler is firing twice. Is that normal? The messageId and token# are the same. StatusCode=200 both times.

I've examined the traffic in Fiddler and only one request is being submitted. Here's a code snippet; I've put a breakpoint on the service send() method and it is happening only once.

    var token: AsyncToken;
    var myResponder : AsyncResponder = new AsyncResponder(onResult, onFault);
    token=myHTTPService.send();   
    token.addResponder(myResponder);

    private  function  onResult(e:ResultEvent , token:Object=null):void {
        **// we enter this function twice**
    }
A: 

Turns out to be a bug. http://bugs.adobe.com/jira/browse/SDK-22883

Tim
A: 

I am facing this problem as well! I guess the solution is to move on to Flex3.5.. thats what the bug tracking page says when I saw it today 17/feb/2010

Vatsala
Just wire-up a dummy eventhandler for the result and fault, and you can continue to use the AsyncResponder.// these handler stubs are necessary because of http://bugs.adobe.com/jira/browse/SDK-22883this.addEventListener(FaultEvent.FAULT,onFaultEventHandler);this.addEventListener(ResultEvent.RESULT,onResultEventHandler); protected function onFaultEventHandler(e:FaultEvent): void{};protected function onResultEventHandler(e:ResultEvent):void {};
Tim
thanks for this :)
Vatsala