Lotus NotesDomino and by variablepitch334

VIEWS: 717 PAGES: 31

									Lotus Notes/Domino and .Net integration toolkit
This toolkit enables integration of Lotus Notes/Domino with Microsoft‟s .Net products and technologies. Contained within is a collection of working code samples and documentation showing how to create applications that use both .Net and Lotus Notes/Domino functionality.

Table of contents Overview Web Services Notes/Domino XML & http interfaces COM SmartTags

Overview Lotus Notes/Domino is an older application platform providing line of business solutions for many enterprises. These legacy applications could benefit greatly from capabilities found in Microsoft‟s .Net products and technology. Like wise, .Net applications that reuse existing Notes/Domino functionality can profit by linking these systems together. Thanks to the use of standards by Microsoft and Lotus, it is easy to incorporate functionality found on one platform into the other. Working examples of hybrid applications are provided along with a demo site www.msdomino.net.

Hosting a Web Services Web services are one means to accessing existing Notes/Domino applications and Notes/Domino R5 and later versions, can surface any application as a web service using LotusScript, Lotus‟ native scripting language (think VBA), and a web Agent (an URL evoked program). Microsoft products are outstanding at working with web services. Notes: Notes/Domino release 7 contains a new design element for hosting web services. Using Web Services requires no changes to the original Notes/Domino application and can be done by a LotusScript programmer with current skills at no cost.

There are many ways to add a web service interface to existing Notes/Domino applications. TomCat, ASP.Net, IPlanet, Websphere or any web services server could provide a web service that uses the Lotus Domino Objects through Java or COM. With this method, the Domino server is just acting as a local API. The method we are going to

talk about here uses native Domino functionality and runs on all Notes/Domino platforms. Long before web services existed Notes/Domino had the ability to execute programs as the result of a URL call. Domino can also write text back to an HTTP client although the default format is HTML. So, it is a fairly simple matter to add a SOAP standard interface to this existing bi-directional functionality. Therefore, a SOAP interface can be added to any of the Domino platforms without any changes to the code. The tools for creating a Domino hosted web service are found natively in the Domino development environment (Domino Designer) release 5 and up. WSDL An important part of a Web Service is its WSDL (Web Service Description Language) file which descript the interface to the web service. Release 7 of Domino generates and provides http access to the WSDL file. In release 5&6, you need to create and publish it with Domino design elements. Domino has design elements call “Pages” where Text placed on a page is converted to HTML and presented with a URL call. The Page URL syntax is as follows: http://MyServerName/MyNotesDatabaseName.nsf/PageName.

This location and syntax is where we put the WSDL text for the Domino web service. To prevent the default behavior of converting the text to HTML in Domino release 6, the Properties box for the page must have the Content Type “other” radio button selected and “text/xml” typed in the blank as shown below:

Figure 1 - Document properties dialog from Lotus Designer

Release 5 “Pages” do not have this property radio button. The Content Type must be set by setting Web Access to HTML and adding Content Type to the text of the page header.

How to create a WSDL file?
Visual Studio.net automatically creates WSDL files as part of a Web Service Project type. All that is needed is to create a web service using ASP.NET Web Service template ( See figure x) and define an interface that is the same as your Domino web service. There is no need to put real code in the service just the interface definition, for the purpose of Visual Studio creating the WSDL file. For example if the service searches the Domino directory and returns an e-mail address given a last and first name combination, your interface will require a “LastName/FirstName” parameter and return the string “E-Address”. Visual Studio‟s wizard can then generate a WSDL file for the service.

Figure x – new Visual Studio.net project using ASP.Net Web Service template

The template has added web service example code to the new project (seen here in green)

New ASP.Net web service project code window

If you uncomment the 4 lines of “HelloWorld” Web Method code, you will have a complete web service that takes no parameters and returns the string “Hello World”. Instead of using the example web service, we can create a new web service definition with many methods. Below see code for a web service called “DomService” with the name space of “Domino” and 6 Methods (GetQuote, getperson, randomperson, GetUserSystemInfo, randomPC, and CalSearch). Each method takes one parameter and returns one value.
Imports System.Web.Services <WebService(Namespace:="Domino", Description:="A collections of services hosted on Domino DominoQuote, DirectorySearch, CalendarSearch")> _ Public Class DomService Inherits System.Web.Services.WebService

