Tutorial 051-3, internet, http SOAP with kSOAP 2 lib

August 18, 2011   ·   0 Comments

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



shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter


Readers Comments (0)

You must be logged in to post a comment.

PowenKo’s Online Store




Recent Posts