Android WebService 101
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about calling SOAP web services from Android with ksoap2, treating it as the go-to walkthrough.
Recommended by 4 people across 5 different months, 2012 to 2016.
What it is
A 19-minute tutorial from Falafel Software showing how to call a .NET web service from an Android app using the KSOAP 2 library. It walks through setting up the SOAP request and reading the response in Eclipse-era Android code.
What people said
Recommends agrodude · 2012-06 · Stack Overflow · on “Android ksoap2 Microsoft Webservice - unable to pass parameters to webservice”
I am learning how to create an android app and webservice using: Eclipse IDE ksoap2 version 2.6.5 with dependencies Visual studio 2010 my method was to follow this great tutorial: [this video] the tutorial works fine with the w3schools test webservice. I then attempted to write my own webservice and used the helloworld webservice provided in Visual studio to start me off. I ammended my code to point at the new webservice (published on my development laptop) and ran it on my handset in debug mode. the communication with the webservice is fine when calling the HelloWorld() webservice. it even returns a result from simpleMethod() but it does not include the parameter that I passed it. e.g. when call
Recommends Rob Angelier · 2012-09 · Stack Overflow · on “Object Parameters and Object Return C# WebService to Android”
You could implement a service in different ways. Some examples are: ServiceStack [LINK] WCF Service [LINK] WebAPI [LINK] You could send the data from your client (Android application) to your service in JSON. Inside this service you should implement something to convert this JSON notation back to a .net object. You can use JSON.net for this. More information about this, can be found here: [LINK] You should keep this in mind: Serialize data from your client (Android) to a string in JSON notation. Send the data to your service Deserialize the request to .NET object. (some frameworks do this for you) Do something with the .NET object and return a response to the client Here are some examples fo
Recommends Raghunandan · 2012-10 · Stack Overflow · on “SOAP Envelope Response Error: Error reading XMLStreamReader”
Shoukry K is right. You have done a HTTP POST request. This is not a soap webservice. If you want to know how to call a webservice follow the link. [this video] . Make sure you download the latest ksoap jar file.
Recommends Raghunandan · 2013-03 · Stack Overflow · on “Android: Creating and Sending an XML SOAP Request Programmatically”
[this video] . The video has a tutorial of how to go about sending a soap webservice request in android. [LINK] . The link here has an example with explanation. Go through the links and modify your code accordingly. Sending request in xml form. I had a similar requirement and i used the below format to sent a soap reuest in xml form. Modify the below according to your needs. I PropertyInfo loginreq = new PropertyInfo(); loginreq.name="LoginReq"; loginreq.type=String.class; loginreq.setValue("<LoginReq>" +"<nickName>"+name+"</nickName>" +"<password>"+pass+"</password>" +"<IMEI>"+mImei+"</IMEI>" +"<location>" +"<latitude>"+lati+"</latitude>" +"<longitude>"+longi+"</longitude>" +"</location>" +"</Lo
Recommends Job · 2016-05 · Stack Overflow · on “Android application connection with web services”
The following video tutorial maybe can help: [this video] [LINK] dont forget to add permission to access internet to your manifest check whether the parameter cases are the same with the one in the web service check whether you have added your library path to the buil.gradle
Recommends Job · 2016-05 · Stack Overflow · on “Android Web Service Connection ERROR”
The following video tutorial maybe can help: [this video] [LINK] dont forget to add permission to access internet to your manifest check whether the parameter cases are the same with the one in the web service check whether you have added your library path to the buil.gradle
Cites amp · 2012-05 · Stack Overflow · on “Accessing a WebService on LocalHost”
I put here a list of sites that have helped me to understand better how to create and consume WS: link1 [LINK] link2 [this video] link3 [LINK] link4 [LINK] I hope these helps you...
Cites user1743224 · 2012-10 · Stack Overflow · on “Android/Eclipse: How to embed .jar file?”
I am having trouble embedding a library (ksoap in my case) into my project. There is an error at run time "Could not find class 'org.ksoap2.serialization.SoapObject' referenced from method ...". Of course, this class is available within the ksoap library, no need to mention that i have the respective "import..." lines in my code. I have tried embedding it in different ways that I have found here on stackoverflow and in other places. I tried it via Properties => Build Path => Add external jar and via Import jar, Properties => Build path => Add jar. It does not make a difference and the same happens with other libraries as well. I also tried to choose the Google API or Android as Build Target
Cites Shahed Sh · 2012-11 · Stack Overflow · on “webservice return Error instead of the expected value with soap”
this is my code that I write to call webservice using this video [this video] . When I run it, I received an Error string instead of 89.6. package com.flafel.myTest; import android.app.Activity; import android.net.http.AndroidHttpClient; import android.os.Bundle; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import org.ksoap2.SoapEnvelope; import android.widget.*; public class FirstScreen extends Activity { /** Called when the activity is first created. */ private static final String SQAP_ACTION = " [LINK] "; private static final String METMOD_NAME =
Cites Raghunandan · 2012-11 · Stack Overflow · on “Android: invoking web services using SOAP”
I used the below to make a soap request for login. Modify the same accodring to your needs. Make sure you have the latest soap jar file included in your project lib.Also have a look at this tutorial. [this video] . SoapObject request = new SoapObject("NameSpace", "MethodName");// loginreq.setValue("<LoginReq>" +"<nickName>"+name+"</nickName>" +"<password>"+pass+"</password>" +"<IMEI>"+mImei+"</IMEI>" +"<location>" +"<latitude>"+lati+"</latitude>" +"<longitude>"+longi+"</longitude>" +"</location>" +"</LoginReq>");//my requirement was to send request in this format. PropertyInfo loginreq = new PropertyInfo(); loginreq.name="LoginReq"; loginreq.type=String.class; request.addProperty(loginreq); //sen