Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid HTTP authentication on Lotus Domino server
    primarykey
    data
    text
    <p>I am developing an android application capable of read data from a Lotus Domino database. I started to create a page to test the HTTP authentication and I encountered many difficulties. This is my code snippet: </p> <pre><code> public void GoAuth(View v){ final String httpsURL = "http://xxx.xxx.xxx.xxx/names.nsf/mypage?openpage"; final DefaultHttpClient client = new DefaultHttpClient(); final HttpPost httppost = new HttpPost(httpsURL); String userName = "demo"; String password = "demo"; try { //authentication block: final List&lt;BasicNameValuePair&gt; nvps = new ArrayList&lt;BasicNameValuePair&gt;(); nvps.add(new BasicNameValuePair("Username", userName)); nvps.add(new BasicNameValuePair("Password", password)); final UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(nvps, HTTP.UTF_8); httppost.setEntity(p_entity); //sending the request and retrieving the response: HttpResponse response = client.execute(httppost); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() == HttpURLConnection.HTTP_OK){ //handling the response final InputSource inputSource = new InputSource(responseEntity.getContent()); TextView res=(TextView)findViewById(R.id.result); res.setText("Server response: "+inputSource.toString()); } } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } </code></pre> <p>The server response is: org.xml.sax InputSource@40575700</p> <p>Trying the same in a browser I see the login page and after then the content of "mypage". I am a bit confused about the right approach and mechanism I have to follow on android. Any help will be greatly appreciated!</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.
 

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