Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
How to create a Web service to extract data from XML documents (continued)

Exporting Lotus Notes data to an XML file using LotusScript
This article describes how to create and implement a Web service that extracts and manipulates data from an XML document. To demonstrate XML's ease of use and portability, the sample Web service accesses and processes data from an XML document created by a Lotus Notes database application using LotusScript. Although any programming language with the ability to create and manipulate text files could be used to illustrate creating a simple XML document, LotusScript was chosen for this example. ASP.NET is then used to create the sample Web service that processes the Lotus Notes data and publishes the results to the Web.

Exporting Lotus Notes data to an XML file using LotusScript
The LotusScript in Figure A needs to be copied to a procedure in a Lotus Notes database-form or agent in order to produce the required XML document.

FIGURE A


Copy this LotusScript to a procedure in a Lotus Notes database-form or agent. Roll over picture for a larger image.

The only change necessary to the code is the parameter "YourNotesServer" in the notesSession.GetDatabase method call. Change this parameter to the name of your Notes Server. Once you run this code, it will produce an XML document called names.xml located in c:\temp. You can change this path if necessary by modifying the code. The document will contain selected contact information from the Lotus Notes names.nsf database. In the code fragment above, you'll see that it steps through the records of the names.nsf database and adds the FirstName, LastName, Company, Department, and Email field values to the newly created names.xml document. This process uses simple LotusScript file I/O functionality to create the XML document as it builds an XML database table, as we see in Figure B.

FIGURE B


The names.xml document is shown in Internet Explorer. Roll over picture for a larger image.

Figure B displays the names.xml document in Internet Explorer. It's made up of a data level called an "Element" which we refer to as "People". This parent-element has five child-elements, called FirstName, LastName, Department, Company, and Email. These five elements have a sibling-to-sibling relationship. Here NotesData is the root element. XML documents can have only one root element, and branches must be closed before another opens, so, </FirstName> must close before <LastName> opens, etc. A well-structured XML document has been created through a simple file manipulation procedure using LotusScript. Now let's create the Web service.

Creating the ASP.NET Web Service
Enter Visual Studio.Net's IDE and go to the New Project Dialog Box by selecting New->Project from the File menu. Once in the dialog box, the Visual Basic Project folder and the ASP.NET Web Service icon should be highlighted, and the Location field should contain the path http://localhost/NotesData. By pressing the Okay button, a new Web service named NotesData will be created. This process will also create a virtual directory in the IIS and generate sample code. The generated code is shown in Figure C.


« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Internet Technologies > XML (11 articles)
   Building an XML based Content Management System using Lotus Domino: wrapping it up
   Building an XML based Content Management System using Lotus Domino: overview of the content administration system
   Building an XML based Content Management System using Lotus Domino: overview of the HTML display template
Home > Strategies > Web Services and SOA (3 articles)
   An SOA approach to implement standard source code control systems with a Lotus Notes development environment
   Lotus adds the human touch to Web services
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login