0 Replies Latest reply on Nov 18, 2007 8:48 AM by curtkauf

    Load web service into ArrayCollection

      I can't seem to get a .Net wed service to load into an ArrayCollection. There is something I don't understand. Her is my code..

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      creationComplete="initApp()" backgroundColor="#FFFFFF">
      import mx.charts.events.ChartItemEvent;

      import mx.collections.ArrayCollection;
      import mx.charts.HitData;
      import mx.controls.Alert;

      private var serviceRevenue:ArrayCollection;

      private function runService():void{
      serviceRevenue = new ArrayCollection(this.wsWeeklyReports.DataForWeek.lastResult);

      <mx:WebService id="wsWeeklyReports"
      wsdl=" http://localhost:1602/CS_Webservice/WeeklyReports.asmx?wsdl" useProxy="false"
      fault="Alert.show(event.fault.faultString), 'Error'">
      <!-- this operation returns the revenu by service by date-->
      <mx:operation name="DataForWeek">

      <mx:ApplicationControlBar width="100%" fillColors="[#460064, #008484]">
      <mx:DateField id="dteWEDate"/>
      <mx:Button label="Run" id="btnRun" click="{runService()}"/>
      <mx:Label text="R" id="lblType"/>

      <mx:Panel title="Revenue by Date" width="100%" height="100%"
      paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

      <mx:ColumnChart id="columnChart"
      height="100%" width="100%"
      <mx:CategoryAxis categoryField="date"/>
      <mx:LinearAxis minimum="1" />
      <mx:ColumnSeries xField="date" yField="total" displayName="date">


      If I just call the web service and set the chart dataprovider to the web services last result all works well. But my guess is down the road I will find that the ArrayCollection is the right way to go and is more versatile. Any help would be appreciated...I think this is a basic thing...and I need to understand what I'm doing wrong. Thanks so much!