I'm in the process of trying to call a SOAP web service using Flex's built-in SOAP support. I construct the basic WebService object as follows (just to give you an idea):
_service = new WebService();
_service.loadWSDL(_serviceURL + "?wsdl");
_service.addEventListener(FaultEvent.FAULT, faultHandler, false, 0, false);
When I call functions on this WebService, Flex seems to handle this well up until that point. However, the function never returns a result and always an error. When I inspect the traffic being sent to the remote WS (using Wireshark) I can see that Flex sends the SOAP requests fine, only the message is not formatted correctly, so the remote WS doesn't really know what it should do and returns an error.
When I compare the formats of the SOAP XML messages with a working Java example, I can see that the Java example (using Axis2 if I'm not mistaking) formats the XML message in the correct way. Flex formats the XML in a completely different way. The remote WS I'm trying to use here is rather complex, and has many dependencies on other WSDL and XSD files that it includes in the headers.
For example; Flex may construct a particular part of the SOAP request as follows:
<object>
<attribute>some value</attribute>
</object>
When I compare this to the (working) Java example, the message may look more like:
<object attribute="some value" />
To summarize; my questions:
- How does Flex determine what the SOAP request message (the actual XML) will look like?
- From the traffic analysis I can see that Flex requests the linked XSD's from the main WSDL, but it doesn't seem to download all of these, and some other XSD's it downloads twice. Is there some kind of limit on how many included XSD's Flex will request?
- Is it because Flex cannot retrieve the correct XSD's that it cannot determine what the message should actually look like?
Thanks in advance.