<WebMethod(Description:="this method takes an integer and returns a string quote")> _ Public Function GetQuote(ByVal quoteIndex As Integer) As String Return (quoteIndex.ToString & " this is the result") End Function <WebMethod(Description:="this method takes last name, searches a Domino directory and returns a list of info")> _ Public Function getperson(ByVal Lname As String) As String Return (Lname & " this is the result") End Function <WebMethod(Description:="this method takes a index number, creates a random number not equal to the index, locates a person in the Domino directory and returns a list of info")> _ Public Function randomperson(ByVal currentN As Integer) As String Return (currentN.ToString & " this is the result") End Function <WebMethod(Description:="this method takes a user name, first and last, locates tha person in the PC Census database and returns system infomation")> _ Public Function GetUserSystemInfo(ByVal UName As String) As String Return (UName & " this is the result") End Function <WebMethod(Description:="this method takes a index number, creates a random number not equal to the index, locates by index a random person in the PC Census database and returns system info")> _ Public Function randomPC(ByVal UName As String) As String Return (UName & " this is the result") End Function

<WebMethod(Description:="this method a ~ delimiated parameter string (FromDate, ToDate, Entry Type,MaxEntries) and searches a Calendar database returning entry(ies) as string")> _ Public Function CalSearch(ByVal parameters As String) As String Return (parameters & " this is the result") End Function ' WEB SERVICE EXAMPLE ' The HelloWorld() example service returns the string Hello World. ' To build, uncomment the following lines then save and build the project. ' To test this web service, ensure that the .asmx file is the start page ' and press F5. ' '<WebMethod()> Public Function HelloWorld() As String ' HelloWorld = "Hello World"

' End Function End Class

After adding this code, run the debugger:

Visual Studio will create a test client for the web service.

Select the “Service Description” link (shown in red) to see the auto generated WSDL.

Select “View”, “source” to see the WSDL without the plus/minus formatting.

