0

I want to build lotus notes leave application on android. For that purpose I need some lotus script files which will provide me data for showing in my app. But first thing what I need is to get server login But after trying to login I am not getting proper response. I need advice how can I proceed to build the app leave application for ibm lotus notes.

 protected static void tryLogin()
    { ``          
        HttpURLConnection connection;
        OutputStreamWriter request = null;

            URL url = null;   
            String response = null;         
            String parameters = "username="+"ABCD"+"password="+"!!!!!!!!";   

            try
            {
                url = new URL("http://10.194.5.33/dvlp/wdcidmanage.nsf/hwlsp?wsdl");
                connection = (HttpURLConnection) url.openConnection();
                connection.setDoOutput(true);
//                  connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                connection.setRequestMethod("POST");    

                request = new OutputStreamWriter(connection.getOutputStream());
                request.write(parameters);
                request.flush();
                request.close();            
                String line = "";               
                InputStreamReader isr = new InputStreamReader(connection.getInputStream());
                BufferedReader reader = new BufferedReader(isr);
                StringBuilder sb = new StringBuilder();
                while ((line = reader.readLine()) != null)
                {
                    sb.append(line + "\n");
                }
                // Response from server after login process will be stored in response variable.                
                response = sb.toString();
                System.out.println("response--------------------------"+response);
                // You can perform UI operations here
              //  Toast.makeText(this,"Message from Server: \n"+ response, 0).show();             
                isr.close();
                reader.close();

            }
            catch(IOException e)
            {
                // Error
                System.out.println("error"+"----------------error is there------------");

            }
    }

this is my code snippet for login. in the server side what i need to do for login ?

2 Answers2

0

If I understood, your need to consume a Domino WS: http://xx.xxx.x.xx/dvlp/wdcidmanage.nsf/hwlsp?wsdl

  1. Ask the Domino administrator to add Anonymous in the ACL of the wdcidmanage.nsf

  2. Consume the WS in androide: http://www.c-sharpcorner.com/UploadFile/88b6e5/how-to-call-web-service-in-android-using-soap/

Emmanuel Gleizer
  • 1,990
  • 16
  • 26
  • yeah understood , but we have http://10.194.5.33 that is already built , through which i have to login first then i can use the following web service http://10.194.5.33/dvlp/wdcidmanage.nsf/hwlsp?wsdl .when i am trying to establish connection with it it returns me a html page , So my question is also will i need to build a webservice within http://10.194.5.33 in this server for login first ,then i understood that i need to build further web services in soap. – sucharita ganguly Jul 10 '14 at 08:52
  • for giving anonymous in the ACL of wdcidmanage.nsf we need to login first with authorized user , please give idea how will i able to login and get proper response from android app with valid userid and password in the 10.194.5.33 thanks in advance for ur co-operation. – sucharita ganguly Jul 10 '14 at 09:32
  • Administration of Domino has to be done using Lotus Notes Domino client. Open the http://xx.xxx.x.xx/dvlp/wdcidmanage.nsf/hwlsp?wsdl your will see the EXISTING service. your don't have to built a new WS but consume it. – Emmanuel Gleizer Jul 10 '14 at 09:43
  • But the developer who is working as domino , said that he will not have the access to get the permission to built webservice at the time of login in ip 10.194.5.33 , pls some advice needed.. – sucharita ganguly Jul 25 '14 at 07:18
  • I'm not sure I understand you! in a browser (chrome for example) open the following URL http://10.194.5.33/dvlp/wdcidmanage.nsf/hwlsp?wsdl what do you get ? If you get a login form it means that the Domino server ASKS authentication. BTW check that YOU have login/password AND DON'T WRITE THEM HERE! see http://stackoverflow.com/questions/10539408/authentication-and-web-services-in-domino and http://stackoverflow.com/questions/9717749/accessing-domino-server-using-android-apps – Emmanuel Gleizer Jul 27 '14 at 05:30
0

For an overview of Domino web server authentication see this article. I wrote the article with Domino REST services in mind, but a lot of it applies to SOAP-based services too. This is because authentication is normally done in a layer that's common to REST and SOAP.

You probably want to start with basic authentication. That means sending an Authorization header with each web service request. The value of the Authorization header is just the base64 encoded user name and password as described in this Wikipedia article.

In your comment you said, "when i am trying to establish connection with it it returns me a html page." That sounds like the server is set up for session authentication. As the first article says, you can set up a web site rule to override session authentication for your web service. Then you will get back an HTTP 401 response when the request isn't properly authenticated.

Dave Delay
  • 1,292
  • 8
  • 12
  • thanks for your reply.. can you please send the code snippet for buiding webservce in server side authentication in domino lotus scripts if possible ,please reply . – sucharita ganguly Jul 14 '14 at 12:31
  • Sorry. I am confused. Your original question implied you had already built a SOAP-based web service on Domino, but you were having trouble authenticating client requests. Now you are asking for a "code snippet for building web service." Isn't that a new question? – Dave Delay Jul 14 '14 at 20:53
  • yes I have the soap based webservice it can be only accessed after login ,aleady we have http://10.194.5.33 this ip is prebuild ,for web users only . In this url I need to build a webservice at the time of login that will accessed by android .. hope i am able to make u understand the original problem :-) – sucharita ganguly Jul 15 '14 at 07:34