• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ERROR!! SAXParseException: Premature end of file.

 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the error
when i try to retrive the results which returns a List from my service method at clent side.

where the getUsers() returns a List


In the tomcat console i get


where is the problem? Any kind os help !!

Thanks in advance,
Harathi Rao
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Axis can't just serialize an object it doesn't know (like Contact). You need to provide a serializer/deserializer - have you done that? If yes, then it would seem that it isn't registered properly.
If you don't have one, look into whether you can use the built-in BeanSerializer. It can serialize objects that adhere to the Java Bean pattern.
 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for the reply,
but the class Contact is returning a List in this fashion




getUsers() returns a List



Is the List object not recognised by Axis?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message says that it is trying to serialize the Contact class, so you might want to check your code if you are specifying that somewhere.

Looking at the two code snippets, it seems that the server sends a list, while the client seems to expect an array, so there's a problem right there. You can consult this article on how to serialize collections (basically, since List is unknown to SOAP, as arrays).
 
Harathi Rao
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to solve the problem when i tried to wrap the List in to a bean and have a bean mapping in the wsdd. which goes like this...



Thanks for the article it was very useful to me.

Harathi
 
Rikky Hasibuan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harathi Rao wrote:





Could you please to tell us, where did you put the snip code above exactly???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic