2 Replies Latest reply on Feb 24, 2009 12:03 AM by ntsiii

    Unable to bind a WebService reply to a DataGrid

    curtisa2
      Hi all,
      I'm stumped by what I'm sure is a simple problem; I just want to bind the response of a WebService call to a DataGrid. The SOAP response is ..

      <?xml version="1.0" encoding="UTF-8"?>
      <S:Envelope xmlns:S=" http://schemas.xmlsoap.org/soap/envelope/">
      <S:Body>
      <ns2:getAllResponse xmlns:ns2=" http://myexample.org/">
      <return>
      <language>
      <languageId>1</languageId>
      <lastUpdate>2006-02-15T05:02:19Z</lastUpdate>
      <name>English</name>
      </language>
      <language>
      <languageId>2</languageId>
      <lastUpdate>2006-02-15T05:02:19Z</lastUpdate>
      <name>Italian</name>
      </language>
      </return>
      </ns2:getAllResponse>
      </S:Body>
      </S:Envelope>

      and all I want is for each language to be a row entry in the data grid with the child elements being the columns.

      I am able to get a list of all the single lowest level elements (say <name>) by putting this in my handler..
      var resultXML:XML = XML(event.result);
      resultXML.child("return").children().child("name");

      but I'm at a loss of how to put each 'language' element into a DataGrid. (I don't mind if I used object or e4x). Do I need to do anything like loop over each element and put into an Object?

      Can anyone help please?

      Thanks
      -Alex