4 Replies Latest reply on Oct 20, 2006 2:15 PM by babo_ya

    WebService  in Actionscript

    babo_ya Level 3
      I have a mxml tag :
      <mx:WebService id="CSRWSO" wsdl=" http://.......asmx?WSDL">
      <mx:operation name="NewGuid" result="DisplayResult(event.result);">

      and I need to do create a actionscript function that does just like that.

      Thanks in advance.
        • 1. Re: WebService  in Actionscript
          T._Ruggles Level 1
          Look at mx.rpc.soap.WebService and mx.rpc.soap.Operation. They works the same as the tags. Only difference is that you need to tell the WebService when to load the WSDL by calling loadWSDL().
          • 2. Re: WebService  in Actionscript
            babo_ya Level 3
            Thanks for your reply.

            I did look at those and they were confusing.

            I was able to create a WebService Object and assigned wsdl and called loadWSDL(); But, I need to call this method, GetGuid() and I'm really lost after how to create Operation Object and assigning method name.

            • 3. Re: WebService  in Actionscript
              T._Ruggles Level 1
              This should get you started.

              var CSRWSO:WebService;

              function startupFunction():void {
              CSRWSO = new WebService();
              CSRWSO.wsdl = "";
              CSRWSO.addEventListener(LoadEvent.LOAD, loadHandler);
              CSRWSO.addEventListener(FaultEvent.FAULT, faultHandler);

              function loadHandler(event:LoadEvent):void {
              var newGuidOperation = CSRWSO.getOperation("NewGuid");
              newGuidOperation.addEventListener(ResultEvent.RESULT, "newGuidResultHandler");

              function someOtherFunction():void {

              function newGuidResultHandler(event:ResultEvent):void {
              var theResult = event.result;
              • 4. Re: WebService  in Actionscript
                babo_ya Level 3
                "Implicit coercion of a value with static type mx.rpc.AbstractOperation to a possibly unrelated type mx.rpc.soap.mxml:Operation."

                I get the above error message on "var newGuidOperation = CSRWSO.getOperation("NewGuid");" line

                Thanks for your help.