Web Service is used to load data from server in your Application. In some of my last posts i explain how to create, read and send data to server from your android application but all service’s are JSON based. In this post i explain you how to load and send data from SOAP web service in your android application.

What is SOAP?

SOAP is a standards-based web services technology that allows providers to abstract data and transport implementations over the web. It relies on Extensible Markup Language (XML) for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission

Load Data from SOAP web service in Android Application

SOAP web service in Android Application

Step 1. Create new project in Android Studio / Eclipse.

Step 2. Before we start creating our project we need external library for SOAP to load data from SOAP based web service. I use KSOAP2 library to load and send data to service You download from here.

Step 3. After download you need to add KSOAP2 library in your project in android studio paste your KSOAP2.jar file in libs folder inside app folder

Step 4. Now open your AndroidManifest.xml and add permission of internet to request server and get data.

Step 5. Now open your activity_main.xml file inside layout folder. Here i create a form in which i send data to server and get response.

Step 6. Now open your MainActivity.java file. Here we request to server we use Async task to request server. Note i am using w3school soap url for example [http://www.w3schools.com/webservices/tempconvert.asmx].

 

calculate() method is main method in above code in this we create SOAP request and set parameter [Request.addProperty(“Key”, “value”)] and request to server