This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bijj shar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic