cookiemonster
cookiemonster

Reputation: 131

Connecting to remote domino/lotus notes server to send/retrieve user mails, contacts, etc using C#

I am trying to create a web service using C#/.Net that can remotely access any user's lotus notes mailbox, contacts, etc. That is given the sever address and username/password details I want to send mails, create contacts, etc. Much like what one might do with EWS managed API for exchange accounts. I am currently using interop.domino.dll for this. It hasn't worked for me so far.

var session = new NotesSession();
session.InitializeUsingNotesUserName("username", "password");
var db = session.GetDatabase( "server", "xyz.nsf", false ); 

throws exception saying "user is not a server" or

"Failed to read server configuration"

I am a total lotus newbie and any help would be appreciated.

Upvotes: 0

Views: 2342

Answers (1)

notes-jj
notes-jj

Reputation: 1547

You mixed the server and client way to access the NotesSession. You have two choices:

  1. Client Way

    session.Initialize("password"); or session.Initialize();

    Install a Notes Client and use Initialize(). If the client is started you do not need to provide a password. If the client is not started a password query will appear. The client is using the configured notes.id and needs that password. You could create a superuser id, that is capable to access all mail file and you do the authentication on your own. Initialize (NotesSession - LotusScript®)

    This also should work on a server, but never tried this.

  2. Server Way

    session.InitializeUsingNotesUserName("username", "password");

    I never tried this, but mistakenly used the method, so I know it's an error to use it with a client.

    Theoretically: You Install a Domino Server and use the username and http-password of a user to identify as this user. I don't know if the dll find the right installation if you mix Notes Client and Server on on computer. Theoretically this could be controlled by the path variable, which executables the dll can reach via path. InitializeUsingNotesUserName (NotesSession - LotusScript®)

    Domino Server on Windows Client: You can install a Domino Server on a Windows Client for testing purposes, the server will have limited network connections, because of the windows client, but it's utilizable for development. Bear in mind the EULA for Microsoft and IBM.

interop.domino.dll is not in focus of IBM any more. So think about what Richard Schwartz said and focus on the existing REST API or write your own web services as Notes Database and access it from C# as web service.

Upvotes: 1

Related Questions