Search DominoPower's 10,675 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
What to look for in a Domino-based document management solution
Understanding Domino.doc end-of-life options
When the debugger won't debug hidden code that isn't hidden
What to do if the LotusScript debugger won't single-step over code
Top 10 ways to launch and build a Lotus consulting practice (with a little help from the Beatles)
Troubleshooting an OpenSuse Notes install
Incident report: denial of service attack against ConnectedPhotographer.com
Latest Lotus Headlines
SnTT - Enabling ALL the bells and whistles!
Tivoli Data protection causes Domino to crash
Fun when running DB2 CLP scripts
Introducing Flippr, the easy way to admin Quickr
DXL and fake security
Using search forms in IBM Workplace Collaborative Learning 2.7
Schmidt, Freed, and Gering on the OVF Toolkit
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Eight steps to successful and reliable home backups
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Can Outlook run when it's not running (and other mysteries)?
-- Advertisement --

AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.

Learn more about HELP Software products
-- Advertisement --

Want The Top Lotus Experts By Your Side Without Paying Hefty Consulting Fees? Look No Further.
Like having a team of consultants by your side -- ones who have all the answers and never make mistakes -- THE VIEW gives you immediate access to field-tested instruction, guidance, and best practices from the brightest Lotus professionals around.

Join your peers who realize their Lotus technology is too important to let people from blogs and forums tell them how they should implement it, run it, and use it. THE VIEW is where only the world's top Lotus experts provide validated support to you on a weekly basis to ensure you work more efficiently, get more out of your Lotus technology, and stay clear of costly mistakes.

Check out the new instruction, tips, and best practices added to THE VIEW this week.

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