• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Exception in parsing returning data

 
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.
 
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 ]
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic