I am having a lot of trouble finding good information on how to call a standard SOAP/WSDL web service with Android. All I've been able to find are either very convoluted documents and references to "kSoap2" and then some bit about parsing it all manually with SAX. OK, that's fine, but it's 2008, so I figured there should be some good library for calling standard web services.
The web service is just basically one created in NetBeans. I would like to have IDE support for generating the plumbing classes. I just need the easiest/most-elegant way to contact a WSDL based web service from an Android-based phone.
I think Call SOAP Web Service from Android application will help you a lot.
Add Soap Libaray(
ksoap2-android-assembly-3.2.0-jar-with-dependencies.jar
):public static String Fn_Confirm_CollectMoney_Approval(
I've created a new SOAP client for the Android platform. It is using a JAX-WS generated interface, but it is only a proof-of-concept so far.
If you are interested, please try the example and/or watch the source at AndroidSOAP.
Call ksoap2 methods. It works very fine.
Set up the details, like
and then to get the result do
If you are having problem regarding calling Web Service in android then You can use below code to call the web service and get response. Make sure that your the web service return the response in Data Table Format..This code will help you if you using data from SQL Server database. If you using MYSQL you need to change one thing just replace word NewDataSet from sentence
obj2=(SoapObject) obj1.getProperty("NewDataSet");
by DocumentElementIf you have any problem regarding this you can write me..