File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes unexpected element type error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "unexpected element type error" Watch "unexpected element type error" New topic
Author

unexpected element type error

Dave Trower
Ranch Hand

Joined: Feb 12, 2003
Posts: 86
I am trying to call Amazon's web service and I get the following error:

Exception: 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


Anyone have any idea what this means.

Here is the code.

AmazonSearchPort port = (AmazonSearchPort)
(new AmazonSearchService_Impl().getAmazonSearchPort());
System.out.println("Created port");
AuthorRequest request
= new AuthorRequest(name, "1", "books", "", "lite", "", token, "", "", "");
System.out.println("Created request");

ProductInfo response = port.authorSearchRequest(request); //This line is the one that causes the error.
System.out.println("Created response");
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
unexpected element type: expected={http://www.w3.org/2001/XMLSchema}QName, actual={http://www.w3.org/2001/XMLSchema}string


I think it means what it says - it was expecting a QName format and got a string it cant recognize.

If this was my problem I would be trapping the entire request and response with something like TCPMON and comparing the way your request is formatted with Amazon's samples.

Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: unexpected element type error
 
Similar Threads
Deserialization Error in WebService Client
Problem creating Accounts using DynamicEntity in MsCrm4.0
Unable to publish to IBM test UDDI registry server
unable to connect to .Net web service using axis with java
Response <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>