0 Replies Latest reply on Nov 19, 2009 7:07 AM by Fredstarr

    Returning the operation name from a WebService in Flex

    Fredstarr

      I am creating a web service in my app using the mx:WebService tag like so:

       

       

       

      <mx:WebService id="mobileWs" wsdl=http://10.1.1.110/mobile/ws/phonecatalog.asmx?wsdl showBusyCursor="true" fault="onFault(event)" result="onResult(event)" >

       

       

      <mx:operation id="getPhoneCat" name="GetPhoneCategory">

       

       

       

      </mx:operation>

      <mx:operation id="getPhoneName" name="GetPhoneName">

       

       

       

      </mx:operation>

       

       

       

      </mx:WebService>

       

      And calling it in ActionScript like so:

      mobileWs.GetPhoneCategory.send();

       

       

      To avoid having to create sepereate result handlers for each individual operation defined in the web service, i'd like to write logic that does different things within a single result handler based on which operation was called (ie. GetPhoneCategory vs. GetPhoneName). I have yet to find a property or method that returns the name of the specific operation that was invoked through the service. Does anyone know how to do this, or where I would start? I thought I had accomplished this by tracking ResultEvent.target.service, but this only returns the name of the WSDL itself.

       

      Any help would be appreciated.

       

      Thanks,

       

      Fred