Search DominoPower's 11,443 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
Syncing Notes with Android phones
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
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: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login