Hello everyone
I'm trying to get ksoap2 working on android. I have spent at least 10 hours now reading forum posts, and documentations. Just querying some methods like getServerTime where I don't have to send any values, works. My goal is to send data, and receive a response. For example: send city name, get city time.
I'm practicing on this site: http://www.nanonull.com/TimeService/TimeService.asmx
this is my code:
String METHOD_NAME = "getCityTime";
String SOAP_ACTION = "http://www.Nanonull.com/TimeService/getCityTime";
String NAMESPACE = "http://www.nanonull.com/TimeService/";
String URL = "http://www.nanonull.com/TimeService/TimeService.asmx";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("city", "Chicago");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(URL);
try {
httpTransport.call(SOAP_ACTION, envelope);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} // This sends a soap
System.out.println(envelope.bodyIn.toString());
this is the error I get(envelope.bodyIn.toString()):
SoapFault - faultcode: 'soap:Server'
faultstring: 'Server was unable to process request. ---> Object reference not set to an
instance of an object.' faultactor: 'null' detail: org.kxml2.kdom.Node@435b9cf8
Help would be greatly appreciated.