FACING ERROR WHILE CALLING AXIS2 WEB SERVICE ...
Posted
by darshanv
on Stack Overflow
See other posts from Stack Overflow
or by darshanv
Published on 2010-04-16T07:47:20Z
Indexed on
2010/04/16
7:53 UTC
Read the original article
Hit count: 361
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 = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut=request;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
Log.d("Step","3");
envelope.dotNet=true;
/*setting outputsoap object sending request */
envelope.setOutputSoapObject(request);
/*HttpTransportSE object creating sending it url */
androidHttpTransport = new HttpTransportSE(url7);
//androidHttpTransport.setXmlVersionTag("");
Log.d("Step","4");
try{
androidHttpTransport.debug=true;
androidHttpTransport.call(nmspc,envelope);
}
catch(Exception e)
{
Log.d("Transportcall",""+e);
alert=new AlertDialog.Builder(this);
alert.setMessage(""+e);
alert.show();
}
//exception is throw.
Log.d("Step","5");
try
{
Log.d("giving...","resp");
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. I am facing this issue only when am giving a call to parameterized method.
Please Help..
thanks
Darshan V
© Stack Overflow or respective owner