File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Passing Parameters to a Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Passing Parameters to a Web Service" Watch "Passing Parameters to a Web Service" New topic
Author

Passing Parameters to a Web Service

Matthew MacMillan
Greenhorn

Joined: May 23, 2011
Posts: 2
Hi,

I am having a real big problem trying to figure out how to pass parameters to a web service.

The web service has a getCars request web method with 4 input parameters that are usr, pwd, domain & function.

I am using Axis2 1.5.4, and my code is below. When I call the method I get error returned, "org.apache.axis2.AxisFault: Tried to invoke method public java.lang.String com.informa.lmiu.services.web.seahawk.SoapRequest.getVessel(java.lang.String,java.lang.String,int) with arguments null,null,null. The arguments do not match the signature." : -



I have tried passing parameters as per below, after line 4 above, but that has no effect: -




cheers,
Matthew
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I would certainly be using SOAPui or TCPMON to see exactly what is being sent as your SOAP request.

Bill
Rudy Gireyev
Ranch Hand

Joined: May 03, 2011
Posts: 39
Mathew, does this WebService offer you a WSDL? If it does you can then use Wsdl2java and then use the stubs generated for the connection and to set your parameters. Then you need not worry whether they are Attributes or Elements or what ever other syntax issue there may be.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing Parameters to a Web Service