UPDATE: 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...
I have a basic soap webservice that I am having trouble reading the result from in flex.
I'm a solid java programmer and just trying to get my head around adobe flex.
In the documentation I should be able to use "WebService" to return the result in e4x format.
<mx:WebService id="CurrentLayersWS" wsdl="http://localhost:8080/myproject/ws/myservice.wsdl" showBusyCursor="true" result="updateSelected(event)" fault="Alert.show(event.fault.faultString), 'Error'">
<mx:operation name="publisher" resultFormat="e4x">
<mx:request>
<publisherRequest>
<getConfiguration/>
</publisherRequest>
</mx:request>
</mx:operation>
</mx:WebService>
As you can see, the response is handled by the function "updateSelected" which looks something like:
private function updateSelected(event:ResultEvent):void {
var responseXml:XML = XML(event.result);
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:
<sch:temp xmlns:sch="http://www.mycompany.co.uk/myproject/schemas" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:publisherResponse xmlns:ns2="http://www.mycompany.co.uk/myproject/schemas"&gt;
<getConfigurationResponse>
<configuration>
...etc
Why is my xml nested inside a document with a root node "sch:temp"?