SOAP on Android
Some projects require to communicate with Web services.
The JDK provides tool called wsimport that generates classes from WSDL, and user works with them like with other Java classes and may not know that he works with a Web service.

But it does not work on Android… Android SDK does not provide classes to work with Web services. So, it needs to manually work with Web services by using SOAP.

There is a good library called kSOAP 2 that is a lightweight SOAP Web service client library for constrained Java environments such as Applets or J2ME applications. There is a port of this library to Android platform that is allowed on Google code.

Weather forecast Web service
Lets try to use kSOAP 2 for getting weather forecast from the WeatherForecast Web service.

Next code calls the GetWeatherByPlaceName operation on Web service to get weather forecast for specified city for next few days


By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is

Leave a Reply