Skip to content Skip to sidebar Skip to footer

Android Ksoap2 Parameter Issues

I am trying to pass a parameter to my service, the code runs but the service never receives the parameters?? The call works, I simply add the variable then get it back, when gettin

Solution 1:

not sure about why is not working, but I remember using it with

request.addProperty("name", "my_Name");

and it worked fine, otherwise you may wanna check the server side...


Solution 2:

This line of code was my issue!!!

envelope.dotNet = true;

REMOVE IT


Solution 3:

Try to debug it following the instructions on the wiki.


Solution 4:

I cleaned up the code a little and put it in a function. I'm not sure if something is different but this code works. Thanks for the responses.

public SoapObject soap() throws IOException, XmlPullParserException {

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
    request.addProperty("name", "myname"); 
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request); 
    HttpTransportSE conn = new HttpTransportSE(URL);

    conn.call(SOAP_ACTION, envelope); //send request
    SoapObject result=(SoapObject)envelope.getResponse(); 
    return result;
 }

Solution 5:

final String NAMESPACE = " http://NathofGod.com/";

Change to

final String NAMESPACE = "http://NathofGod.com/";

Remove the empty space and make then namespace as it is on your request XML. Please note that it is case sensitive as well.


Post a Comment for "Android Ksoap2 Parameter Issues"