This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in parsing returning data

 
naveen jain
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am using axis libraries for web service.i am trying to create a web service client that calls a web service function which returns a hasp map object
but how can i set return type of this call.

Service service = new Service();
Call call = (Call) service.createCall();
call.setOperationName( new QName("http://203.187.192.19:8080/axis/services
/AtomService", "get_cust_info") );
HashMap hsmap= (HashMap) call.invoke( new Object[] { args[ 0 ] } );


this code gives "org.xml.sax.SAXParseException: Premature end of file."
exception


please help me.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by naveen jain:
i am trying to create a web service client that calls a web service function which returns a hasp map object.


Are you sure that it returns a HashMap? Axis 1.x doesn't support that out of the box. To return a HashMap you would have to write a custom serializer/deserializer and deploy it on both the server and client side. XML, XML Schema, SOAP and WSDL have no idea what a Java HashMap is. It is more likely that the web service returns an array. See Use collection types with SOAP and JAX-RPC

How to Get Help with SOAP web services
[ November 27, 2008: Message edited by: Peer Reynders ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic