0 Replies Latest reply on Aug 23, 2007 2:06 PM by Alberto_Mz

    Web Service problem

    Alberto_Mz
      Hi,

      I want to use a web service (created in ASP.NET) to obtain some data that i want to show in a DataGrid.
      When i execute the query i get the information in a DataSet, What would be the best way to return the information?

      At this time i return the information in xml format :

      myDataSet.GetXml()

      then in flex :

      var xmlResult:XML = XML(wsQuery.getData.lastResult);
      var xmlQuery:XMLListCollection;
      xmlQuery = new XMLListCollection(xmlResult.children());

      and i asign xmlQuery to DataGrid dataProvider="{xmlQuery}"

      but if i want to show a date with some format i don't know how to format the data, i tried to do this:

      private function dateFormat(item:Object, col:Number ) : String
      {
      var dftDate:DateFormatter = new DateFormatter();
      var strDate:String;


      dftDate.formatString = 'DD/MM/YYYY';

      strDate = dftDate.format(item.SOME_DATE);

      if strDate == '01/01/1900')
      {
      strDate = '';
      }
      return strDate
      }

      but when the "item" structure is something like this:

      item = <vTable>
      <SOME_DATE>
      <SOME_DATE>
      "2007-09-10T00:00:00-05:00"

      and i don't know how can i get the date string.


      Somebody knows how can i format that date or if it is possible to return the web service information in a diferent format?

      Alberto Martinez