File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invoking operation using Call object

 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just wrote a code where in I invoke an operation on an external webservice using the org.apache.axis.client.Call object. The operation I am intending to invoke takes no parameters, hence I called the call.invoke() method that takes no parameters but this threw a java.lang.NullPointerException. But if try calling the invoke() method that takes an Object array and pass it an uninitialized array like call.invoke(new Object[]{}), a org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. message is given.
The operation called takes no parameters but returns an Object array. What should be done in the code? The code written by me is as follows:
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its seems you have generated the client stubs using WSDL2Java,in that case why not directly call the method from the stub instead of re-writing it ??
Something like ...
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your solution ... it worked!!!
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Balaji,

Can you suggest some book or site that can tell me more about Axis or Web Services programming in greater detail? Please give me the reference of a book or link that is freely available on the internet.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ketan,
For Axis and WS related links check this FAQ, for books check this link.

BTW, how did you come to know about the service you are trying now http://www.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL?? Was it implemented using Apache Axis or Visual DataFlex ?
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Balaji,

Thanks for the links... I got to know about the web service throught www.xmethods.net website... and hence I have no clue how the web service is actually implemented...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic