// Create the outgoing message
SoapObject requestObject = new SoapObject("x", "getQuote");
// ask for the specially encoded symbol in the included service
requestObject.addProperty("symbol", "XXX");
// use version 1.1 of soap
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
// add the outgoing object as the request
envelope.setOutputSoapObject(requestObject);
new MarshalFloat().register(envelope); // not really needed for j2se version
// Create a transport layer for the J2SE platform. You should change this for
// another transport on midp or j2me devices.
HttpTransportSE transportSE = new HttpTransportSE("http://localhost:8080/axis/StockQuoteService.jws");
// turn on debug mode if you want to see what is happening over the wire.
transportSE.debug = true;
try {
// call and print out the result
transportSE.call("getQuote", envelope);
System.out.println(envelope.getResponse());
} catch (Exception e) {
// if we get an error print the stacktrace and dump the response out.
e.printStackTrace();
System.out.println(transportSE.responseDump);
}
This way we can client SOAP client for Android. kSOAP2 internally used kxml parser which is pullparser thats why this api is assumed to be highly performance api.
kSOAP is an open source project you can download it from here.