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 Passing Parameters to a Web Service 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 "Passing Parameters to a Web Service" Watch "Passing Parameters to a Web Service" New topic

Passing Parameters to a Web Service

Matthew MacMillan

Joined: May 23, 2011
Posts: 2

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,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: -

William Brogden
Author and all-around good cowpoke

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

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.
It is sorta covered in the JavaRanch Style Guide.
subject: Passing Parameters to a Web Service
Similar Threads
Creating Service and Client using AXIOM
Trying to create a java web service client using axis2
Find THE jar containing a class Axis2
Invoking Live Search Web Service - via Axis Client -error AxisFault connection abort Undeclared prefix 'soapenv' for element <soapenv:Envelope>