Android: XmlPullParsException - cant find any solution
<p>I am writing a test program for a web service written in C# .net. I want to call that service from Android. I have tested the web service and it works fine in the browser. But since i am getting XMLpuLLparsException i dont think the xml format recived is correct.</p>

<pre><code>My webservice its pretty simple. you search for a StudentNumber and returns your name.
i have follow this example: [Access webservice from android][1]

  [1]: http://adrianandroid.blogspot.no/2012/05/access-c-net-web-service-in.html

My C# sharp code is the same as in the example.
Under is my Android java code.

The corretct error message i am reciving:

*org.xmlpull.v1.XmlPullParserException: expected:START_TAG{http://schemas.xmlsoap.org/soap/envelope/}Envelope(position:START_TAG&lt;HTML&gt;@2:7 in java.io.inputStreamReader@40d43380)*
    package com.example.asd;

import java.io.IOException;

import javax.crypto.SealedObject;

import android.os.Bundle;
import android.os.StrictMode;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import org.ksoap2.*;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.Marshal;
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 org.xmlpull.v1.XmlPullParserException;

public class MainActivity extends Activity {





    private static final String SOAP_ACTION = "http://tempuri.org/findContact";
    private static final String METHOD_NAME = "findContact";
    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://10.0.2.2:62247/MyService.asmx";

    TextView tvData1;
    EditText edata;
    Button button;
    String studentNo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);

        tvData1 = (TextView)findViewById(R.id.textView1);


        button=(Button)findViewById(R.id.button1);

        button.setOnClickListener(new OnClickListener() {

            @SuppressWarnings("deprecation")
            public void onClick(View v) {
                  SoapObject request = new SoapObject(NAMESPACE,  METHOD_NAME);
                    PropertyInfo propertyInfo = new PropertyInfo();
                    propertyInfo.type = PropertyInfo.STRING_CLASS;
                    propertyInfo.name = "eid";

                    edata =(EditText)findViewById(R.id.editText1);
                    studentNo=edata.getText().toString();

                    request.addProperty(propertyInfo, studentNo);

                            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                            SoapEnvelope.VER11);
                            envelope.dotNet = true;

                            envelope.setOutputSoapObject(request);

                            HttpTransportSE httpTransport = new HttpTransportSE(URL);
                            httpTransport.debug = true;


                            try  {                   
                            httpTransport.call(SOAP_ACTION, envelope);  
                            Log.i( "request",httpTransport.requestDump);
                            Log.i("response", httpTransport.responseDump);


                            SoapObject response = (SoapObject)envelope.getResponse();
                           // Object response = envelope.getResponse();                   
                            tvData1.setText(response.toString());                   
                            }  catch (XmlPullParserException e)   {
                                          tvData1.setText(e.toString()+"  Or enter number is not Available!");                   
                            } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }

                    tvData1 = (TextView)findViewById(R.id.textView1);

            }
        });


        //client = new DefaultHttpClient();           
        //new Read().execute("text");



}




POST /MyService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/findContact"

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;findContact xmlns="http://tempuri.org/"&gt;
      &lt;eid&gt;string&lt;/eid&gt;
    &lt;/findContact&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;findContactResponse xmlns="http://tempuri.org/"&gt;
      &lt;findContactResult&gt;string&lt;/findContactResult&gt;
    &lt;/findContactResponse&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>
