title: Problem using flex to read XML in e4x format from SOAP webservice
body: <blockquote>
    <p><strong>UPDATE</strong>: The problem was not to do with
    namespaces or flex at all. My
    webservice was returning the wrapped
    xml. I was blaming the language I had least experience with before questioning the java...</p>
  </blockquote>
  
  <p>I have a basic soap webservice that I am having trouble reading the result from in flex.</p>
  
  <p>I'm a solid java programmer and just trying to get my head around adobe flex.</p>
  
  <p>In the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_6.html" rel="nofollow noreferrer">documentation</a> I should be able to use "WebService" to return the result in e4x format.</p>
  
  <pre><code>    &lt;mx:WebService id="CurrentLayersWS" wsdl="http://localhost:8080/myproject/ws/myservice.wsdl" showBusyCursor="true" result="updateSelected(event)" fault="Alert.show(event.fault.faultString), 'Error'"&gt;
        &lt;mx:operation name="publisher" resultFormat="e4x"&gt;
          &lt;mx:request&gt;
           &lt;publisherRequest&gt;
             &lt;getConfiguration/&gt;
           &lt;/publisherRequest&gt;
          &lt;/mx:request&gt;
        &lt;/mx:operation&gt;
      &lt;/mx:WebService&gt;
  </code></pre>
  
  <p>As you can see, the response is handled by the function "updateSelected" which looks something like:</p>
  
  <pre><code>private function updateSelected(event:ResultEvent):void {
      var responseXml:XML = XML(event.result);
  </code></pre>
  
  <p>Unfortunately, the event object seems to nested and encoded strangely. When I step trough with the debugger I see that responseXml is of type XMLList containing one element (at index 0) of type XML which just contains the following xml:</p>
  
  <pre><code>&lt;sch:temp xmlns:sch="http://www.mycompany.co.uk/myproject/schemas" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;
  &amp;lt;ns2:publisherResponse xmlns:ns2="http://www.mycompany.co.uk/myproject/schemas"&amp;gt;
      &amp;lt;getConfigurationResponse&amp;gt;
          &amp;lt;configuration&amp;gt;
          ...etc
  </code></pre>
  
  <p>Why is my xml nested inside a document with a root node "sch:temp"?</p>