Note that there are some explanatory texts on larger screens.

plurals
  1. POksoap2 android consuming .NET WCF web service XMLPullParserError please help
    primarykey
    data
    text
    <p>ive spent about 10 hours over the past 2 days trying to figure this out and still cannot get it to work. i made a WCF service in VS2010 and i have it hosted in IIS. Im trying to call the service in Java in an Android project but i keep getting this error</p> <pre><code>org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@4052b038) </code></pre> <p>here is my code:</p> <pre><code> package asdd.sd; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import android.app.Activity; import android.os.Bundle; public class AsdasdActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String nameSpace = "http://findmydroid.com/"; String methodName = "GetData"; String soapAction = "http://findmydroid.com/GetData"; String url = "http://10.0.2.2/FindMyDroid/Service1.svc"; SoapObject soapObject = new SoapObject(nameSpace, methodName); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12); envelope.dotNet = true; envelope.setOutputSoapObject(soapObject); HttpTransportSE transport = new HttpTransportSE(url); PropertyInfo pi = new PropertyInfo(); pi.setName("value"); pi.setValue(55); soapObject.addProperty(pi); try { transport.call(soapAction, envelope); String dump = transport.requestDump; SoapPrimitive response = (SoapPrimitive)envelope.getResponse(); boolean result = Boolean.parseBoolean(response.toString()); } catch(Exception ex) { ex.printStackTrace(); } } } </code></pre> <p>and here is the code for my web service:</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; namespace FindMyDroid.WCF { [ServiceContract(Namespace = "http://findmydroid.com/")] public interface IService1 { [OperationContract] string GetData(int value); // TODO: Add your service operations here } } Here is the Service1 Class namespace FindMyDroid.WCF { public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } } } </code></pre> <p>All i want to do is just test the service so i know that i can connect to it with Java if anybody can please help me out with this error. I have tried so many different examples from here (Stackoverflow) and other websites as well. I've tried by hosting the service in Visual Studio's ASP host and IIS. I've tried calling it with my external IP Address as well with no results.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload