Look into AsyncToken.  All the RPC calls, inclusing WebService return an
AsyncToken, which is a dynamic object to which you can add any property you
want, and you can retrieve the value of that property in the result handler.
Set a called property and use a switch statement to decide how t handle the
result.  AsyncToken also supports callback functions.

 

Further, I am sure you could call removeEventListener and the
addEventListener to actually change the result handler.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of valdhor
Sent: Thursday, August 20, 2009 8:40 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Changing ResultHandler of WebService Operation

 

  

Probably not. In ActionScript, you would add an event listener. For a remote
object it is...

theRemoteObject.theOperation.removeEventListener(ResultEvent.RESULT,
firstResultHandler)

theRemoteObject.theOperation.addEventListener(ResultEvent.RESULT,
secondResultHandler)

I would think it would be the same for a web service although I have not
tried it.

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Angelo Anolin <angelo_ano...@...> wrote:
>
> Hi FlexCoders,
> 
> How do I change the Result property of a web service operation?
> 
> For example, I have declared my WebService as follows:
> 
> <mx:WebService id="ws">
>   <mx:operation name="Call_One" result="Call_OneRH(event)"
fault="Call_OneFH(event)" />
>   <mx:operation name="Call_Two" result="Call_TwoRH(event)"
fault="Call_TwoFH(event)" />
> </mx:WebService>
> 
> I want to be able to change the result of the operation "Call_One" to
another result, since I am planning to re-use the same web service, but the
result would be treated differently.
> 
> Will this work?
> 
> ws.operation.Call_One.result = "myOtherResult"
> 
> Any ideas?
> 
> Thanks. Regards.
> 
> Angelo
>



Reply via email to