Comments on: How to Consume Web Services from Android Applications Using kSOAP2 Solutions and tutorials for IT&C development Fri, 27 Mar 2020 20:45:50 +0000 hourly 1 By: Sayo Fri, 30 Aug 2013 06:57:03 +0000 hey,
I am using soap object only…
and eveything is working f9 if i use API 8…
but if i swich API to 9 to higher this doesnt work…
Plz need help regarding this..

By: Chitra Wed, 28 Nov 2012 05:32:35 +0000 thanks Paul for answering Nobin’s question it helped me.

By: hckr Tue, 31 Jul 2012 12:56:21 +0000 do i need WTP plugin?

By: ALI HABIB Wed, 02 May 2012 14:43:55 +0000 how to call function in webservice that call function take parameters

By: rathu Thu, 26 Apr 2012 06:31:41 +0000 I hav tryd with kvmserializable still the error persists.

By: rathu Thu, 26 Apr 2012 06:30:16 +0000 Hi Paul,
I can able to retrieve data from Webservice. But i am not able to write complex data types like date,float etc into the webservice. I am not able to parse the date and float values. So plz help me out.

By: sumadhi Wed, 28 Mar 2012 07:36:31 +0000 iam developing andriod application to consume webservices which is written in .net

my code:
private static final String SOAP_ACTION = “”;

boolean result=false;
private static final String METHOD_NAME = “HelloTo”;

private static final String NAMESPACE = “”;

private static final String URL = “”;

public boolean call()
Toast.makeText(getBaseContext(),”method called”, Toast.LENGTH_SHORT).show();

Toast.makeText(getBaseContext(),”in try”, Toast.LENGTH_SHORT).show();
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//request.addAttribute(“str”, phone);
//EditText mob=EditText(findViewById(id))
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
Toast.makeText(getBaseContext(),”request1″, Toast.LENGTH_SHORT).show();

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
Toast.makeText(getBaseContext(),”request2″, Toast.LENGTH_SHORT).show();, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
Toast.makeText(getBaseContext(),”request3″, Toast.LENGTH_SHORT).show();
Log.i(“myApp”, response.toString());
System.out.println(“response” +response);

result = true;


}catch(SocketException ex)
//Log.e(“Error : ” , “Error on soapPrimitiveData() ” + ex.getMessage());
catch (Exception e) {
Log.e(“Error : ” , “Error on soapPrimitiveData() ” + e.getMessage());
return result;

my logcat says:

03-28 12:05:39.732: E/Error :(1161): Error on soapPrimitiveData() attr value delimiter missing! (position:START_TAG @2:11 in
followed by xmlpullparser exception
i want to run on local host.

please suggest

By: Paul Sat, 24 Mar 2012 21:40:20 +0000 In reply to Rajnikant.

Hi Rajnikant,

As far as I know that is the only way to retrieve complex objects through a SoapObject. You can wrap the call in your own method that creates a Person object by using several GetProperty() calls.


By: Rajnikant Tue, 20 Mar 2012 12:43:08 +0000 Hi,
Thanks for the post.
I have question
I have developed my wcfservice in
Now I want to consume it in android.
I can do it with ksoap library easily, working fine with simple data.

Now I have Wcf Service method which returns a Person object which is created in .net.

Now I want to get that Person into android.
How can I do that ?

Note : I can achieve it by using GetProperty method, but I want direct assignment.


By: Paul Thu, 01 Sep 2011 12:26:05 +0000 In reply to Nobin.

I have tried your code with my Web service and everything is working. Check again the permissions. This is my AndroidManifest.xml file: