1 Reply Latest reply on May 4, 2007 5:20 AM by batmitra

    webservice and flex


      i’m trying to get a result from web services in flex but I’m not able to get it.

      And one more thing instead of writing this code in MXML file I want to write it in to a class and then call it.

      Will you please help me out in this?

      Here’s my code:

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >



      import mx.rpc.events.FaultEvent;

      import mx.rpc.events.ResultEvent;

      import mx.rpc.Responder

      import mx.rpc.Fault

      import mx.rpc.soap

      import mx.rpc.soap.WebService

      import mx.rpc.soap.WSDL

      import mx.rpc.soap.LoadEvent

      import flash.events.EventDispatcher

      import mx.rpc.soap.Operation

      import flash.events.Event

      var webService:WebService = new WebService();

      webService.wsdl= "";


      webService.addEventListener(LoadEvent.LOAD, onWSDL);

      webService.addEventListener(ResultEvent.RESULT, onRes);



      private function onRes(event:ResultEvent):void {



      private function onFault(event:FaultEvent):void {






        • 1. Re: webservice and flex
          batmitra Level 1
          Are you using .Net for your webservice?

          If yes, then if you are using framework 1, you can't deal with webservices directly on flex, but you can build an array of objects and return it to flex, on flex you have to build an arrayCollection with those objects received.

          Another thing , if you want to have results, you must have an operation name, wich is the name of your method on your webservice, and you must invoke your webservice something like mywebservice.myoperation()