Reputation: 693
I am trying to connect to my webservice via ksoap and giveme this error
cannot find dispatch method for {}
I know that are 2 question with the same error in both they are not putting the namespace correctly or adding the correct method name, here i am adding the correct namespace, and the correct method also it was working now is not, that's the problem, here is the code that call the webservice
ObjConexion object = new ObjConexion();
SoapObject request = new SoapObject(object.NameSpace(), "login");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
Bundle extras = getIntent().getExtras();
/*PropertyInfo namePro =new PropertyInfo();
namePro.setName("_name");
//namePro.setValue(extras.getString("name"));
namePro.setValue("sdfasdfsadf");
namePro.setType(String.class);
request.addProperty(namePro);
*/
PropertyInfo emailPro =new PropertyInfo();
emailPro.setName("email");
//emailPro.setValue(extras.getString("mail"));
emailPro.setValue("asdfsdfasdfasdf");
emailPro.setType(String.class);
request.addProperty(emailPro);
PropertyInfo passwordPro =new PropertyInfo();
passwordPro.setName("password");
//passwordPro.setValue(((EditText) findViewById(R.id.passwd)).getText().toString());
passwordPro.setValue("asdkasdkfkasdf");
passwordPro.setType(String.class);
request.addProperty(passwordPro);
HttpTransportSE androidHttpTransport = new HttpTransportSE("WSDLPath");
androidHttpTransport.debug = true;
try {
androidHttpTransport.call("", envelope);
SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
}catch (Exception e) {
e.printStackTrace();
Toast.makeText(this,e.getMessage().toString(),Toast.LENGTH_LONG).show();
}
Upvotes: 0
Views: 132
Reputation: 674
You have not enter method name:
androidHttpTransport.call("", envelope);
Enter method name:
androidHttpTransport.call(METHOD_NAME, envelope);
Prefer following url where you get your answer. This question is asked by me. After had solve it and I put answer to use for others.
create soap envelope with security header in android using ksoap2
Upvotes: 1