I am getting a decoding error calling a JAX-WS webservice. Both the
flex app calling the webservice and the webservice are on the same
machine, so I don't think I need a crossdomain.xml file. The funny
thing is the webservice is returning the xml response to me that I
want, but it gets sent to the fault method. I am using the Flex 2
SDK.
Here is the error:
[RPC Fault faultString="Error #1069" faultCode="DecodingError"
faultDetail="null"]
(mx.messaging.messages::AcknowledgeMessage)#0
body = "<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<My xml response here>
</soapenv:Body></soapenv:Envelope>"
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
public function get(event:ResultEvent):void
{
Alert.show(event.toString());
}
public function web(event:FaultEvent):void
{
Alert.show("EVENT " + event.toString
() + "\nFAULT " + event.fault.toString()
+ "\nMESSAGE " +
event.message.toString() + "\nTYPE " + event.type.toString()
+ "\nEVENT_PHASE " +
event.eventPhase.toString());
}
public function callWS():void
{
ProductsWS.getProducts(username,
password);
}
]]>
</mx:Script>
<mx:WebService id="ProductsWS"
wsdl="http://host:port/Workspace/Project/WEB-INF/wsdl/Sample.wsdl"
useProxy="false" fault="web(event)"
showBusyCursor="true" requestTimeout="30">
<mx:operation name="getProducts" result="get(event)"
fault="web(event)"/>
</mx:WebService>
<mx:Button id="CallWS" label="call WS" click="callWS();"
enabled="true" x="292" y="234"/>
</mx:Application>
Thanks,
Amanda