Hello All,
I have a problem that I can't figure out. With WebService faults,
and operations that return SOAPFaults...read on for the detais.
1) I've created my WebService through ActionScript (not the MXML
Component).
var ws:WebService = new WebService();
2) I've attached a fault listener to it. I had to do this because
it seems that SOAPEncoder errors were never being caught otherwise.
ws.addEventListener(FaultEvent.FAULT, onServiceFault)
3) I'm using a Cairngorm Command/ServiceDelegate calling scheme.
For example, to call getInvoices, I have a command that calls into the
appropriate method on the ServiceDelegate called getInvoices, which
looks like:
public function getInvoices(params:Object):void{
Operation(ws.SearchInvoices).encoder.strictNillability = true;
var token:AsyncToken = ws.SearchInvoices(params);
token.addResponder(this.responder);
}
As you can see, I'm using the AsyncToken, and adding the Commmand as
the responder. The Command has both fault and result handlers as
defined by the IResponder interface.
4) The this.responder is set during the contstructor of the
Service Delegate, like so:
public function ServiceDelegate(responder:IResponder)
{
this.responder = responder;
}
So, now my problem is, that when a SOAPFault is raised in the call to
the SearchInvoices WebService operation, both the FAULT on my Command
(which is the responder), AND the fault (onServiceFault ) for the
WebService definition.
I'd really rather not have this happen, but can't really figure out
exactly what's going on. ALSO, I had to add the fault handler to the
WebService because we were having all sorts of SOAPEncoder errors that
were never being raised.
What's someone to do? Is it that since I'm using the AsyncResponder
to handle for the result/fault, that the WebService is never notified
that the Fault has already been handled? What's the proper design
around this? Is there a way to set the status that the Fault's been
handled? It almost seems like the fault is being raised twice.
Thanks,
Todd