3 Replies Latest reply on Aug 31, 2010 8:03 AM by rexdtripod

    Flex receive xml data from ASP.NET Webservice

    rexdtripod Level 1

      I've got Flex code that's calling another guy's ASP.NET webservice.  All seems connected OK.  Setting a break point in my result handler I see the xml datat being returned.  But it seems to have some soap header info at the top.


      If I just call the service outside of Flex, in IIS, I get data that begins...


      <?xml version="1.0" encoding="utf-8"?>



      If I call through Flex I get data that begins...


      <getxmlResponse xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">


      Should I be looking at my Flex code or his asmx?

        • 1. Re: Flex receive xml data from ASP.NET Webservice
          rexdtripod Level 1

          I don't see anything in Flex that would allow me to manipulate how the xml is returned (i.e., without the additional SOAP info).  Am I missing something here?

          • 2. Re: Flex receive xml data from ASP.NET Webservice
            Devtron Level 3

            What is the purpose of removing the SOAP header?


            Is it causing FLEX controls to not bind properly? Or it just bothers you?

            • 3. Re: Flex receive xml data from ASP.NET Webservice
              rexdtripod Level 1

              No.  It appears possibly linked to the following runtime error:


              TypeError: Error #1088: The markup in the document following the root element must be well-formed.


              Again, the xml returned by the service, if called directly in IIS, appears exactly as I designed and is well formed and valid.  The Flex framework appears to modify the xml content in such a way that it becomes malformed.  The runtime is complaining about these extra lines atop of what's returned:


              <getxmlResponse xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">


              Won't let me parse the rest of the data.  Just halts there.  App doesn't complain if I stick my xml in a file on my server and make an http service call for it.  Data gets parsed fine.  All is well.


              I'd like to just get back the xml data that I designed the app to accept - the data that comes back if you invoke the service in a browser.  Is there any way to do that in Flex?  Here's the service definition...


                  <mx:WebService id="webServiceConfigApp"
                      <mx:operation name="getxml"


              ...and the call...




              Or is there something on the ASP.NET side that needs adjusting?