1 Reply Latest reply on Oct 10, 2012 4:12 AM by Timothy Brand-Spencer

    Read DataSet from .net xml webservice

    Samiqaraeen

      hi i have an already running xml webservice that connect to a software build using vb.net

       

      now i want to make a version on android and the webservice returns a dataset ( a .net XML file) can i read it as a normal xml file or is there a way i can read it

       

      if u can plz give me a hint or the cod eto do that

       

      thanx

        • 1. Re: Read DataSet from .net xml webservice
          Timothy Brand-Spencer Level 1

          This article should steer you in the right direction: http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_3 .html.

           

          The basic premise will be to use a URLRequest with a URLLoader to make a request to your web service and then parse the response XML.

           

          Something along the lines of:

           

                     
                      var request:URLRequest = new URLRequest("http://www.[yourdomain].com/data.xml");
                      var loader:URLLoader = new URLLoader();
                      loader.addEventListener(Event.COMPLETE, completeHandler);
          
                      try
                      {
                          loader.load(request);
                      }
                      catch (error:ArgumentError)
                      {
                          trace("An ArgumentError has occurred.");
                      }
                      catch (error:SecurityError)
                      {
                          trace("A SecurityError has occurred.");
                      }
          
                      private function completeHandler(event:Event):void
                      {
                         var dataXML:XML = XML(event.target.data);
                         trace(dataXML.toXMLString()); // this is your response XML which you can do whatever you want with
                       }