Note that there are some explanatory texts on larger screens.

plurals
  1. POWebservice Calling Error in android
    primarykey
    data
    text
    <p>I am trying to call a .net based WCF service using ksoap2 in Android. I got the following error while making the httptransport call.</p> <p>Here is my code: </p> <pre><code>public class MainActivity extends Activity { EditText t1,t2; Button b1; TextView result; private static final String NAMESPACE="http://tempuri.org/"; private static final String METHOD_NAME="AddEmployee"; private static final String URL="http://10.32.4.24/Android/AndroidBus.svc"; private static final String SOAP_ACTION="http://tempuri.org/IAndroidBus/AddEmployee"; SoapObject request=new SoapObject(NAMESPACE,METHOD_NAME); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); t1=(EditText)findViewById(R.id.editText1); t2=(EditText)findViewById(R.id.editText2); result=(TextView)findViewById(R.id.textView1); b1=(Button)findViewById(R.id.button1); b1.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { PropertyInfo pi=new PropertyInfo(); pi.setValue("abc"); pi.setName("value1"); //pi.type=PropertyInfo.STRING_CLASS; SoapObject Request=new SoapObject(NAMESPACE,METHOD_NAME); Request.addProperty(pi); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12); envelope.dotNet=true; envelope.setOutputSoapObject(Request); new servicecall(envelope).execute(); } }); } public class servicecall extends AsyncTask&lt;String,Void,String&gt; { String res; SoapSerializationEnvelope envelope; public servicecall(SoapSerializationEnvelope envelope) { this.envelope=envelope; } @Override protected String doInBackground(String... arg0) { HttpTransportSE ht=new HttpTransportSE(URL); ht.debug=true; try { Log.d("WEBSERVICE","Calling"); ht.call(SOAP_ACTION,envelope); SoapPrimitive response = (SoapPrimitive)envelope.getResponse(); String dump=ht.responseDump.toString(); System.out.println("dumppp"+dump); Log.d("Tag","Response"+response); res=response.toString(); } catch(Exception e) { e.printStackTrace(); } return res; } protected void onPostExecute(String res) { super.onPostExecute(res); result.setText("completed"); } } </code></pre> <p>This is the error I am getting:</p> <pre><code>11-08 15:00:24.421: W/System.err(767): java.lang.NullPointerException 11-08 15:00:24.451: W/System.err(767): at org.ksoap2.transport.ServiceConnectionSE.getResponseProperties(ServiceConnectionSE.java:85) 11-08 15:00:24.473: W/System.err(767): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:187) 11-08 15:00:24.483: W/System.err(767): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:114) 11-08 15:00:24.504: W/System.err(767): at com.example.androidservice.MainActivity$servicecall.doInBackground(MainActivity.java:81) 11-08 15:00:24.522: W/System.err(767): at com.example.androidservice.MainActivity$servicecall.doInBackground(MainActivity.java:1) 11-08 15:00:24.533: W/System.err(767): at android.os.AsyncTask$2.call(AsyncTask.java:287) 11-08 15:00:24.541: W/System.err(767): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 11-08 15:00:24.661: W/System.err(767): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 11-08 15:00:24.671: W/System.err(767): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 11-08 15:00:24.685: W/System.err(767): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 11-08 15:00:24.711: W/System.err(767): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 11-08 15:00:24.722: W/System.err(767): at java.lang.Thread.run(Thread.java:856) </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.
    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