views:

4

answers:

0

Hello,

I instantiate a WebService with a couple of operations that return an asyncToken. Then receivers get assigned this token and in turn call the fault handlers when the token prompts a fault.

I wanted to handle the case where there's a problem at the WebService instantiation stage, e.g. when it goes to read the WSDL and it can't reach it. So in the constructor of my inherited class I added an event handler as such:

public function MyAwesomeWebService():void {
        super();
        addEventListener( FaultEvent.FAULT, onWSFault );
    }

The problem is that it works, but too eagerly: the onWSFault() gets called when the WSDL is unreachable, but whenever there's fault in a regular operation call, the operation's fault handler gets called, TOGETHER with onWSFault().

How can I prevent this duplicity ?

many thanks,