Ksoap2 socket not connected exception in android with .Net soap webservice
<p>i have done the following code in android for connecting to .net soap web service but it gives an errorr java.net.sockettimeoutexception : Socket not connected. </p>

<p>my code</p>

<pre><code>package com.hello;

import android.app.Activity;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.os.Bundle;
import android.widget.TextView;

public class HelloWorldActivity extends Activity {
    /** Called when the activity is first created. */


    private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld";
    private static final String METHOD_NAME = "HelloWorld";
    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://x.x.x.x/HelloWebService/HelloWebService.asmx";
    public TextView mResult;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.main); 

        mResult=(TextView)findViewById(R.id.textView2);

        try {

            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

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

            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
            androidHttpTransport.call(SOAP_ACTION, envelope);

            String result=(String)envelope.getResponse();
            mResult.setText("Content:" +result);

        } 
        catch (Exception e) 
        {
            mResult.setText(e.toString());


        }      
        }
    }
</code></pre>

<p>Help me please...!</p>
