Note that there are some explanatory texts on larger screens.

plurals
  1. POcalling .net web service from android not working
    text
    copied!<p>I am calling a .net web service from my android app with no luck. Here is my code:</p> <p>package com.reza;</p> <p>import android.app.Activity; import android.os.Bundle; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import android.widget.TextView;</p> <p>public class callWebservice extends Activity { private static final String METHOD_NAME = "HelloWorld";</p> <pre><code> private static final String NAMESPACE = "http://tempuri.org/"; private static final String URL = "http://service.screwedmind.com/LocalBusiness.asmx"; private static final String SOAP_ACTION = null; TextView tv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv=(TextView)findViewById(R.id.text1); call(); } public void call() { 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(); tv.setText(result); } catch (Exception e) { tv.setText("error occured.."); } } </code></pre> <p>}</p> <p>when I run this program, I see my error text which is "error occured.." can anybody plz guide me what i am doing wrong.</p>
 

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