Hi Everybody !
I'm using Apache Axis to invoke web service from internet. I can access a web service wherein no input parameters are required , but whenever I have to pass input parameters, I can't invoke it. Can somebody help me to figure out the problem. Here is my code below:

import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

public class myClient {
	public static void main (String[] args){
			String endpoint = "http://www.webservicex.net/country.asmx?wsdl";
			Service service = new Service();
			Call call = (Call)service.createCall();
			call.setTargetEndpointAddress( new java.net.URL(endpoint));
			call.setOperationName(new QName("http://www.webserviceX.NET/GetCountryByCountryCode", "GetCountryByCountryCode"));
			call.setProperty(javax.xml.rpc.Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
			call.setProperty(javax.xml.rpc.Call.SOAPACTION_URI_PROPERTY, "http://www.webserviceX.NET/GetCountryByCountryCode");
			call.addParameter("CountryCode", XMLType.XSD_STRING, ParameterMode.IN);
			Object[] inParams = new Object[]{"us"};
			String result = (String)call.invoke(inParams);								   
		}catch(Exception e){

Here is the error response from server:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or function 'GetCountryByCountryCode' expects parameter '@CountryCode', which was not supplied.
at WebServicex.country.GetCountryByCountryCode(String CountryCode)
--- End of inner exception stack trace ---

how can I solve it ? any help for me !

This article has been dead for over six months. Start a new discussion instead.