Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Services and the fly likes deserialization error: unexpected XML reader state. expected: END but found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "deserialization error: unexpected XML reader state. expected: END but found" Watch "deserialization error: unexpected XML reader state. expected: END but found" New topic
Author

deserialization error: unexpected XML reader state. expected: END but found

Bijj shar
Greenhorn

Joined: Mar 11, 2009
Posts: 13
Hi-I am trying to access web service and I created web service client in NetBeans 6.7.1 but when I run client program get below error

java.rmi.RemoteException: Runtime exception; nested exception is:
deserialization error: unexpected XML reader state. expected: END but found: START: visaType
at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:331)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:313)
at accountManagement_1A1.AccountManagementEndPoint_Stub.getAccount(AccountManagementEndPoint_Stub.java:324)
at mainclass.Test.main(Test.java:74)
Caused by: deserialization error: unexpected XML reader state. expected: END but found: START: visaType
at com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:128)
at accountManagement_1A1.AccountManagementEndPoint_getAccount_ResponseStruct_LiteralSerializer.doDeserialize(AccountManagementEndPoint_getAccount_ResponseStruct_LiteralSerializer.java:50)
at com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:216)
at com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:124)
at accountManagement_1A1.AccountManagementEndPoint_Stub._deserialize_getAccount(AccountManagementEndPoint_Stub.java:508)
at accountManagement_1A1.AccountManagementEndPoint_Stub._readFirstBodyElement(AccountManagementEndPoint_Stub.java:426)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
... 2 more


Would anybody please help me on this..

Thanks!
Bijj shar
Greenhorn

Joined: Mar 11, 2009
Posts: 13
I found solution. We should be very careful when generating client from wsdl file below are points should consider

1. All parameters should be set in same order as mentioned in wsdl
2. Sometime you will get wsdl files where request and response not properly mapped. You should be very careful and look request and response parameter if any thing missing from response add explicitly.

It worked for me.


Matthieu Jung
Greenhorn

Joined: Dec 14, 2011
Posts: 1
Bijj shar wrote:I found solution. We should be very careful when generating client from wsdl file below are points should consider

1. All parameters should be set in same order as mentioned in wsdl
2. Sometime you will get wsdl files where request and response not properly mapped. You should be very careful and look request and response parameter if any thing missing from response add explicitly.

It worked for me.




Hi, Million thanks for your good answer ; In my case I generated Java Classes with the help of the JAX-RPC Netbeans 6.8 plugin based on a wsdl document of which I am not the author. In the execution of one of the methods I had the same message of error as you. Having trapped http traffic with the aid of Wireshark. I understood that the order of appearance of items was not the same that represents in the wsdl document. I therefore put items in good order, in same order as they arrive from the server, I re-compiled and everything works fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: deserialization error: unexpected XML reader state. expected: END but found
 
Similar Threads
JAX-RPC - deserialization error: unexpected XML reader state.
web services that invokes web services
deserialization ERROR
deserialization error: unexpected XML reader state.
jwsdp 2.0 unable to deserialize SoapFault from axis webservice