Client from Amazon Webservices
bogsolomon Nov 2, 2005 1:29 PMI am using Jboss 4.0.2(tried 4.0.3 also) with the JbossWS package. I am trying to create a client that would connect to the Amazon webservice. For that I have obtained the wsdl, used wscompile to generate the classes and the mapping. I have then created a web.xml, jboss-web.xml, a small jsp page and a class that creates the service and the port and then sends arequest. Everything deploys but when I get the answer I get the following error
org.xml.sax.SAXException: Invalid element in amazon.ws.ItemSearchResponse - OperationRequest at org.jboss.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:432) at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168) at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244) at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1389) at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262) at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396) at org.jboss.axis.client.Call.invoke(Call.java:2672) at org.jboss.axis.client.Call.invoke(Call.java:2548) at org.jboss.axis.client.Call.invokeInternal(Call.java:1979) at org.jboss.axis.client.Call.invoke(Call.java:1917) at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265) at org.jboss.axis.client.AxisClientProxy.invokeSEIMethod(AxisClientProxy.java:286) at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:177) at $Proxy54.itemSearch(Unknown Source)
my jaxrpc-mapping-client.xml contains the OperationRequest in ItemSearchResponse
<java-type>amazon.ws.ItemSearchResponse</java-type> <anonymous-type-qname>http://webservices.amazon.com/AWSECommerceService/2005-10-05:>ItemSearchResponse</anonymous-type-qname> <qname-scope>complexType</qname-scope> <variable-mapping> <java-variable-name>operationRequest</java-variable-name> <xml-element-name>OperationRequest</xml-element-name> </variable-mapping> <variable-mapping> <java-variable-name>items</java-variable-name> <xml-element-name>Items</xml-element-name> </variable-mapping> </java-xml-type-mapping>
and
<java-type>amazon.ws.OperationRequest</java-type> <anonymous-type-qname>http://webservices.amazon.com/AWSECommerceService/2005-10-05:>>HelpResponse>OperationRequest</anonymous-type-qname> <qname-scope>complexType</qname-scope> <variable-mapping> <java-variable-name>HTTPHeaders</java-variable-name> <xml-element-name>HTTPHeaders</xml-element-name> </variable-mapping> <variable-mapping> <java-variable-name>requestId</java-variable-name> <xml-element-name>RequestId</xml-element-name> </variable-mapping> <variable-mapping> <java-variable-name>arguments</java-variable-name> <xml-element-name>Arguments</xml-element-name> </variable-mapping> <variable-mapping> <java-variable-name>errors</java-variable-name> <xml-element-name>Errors</xml-element-name> </variable-mapping> <variable-mapping> <java-variable-name>requestProcessingTime</java-variable-name> <xml-element-name>RequestProcessingTime</xml-element-name> </variable-mapping> </java-xml-type-mapping>
From what I have read on the forums the problem might be with the way they are declared in the WSDL as annonymous. However I am not sure how to fix this.