15 Replies Latest reply on Apr 19, 2007 1:40 PM by dennismr

    Populating XML from a webservice result

    dennismr Level 1
      Can anyone give me an example of how to populate an xml variable from a webservice result?

      Any help would be very appreciated.

      This is all I can find as an example but the documentation says it's possible to use a web service result to populate the variable:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="Tournaments.GetTrnyInfo.send()">

      <mx:WebService id="Tournaments"
      wsdl=" http://localhost/tennis3/tennis3.asmx?wsdl"
      showBusyCursor="true" useProxy="false">
      <mx:operation name="GetTrnyInfo"/>
      </mx:WebService>

      <mx:Script>
      <![CDATA[

      var myXML:XML =
      <order>
      <item id='1'>
      <menuName>burger</menuName>
      <price>3.95</price>
      </item>
      <item id='2'>
      <menuName>fries</menuName>
      <price>1.45</price>
      </item>
      </order>
      public function tagit():void{
      lbl1.text = myXML.item[0].price;
      }


      ]]>
      </mx:Script>
      <mx:Label id="lbl1"/>
      <mx:Button click="tagit()" x="67" y="114"/>
      </mx:Application>