Note that there are some explanatory texts on larger screens.

plurals
  1. PONot Loading data Using KSOAP2 in Android
    text
    copied!<p>I have developed an Android application which downloads data using the KSOAP2 API. It's working on Android 2.2, but its not working on Android 4.0. Is there any configuration or any other difference between these two versions?</p> <p>Here is the code...`package nj.example;</p> <pre><code>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; import android.util.Log; import android.widget.TextView; public class AandroidWebserviceActivity extends Activity { /** Called when the activity is first created. */ private final String NAMESPACE=here`"http://www.naveenbalani.com/webservices/WassupAndroidService/"; private final String URL = "http://naveenbalani.com/WassupAndroid.asmx"; private final String SOAP_ACTION = "http://www.naveenbalani.com/webservices/WassupAndroidService/todaysMessage"; private final String METHOD_NAME = "todaysMessage"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //Create Soap Object SoapObject object=new SoapObject(NAMESPACE,METHOD_NAME); SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet=true; envelope.setOutputSoapObject(object); // System.out.println("sset envelope"+envelope); HttpTransportSE androidtransportSE= new HttpTransportSE(URL); //System.out.println("after asign url"); try { androidtransportSE.call(SOAP_ACTION,envelope); //problem is here SoapPrimitive response=(SoapPrimitive)(envelope.getResponse()); Log.i("Response", response.toString()); TextView tv = new TextView(this); tv.setText(response.toString()); setContentView(tv); } catch(Exception e){} } </code></pre> <p>}</p> <p>Manifest.xml </p> <pre><code> &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nj.example" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;application android:label="@string/app_name" &gt; &lt;activity android:name=".AandroidWebserviceActivity" 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; </code></pre> <p></p> <p>Thanks in advance.</p> <p>Nijo</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