Copy this text and paste it into a Notes/Domino Database “Page” with it‟s “Context Type” set to text/XML (as seen earlier). The database should be on a Domino server (it can be localhost
WSDL:

Cut and paste the generated WSDL text into a Domino Page. NOTE for a more detailed walkthrough on creating a WebService with Visual Studio, please review http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=%2fquickstart%2fasppl us%2fdoc%2fwebservicetypes.aspx as an example to get a basic WSLD file; simply create WebMethods that have a signature identical to the parameters required by the Domino Webservice you will be presenting.

You will need to edit the WSDL to indicate the end point location of the Domino web service and add the Open Agent syntax or you can use a Domino Designer Computed Value. See the bolded text below :
<?xml version="1.0" encoding="utf-8"?>

<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Domino" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="Domino" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types /> <wsdl:message name="GetQuoteSoapIn"> <wsdl:part name="quoteIndex" type="s:int" /> </wsdl:message> <wsdl:message name="GetQuoteSoapOut"> <wsdl:part name="GetQuoteResult" type="s:string" /> </wsdl:message> <wsdl:message name="getpersonSoapIn"> <wsdl:part name="Lname" type="s:string" /> … <wsdl:service name="DomService"> <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">A collections of services hosted on Domino DominoQuote, DirectorySearch, CalendarSearch</documentation> <wsdl:port name="DomServiceSoap" binding="tns:DomServiceSoap"> <soap:address

location="http://localhost/DominoQuote/Service1.asmx" />
</wsdl:port> </wsdl:service> </wsdl:definitions>

The “location” attribute is set to the localhost IIS server by default. Since the domino web service will be hosted on a Domino server, we need to change this value. We could hard code the location of the Domino web service.

The syntax for the URL of the actual web service should be similar to: http://MyWebServer/MyNotesDatabase.nsf/WebAgentName?OpenAgent This URL call executes a Domino web Agent called “WebAgentName” contained in the Notes database “MyNotesDatabase.nsf” on the Domino server “MyWebServer”.
However, if we move it (or replicate it) to another server, the WSDL file will point to the old location. To fix this we insert a “Computed Text” to replace the URL of the web service location in the “Page” using Domino Designer.

The „Computed Value‟ can be defined using Lotus Designer with the format shown in the diagram below. This way the WSDL page will automatically contain the Server and database name of the Domino host. It is handy if you are going to replicate the web service to other servers.

Figure 2 – Calculating the WSDL location parameter with Lotus Designer

The WSDL Page will now look up the correct server and database name when providing the WSDL description. ). Once the Page is saved, we have our WSDL file source. (http://MyServerName/MyNotesDatabaseName.nsf/PageName)

Domino Web Service

Now let‟s turn our attention to the code that runs when the web service client reads the WSDL file and then calls the URL of the web service. The syntax for the URL of the actual web service should be similar to: http://MyWebServer/MyNotesDatabase.nsf/WebAgentName?OpenAgent This URL call executes a Domino web Agent called “WebAgentName” contained in the Notes database “MyNotesDatabase.nsf” on the Domino server “MyWebServer”. The Server will now provide Web Service functionality to any Web Service aware consumer by specifying the URL above. The Client The client application that uses this web service can be a Smart Phone, Word Document, SharePoint web part, Windows form or any application that can communicate with a standard web service. Usually the client development tool reads the WSDL file typically through a URL when establishing a reference to the web service. The WSDL file provides this reference information that is used for auto code generation, intellisense (Visual Studio) and error checking. The client development environment creates proxies representing the web service functions during compilation, and then when a proxy is called, a SOAP request is constructed and the end point URL call is made with the SOAP request sent along usually as an Http Post. Below is an example SOAP request:
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <getperson xmlns="Domino"> <Lname>Dean</Lname> </getperson> </soap:Body> </soap:Envelope>

Back on the Domino Server
Once the client submits a SOAP request to the server, the Web Agent on the Domino server is triggered by the URL call. Post information is automatically placed in an item called “Request content” on a special Notes document called the “Document Context”. This document is created whenever an Agent is run to provide a scratch work space. The following code reads the “SOAP request” from the Document‟s Context item:
Sub Initialize

Dim s As New notessession Dim doc As NotesDocument Set doc = s.DocumentContext SOAPin= doc.GetItemValue("Request_content")(0)

The variable SOAPin now contains the SOAP request as a string. There are many ways to parse the SOAP request and while native XML classes can be found on the Domino 6 platform , they are so out of date that they are not “Name Space” aware. However, the simplest and most portable solution is to manually parse the string similar to below:
bodyPos= Instr(1,SOAPin,|<SOAP-ENV:Body>|)+15 methodPos= Instr(bodyPos,SOAPin,|:|)+1 methodEnd=Instr(methodPos,SOAPin,| |) MethodName = Mid(SOAPin,methodPos,(methodEnd-methodPos)) nameSpacePos= Instr(methodEnd,SOAPin,|uri:|)+4 nameSpaceEnd=Instr(nameSpacePos,SOAPin,|"|) NameSpace=Mid(SOAPin,nameSpacePos,(nameSpaceEnd-nameSpacePos)) argPos=Instr(nameSpaceEnd,SOAPin,|>|)+1 argPos2=Instr(argPos, SoapIn, |>|)+1 argEnd=Instr(argPos2,SOAPin,|</|) argValue =Mid(SOAPin,argPos2,(argEnd-ArgPos2)) '******** test prints 'Print "Method Name: " & MethodName 'Print "Name Space: " &NameSpace 'Print "Argument value: " & argValue

Once the Method name, Name Space and Parameter (argValue) are extracted, a LotusScript function is called. Again there are many ways to do this. One technique is:
1. 2. 3.

Map the name space value to a LotusScript library Map the Method name to a LotusScript function in the library Dynamically load the LotusScript library and call the function with the parameters…

This way the Web Service interface is separated from the LotusScript function. Here is LotusScript code that does this:
LSlib = NameSpace Parameter = argValue MyFunction = MethodName Library= |"| & LSlib & |"| Arg= |("| & Parameter & |")| ' load the right LotusScript Library and call the function CallString = |Use | & Library & | response = | & MyFunction & Arg Execute CallString

This code dynamically builds a string of LotusScript code and puts it in a variable, “CallString”, then runs the code with the “Execute” command. This way, the same agent can be used to add a web service interface to many LotusScript libraries and functions. The SOAP message determines which functions are run. The only issue with this code is the function must only have one parameter and return one result, however, this can be changed. Once the LotusScript function has run, the result is put in a global variable called “response”. We now have the result of the Web Service call and need to pass it back to the client. Remember, Domino, by default, sends information over Http as HTML. To prevent this requires one line of code:
Print "Content-Type: text/xml"

This must be the first “Print” command used in the Agent. Subsequent Print commands will not have their content converted to HTML. Then we construct a SOAP response string and “Print” it back to the client.
strTmp = |<?xml version="1.0" encoding="UTF-8" standalone="no"?>| &_ |<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">| & _ |<SOAP-ENV:Body>| & _ |<m:| & MethodName & "Response" & | xmlns:m="| & NameSpace & |" SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">| & _ |<Answer xsi:type="xsd:string">| & response & |</Answer>| & _ |</m:| & MethodName & |Response>| & _ |</SOAP-ENV:Body>| & _ |</SOAP-ENV:Envelope>| Print strTmp End Sub

Finally, the output to the above creates a useable SOAP Response and is returned to the client:
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getpersonResponse xmlns="Domino"> <getpersonResult>James_Dean@ContosoLTD.com</getpersonResult> </getpersonResponse> </soap:Body> </soap:Envelope>

That is all that is required and this web service looks and acts like any other .net web service.

Limitations
This Web Service is restricted by the size limitation of a “Notes Item” and therefore, a SOAP message must be less than 32K characters. The average SOAP message is less than 1K characters. Security is provided by the Domino server. Web Services that expose Notes/Domino functionality will typically run behind a corporate firewall, but additional configuration may be needed. Response times and Scalability is dependant on infrastructure and the Domino Sever.

Advantages
A Domino Web Service database containing the Web Agent and LotusScript functions can stand alone while accessing other databases and functions on the local server or remote servers. The legacy applications require no changes to participate with the web service. The functions executed by the web service can be written in LotusScript, Java, @formulas or “Simple Actions”. Most will be written with LotusScript and typical Lotus customers have LotusScript skills. Web Services are independent of platform and therefore, providing a cross-platform method of integrating Microsoft.NET with all supported Notes / Domino platforms. This is a low cost/no cost method to expose legacy Notes/Domino applications to the .Net tools and Products. It‟s important to note that any functionality is exposed not just data. Demo A Domino web service demo is hosted at www.msDomino.net. A Window form client with source is also posted there. The URL to the sample WSDL file is http://www.msdomino.net/Web+Service+Agent.nsf/DominoDotNetWSDL Domino Server side code and data files are posted at: http://www.msdomino.net/firstpage.nsf/LotusScriptWebServiceDemo

Remarks This method is especially useful in a heterogeneous server environment when Window servers are not part of the mix.

A release 7 Domino server could act as a “Web Service Gateway” for the rest of the Domino servers. Creating web services with release 7 is much simpler. Use it when possible. IIS with an ASP.Net web service using the Domino Objects COM interface would be very easy to create. The most elegant method would be to use both an ADO.Net control for Notes and ASP.Net web services.

Notes Domino as a Web Service Client

Notes/Domino lacks native means to call a web service. So if you want to call a .Net web service, or any web service, from Notes/Domino, you need to use third party tools. Using Java At one time Lotus shipped a utility call SOAP Connect. It was a Notes database containing a Java agent that used an add-on jar file to call web services and could be called from LotusScript programs. Even though this utility is no longer supported, it still is a valid method for calling a web service. Notes/Domino has Java built-into its‟ development environment (Domino Designer). You can write “Agents” in Java. Also, LotusScript in R6 and later can call Java classes. So if you install Java classes, such as AXIS, that can call web services, your Notes/Domino applications can call web services. Java version conflicts have been a major problem in the past requiring unsupported configurations. Using Microsoft SOAP toolkit The Microsoft SOAP toolkit is a dll with a COM interface. LotusScript can call COM objects very simply using late binding once the toolkit is installed. A Notes database containing an example of using the MS SOAP toolkit is posted at: http://www.msdomino.net/firstpage.nsf/MSSOAP Using a custom .Net control with a COM wrapper Visual Studio.Net is great at working with web services. It is an easy task to create a class library with a COM wrapper in VS.Net. LotusScript can call the .Net class library via COM. This way you create the client side of the web service and have no dependencies on third party tool. An example and lab on how to create a .Net class library that calls a web service and has a COM wrapper that is called from LotusScript is posted at: http://www.msdomino.net/firstpage.nsf/DominoObjects

************************* Notes/Domino XML & http interfaces A Domino server is a web server. Turning on the HTTP server task enables access to it‟s functionality via HTTP/URL calls. Generally this is use for Browser access to Notes database elements such as Views, Documents, Pages, and more as HTML. Many “URL Commands” are available. • URL commands – Run agents (OpenAgent) – Get xml version of a View (ReadViewEntries) – Create, Open, Edit, Delete, and Save Documents – Navigate database – Set user web preferences – Open attachments – Opening resources (files, images) – Search Site – Search Domain – Search View – View Domino Pages (OpenPage) – Open Documents – Open Forms – …….and more The following live URLs are examples of URL commands: http://www.msdomino.net/pubnamesgary.nsf/people?openview Displays an HTML version of the View “people” in the database “pubnamesgary.nsf” on the demo Domino server at www.msdomino.net.

http://www.msdomino.net/jump%20log.nsf/jumps/?SearchView&Query=70 Searches a View called “jumps” in a database called “jump log.nsf” for a document with the number “70”

http://www.msdomino.net/pubnamesgary.nsf/people?ReadViewEntries Returns the data in the View “People” as XML

http://www.msdomino.net/jump%20log.nsf/jumpxml?openagent

This URL command executes an “Agent” called “jumpxml” written in LotusScript (See Below)

This Agent loops through the documents in the View “Color Jumps”, pulls out data from the fields “number”, “Date”, “Altitude” and “FF_Time”. The data is formatted into an XML document and sent to the calling client. (See Below)

Keep in mind that an Agent could do almost any task (ie. Create a calendar entry; create a document; search databases, access other servers, send mail, update web pages and more). So these types of Agent are very useful in accessing Notes/Domino functionality. A demo that uses this web Agent in an Excel 2003 can be found at http://www.msdomino.net/firstpage.nsf/excel-xml. The demo spreadsheet pulls Domino XML data over HTTP and charts the result. (http://www.msdomino.net/jump log.nsf/jumpxml?openagent )

HTTP and Windows SharePoint Services (WSS)/ SharePoint Portal Server (SPS) Because many of the Domino services are available via HTTP, and WSS/SPS has the ability to integrate web pages, it is easy to add Domino functionality to WSS/SPS solutions. For example, “Web Capture” and “Page Capture” web parts can pull part of web pages into their portal sites. Below is a SPS site containing several web parts. Two of them are web capture web parts that point to Domino servers‟ mail databases

Web capture web part points to URL http://www.msdomino.net/mail/juser.nsf/iNotes/mail/?OpenDocument&ui=portal Or http://www.msdomino.net/mail/juser.nsf/($Inbox)?openview User name = Joe User, Password = wordpass Address = joe@msdomino.net When a capture web part is added to a page, it needs to be configured. A wizard lets you navigate to the site that contains the content you want on your portal site.

Once you have the content page displayed in the wizard, you can select just the parts of the page you would like to capture/link to. See the icons indicating elements that can be selected.

After the elements are selected, the wizard puts the desired content into the web capture web part.

No code required. Here we are using Notes Mail as an example however; any Domino web functionality can be accessed this way. [www.msdomino.net is a Domino server that you can try this with if you have WSS/SPS. http://www.msdomino.net/mail/juser.nsf/iNotes/mail/?OpenDocument&ui=portal Or http://www.msdomino.net/mail/juser.nsf/($Inbox)?openview User name = Joe User, Password = wordpass Address = joe@msdomino.net ]

XML – More than just data XML is primarily used to move data between systems and platforms. However, Notes/Domino is also capable of importing and exporting the entire database which includes design elements, such as, Forms, Views, code, colors, fonts, LotusScript code, actions and so on. (Lotus calls XML that fits their schema DXL) It is therefore possible to export a Notes Form design as XML and transform it into an InfoPath form which is XML based.

****************************** COM Notes/Domino is both a consumer of COM and is itself a COM class library (nlsxbe.dll). This provides another means to integrate Notes/Domino application with .Net. Notes/Domino exposes its functionality programmatically through an Object model call the “Domino Objects”. These classes are used internally by the built-in BASIC language

call LotusScript as well as Java, CORBA, and COM/OLE via wrapper interfaces. Because the same classes are used internally by LotusScript (BASIC) as are used by Visual Basic.Net accessing the Domino Objects over COM, the code is remarkably similar. Anyone who writes LotusScript can easily write VB.Net applications that use the Domino Objects. Calling Notes/Domino‟s COM interface from VS.Net Steps 1. 2. 3. 4. 5. Add a reference to Domino Objects Dim your Domino Objects Initialize your connection Call Methods and Properties Close the connection

1. To add a reference to the Domino Object in VS.Net, from the menu, select “Project” then “Add Reference”

In the “Add Reference” dialog box, click on the “COM” tab and scroll down and select “Lotus Domino Object”. (Notes or Domino must be installed on the same machine as Visual Studio to the Lotus Domino Objects to show up in the listing.)

After making the selection and clicking “OK”, two new entries will appear in the Solution Explorer - References list.

The “Domino” reference refers to the COM interface to Notes/Domino while the “Lotus” reference is for the older OLE interface. COM vs. OLE. Domino Objects fall into two categories Front End and Back End or those requiring User Interface (UI elements) and those that do not. The COM interface only exposes the Back End classes or no UI elements. This means it can work without the Notes client UI running and on a Server which as no UI. The OLE interface can access Front End classes but will not work on a Domino server or without the Notes client running. Here we have a VS.Net project use the Domino Objects COM interface. The project can be down loaded from http://www.msdomino.net/firstpage.nsf/dominoobjectsCOM

Notice that we instantiate our Domino Objects by adding the reference name “Domino” before the Domino Objects‟ class name.

Now that the Domino object is created, intellesence, AKA code auto-complete, displays information on Methods Properties and parameters.

When accessing the Domino Objects COM interface, it is necessary to login, or authenticate. This is done two ways. One way is with the “Initialize” method of the “NotesSession” class. This will work on the Notes client and the Domino Server. The other way is using the “InitializeUsingNotesUserName” Method also off the “NotesSesson” class. The Initialize Method takes a password string parameter. The identity is the default person (current user or last person to login). In the case of a server execution, identity is that of the server. InitializeUsingNotesUserName method has an additional parameter called “User”. This allows you to change who you are running as by supplying User and password. Note: the user‟s certificate must be on the server for this to work.

Once logged-in, your identity is established. So, when you execute the “OpenMailDataBase” Method, which has no parameters, the correct database is opened.

Interaction with the Domino Objects now is the same as with LotusScript. Below is code that takes the name of a database from TextBox2, collects several properties of the database and reports them in TextBox1. dbdir = s.GetDbDirectory("") db = dbdir.OpenDatabase(TextBox2.Text) TextBox1.Text = ("Title: " & db.Title & vbCrLf _ & & & & & & "File name: " & db.FileName & vbCrLf _ "Path name: " & db.FilePath & vbCrLf _ "Replica ID: " & db.ReplicaID & vbCrLf _ "Size: " & db.Size & vbCrLf _ "Created: " & db.Created & vbCrLf _ "Last modified: " & db.LastModified)

When you are done using the Domino Objects, it is important to release the memory by using the .Net framework method:
System.Runtime.InteropServices.Marshal.ReleaseComObject(s)

Where “s” is the highest level Domino Object (NotesSession). Put this in your “Final” code block. Calling COM from Notes/Domino

VS.Net can create Managed Code DLLs with a COM interface From a Lotus Notes/Domino LotusScript program you can call these DLLs The Steps are: There is no “reference” to set because LotusScript does not support early binding Instantiate an object handle for the DLL Call the methods and properties Release the object handle

For more information about using COM with Lotus Notes/Domino, see the IBM Redbook “COM Together - with Domino” at: http://www.redbooks.ibm.com/redbooks.nsf/0/18cb3513e9d8b9a8852568470050018b?O penDocument

•

Lotus Domino and .NET Coexistence (06 April 2004) • http://publibb.boulder.ibm.com/Redbooks.nsf/RedpaperAbstracts/redp3868.html


								
To top