Note that there are some explanatory texts on larger screens.

plurals
  1. POHttp GET method Error while calling REST wcf service
    primarykey
    data
    text
    <pre><code>public void callService() { HttpPost postMethod = new HttpPost(url); List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(); nameValuePairs.add(new BasicNameValuePair("latitude",latitude)); nameValuePairs.add(new BasicNameValuePair("longitude",longitude)); try { postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs)); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } DefaultHttpClient hc = new DefaultHttpClient(); HttpResponse response = null; try { response = hc.execute(postMethod); // not able to execute the statement. } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } HttpEntity entity = response.getEntity(); if (entity != null) { InputStream inStream = null; try { inStream = entity.getContent(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } result= convertStreamToString(inStream); Log.i("---------------- Result",result); } } // end callService() </code></pre> <p>We are trying to call a WCF Rest service from my android device, above is the code for the same, I found out that the code is terminating after this statement in the code : <strong>response = hc.execute(postMethod);</strong> Any help in this context will be highly appreciated. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    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