views:

124

answers:

0

Hello , I am new to axis ,I have created a web servcie with couple of methods using axis2 and deployed it on tomcat.And am calling that web service from my android program with the help of ksoap.But wen i call a method which doesn't take any parameter am gettin fine reply from web service which i can able to see on my screen,But wen i call anothr method which takes a string argument am getting namespace exception on server

WEB SERVICE CODE IS .....

package Guru; public class DarshanSays {

public String getMsg(String h) { return h+" ..the power of change is eVolution...";

} public String getEmpty(String d)throws Exception { return "empty string from tomcattttttttttt"; }

}

//AND program is

String soap_action="http://Guru/getEmpty"; String method_nm="getEmpty"; String nmspc="http://Guru/"; String url7="//192.168.10.182:8080/axis2/services/Friday";//http: SoapObject request = new SoapObject(url7,method_nm); /*sending method parameters with SoapObject */ request.newInstance(); request.addProperty("h","darshan.....");//sending a parameter to a method SoapSerializationEnvelope envelope = newSoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut=request;

envelope.dotNet = true;

envelope.encodingStyle = SoapSerializationEnvelope.XSD;

envelope.dotNet=true; /*setting outputsoap object sending request */

envelope.setOutputSoapObject(request); /*HttpTransportSE object creating sending it url */

androidHttpTransport = new HttpTransportSE(url7); //androidHttpTransport.setXmlVersionTag("");

try {

androidHttpTransport.debug=true; androidHttpTransport.call(nmspc,envelope);

}

catch(Exception e)

{

alert=new AlertDialog.Builder(this);

alert.setMessage(""+e);

alert.show();

}

//exception is throw.

try

{

SoapPrimitive sp=(SoapPrimitive)envelope.getResponse(); String hh=sp.toString(); Log.d("reply from web ser",".."+hh.toString());

//and erorr msg is

SoapFault - faultcode:'soapenv:Server' faultstring: 'namespace mismatch require http://Guru found 192.168.10.182:8080/axis2/services/Friday' faultactor: 'null' detail: org.kxml2.kdom.Node@43d31390

ERROR IS coming only when am calling parameterized method.

Please Help..

thanks

Darshan V