0 Replies Latest reply on Aug 4, 2010 4:39 PM by ssardar

    Web Service Calls

    ssardar

      What is the difference between these two approaches??

       

       

      A)  Using the Generated classes from Import Web Service(WSDL)

       

       

       

       

      public var dlSrv:DataLoaderService;   <--(Generated Class from WSDL)

       

       

      private function initApp():void

      {

       

       

      //instantiate

      dlSrv =

       

      new DataLoaderService();

       

      //register the fault listener

      dlSrv.addDataLoaderServiceFaultEventListener(handleFaults);

       

      getGridData();

      }

       

       

       

       

      public function getGridData():void

      {

      dlSrv.addgetGridDataEventListener(gdResult);

      dlSrv.getGridData();

       

      }

       

       

       

      private function gdResult(e:ResultEvent):void

      {

      gridData = e.result

       

      as ListCollectionView;

       

      }

       

       

       

      B) and the MXML approach

       

       

       

       

      <mx:WebService id="dlSrv"

      wsdl="

      http://localhost:9080/DeDashboard/services/DataLoader?wsdl" showBusyCursor="true">

       

      <mx:operation

      name="

      getGridData"

      result="gdResult(event)"

      fault="handleFaults(event)"

      />

       

      </mx:WebService>

       

       

       

       

       

       

      The obvious difference for me is, approach A generates this:

       

       

      A fault occurred contacting the server. Fault message is: faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:9080/DeDashboard/services/DataLoader"]. URL: http://localhost:9080/DeDashboard/services/DataLoader'

       

       

       

      I followed some example coding I found, did I leave something out?  Or is the call returned in a different format?