This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes invoking operation using Call object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "invoking operation using Call object" Watch "invoking operation using Call object" New topic
Author

invoking operation using Call object

Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
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:


Regards,<br />Ketan KC Chachad
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
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 ...


Spritle Software Blogs
Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
Thank you very much for your solution ... it worked!!!
Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: Nov 23, 2003
Posts: 76
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
 
subject: invoking operation using Call object
 
Similar Threads
Invoking a https webservice
javax.rpc.call problem
java.net.ConnectException: Connection timed out: connect
Soap client giving error
STUB, Dynamic Proxy, DII