As a learning exercise, I'm trying to invoke the Amazon.com Web services
using JAX-RPC. I have the Web Service Developers Kit version 1.1, with
JAX-RPC 1.0.3.
I have run the wscompile command against the WSDL descriptor, using the
attached config.xml file, with a command line of the form:
wscompile -d classes -gen -keep -s src -verbose config.xml
This works fine; I generate javadocs from the generated source files, and
package the classes in a JAR file. I then try to invoke the service using
the attached Java client (AmazonClient.java). I get the exception shown
below. It looks as though some element or attribute name can't be converted
to a QName, but I cannot tell why.
Obviously it would be easier to debug this if I could intercept the actual
SOAP message. I'm wondering what would be the easiest way to do this--would
I need to write a handler?
Thanks in advance for any help.
========================================
java.rmi.RemoteException: Runtime exception; nested exception is:
unexpected element type: expected={
http://www.w3.org/2001/XMLSchema}QName,
actual={
http://www.w3.org/2001/XMLSchema}string
unexpected element type: expected={
http://www.w3.org/2001/XMLSchema}QName,
actual={
http://www.w3.org/2001/XMLSchema}string
at
com.sun.xml.rpc.encoding.SerializerBase.verifyType(SerializerBase.java:129)
at
com.sun.xml.rpc.encoding.SimpleTypeSerializer.deserialize(SimpleTypeSerializ
er.java:101)
at
com.sun.xml.rpc.encoding.SOAPFaultInfoSerializer.doDeserialize(SOAPFaultInfo
Serializer.java:63)
at
com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBa
se.java:165)
at
com.sun.xml.rpc.client.StreamingSender._readBodyFaultElement(StreamingSender
.java:348)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:165)
at
com.netdimen.amazon.AmazonSearchPort_Stub.keywordSearchRequest(AmazonSearchP
ort_Stub.java:623)
at amazon.AmazonClient.doKeywordSearch(AmazonClient.java:49)
at amazon.AmazonClient.main(AmazonClient.java:61)
Robert Lowe
http://RMLowe.com/
+852 9520 4722
rmlowe_at_rmlowe.com