Note that there are some explanatory texts on larger screens.

plurals
  1. POWebservice call from android says permission denied
    primarykey
    data
    text
    <p>I have a web service in .net and I call it from android in localhost. It is to show a string in emulator display but it's not working. It shows access denied in the emulator.</p> <p>SoapTestActivity.java</p> <pre><code>package com.sample; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import org.ksoap2.*; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.*; public class SoapTestActivity extends Activity { TextView result; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); result = (TextView)findViewById(R.id.result); final String NAMESPACE = "http://sample.com/"; final String METHOD_NAME = "SayHello"; final String SOAP_ACTION = "http://sample.com/SayHello"; final String URL = "http://192.168.1.108/WebService1/Service1.asmx"; 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); SoapPrimitive response = (SoapPrimitive)envelope.getResponse(); String resultValue = response.toString(); result.setText(resultValue); } catch (Exception e) { result.setText(e.getMessage()); } } } </code></pre> <p>manifest.xml</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sample" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.sample.SoapTestActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>the url shown i the firefox browser is </p> <pre><code>http://localhost:5460/Service1.asmx </code></pre>
    singulars
    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.
 

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