|
|
|
|
|
|
|
|
|
|
|
|
|
|
How to create a Web service to extract data from XML documents (continued)
FIGURE C
 
This sample code will be generated. Roll over picture for a larger image.
This new Web service is ready to run just by removing the comments from the WebMethod and HelloWorld Function. In order to process the Lotus Notes data found in the names.xml document, a small modification to the Web service code is required, as seen in Figure D.
FIGURE D
 
A small modification to the Web service code is required. Roll over picture for a larger image.
Figure D contains the necessary code to process and manipulate the names.xml file. The GetNotesData function takes in a single parameter (strCompanyName) that is used for filtering purposes. Inside this function the names.xml data is imported into a dataset and filtered into another dataset that is then published to the Web in XML format. Once the code from Figure D is copied to the new Web service and the names.xml file is added to the Web service's directory (c:\inetpub\wwwroot\NotesData), the Web service is ready for testing.
When run, a browser opens to the address of the Web service at http://localhost/notesdata/notesdata.asmx. In the browser you will see the Web service function GetNotesData displayed as a hyper link with a short description of the service. If you click on the GetNotesData link you will be taken to another page. This new page will allow you to enter a parameter for the GetNotesData method and invoke this Web service. If you enter a company name from the names.xml document in the Value text box and click the invoke button, XML data (based on your query) will be displayed in the browser. Figure E shows an example of the published XML data, based on entering "Testing Company" as a parameter.
FIGURE E
 
Here is an example of the published XML data. Roll over picture for a larger image.
The strength of XML is its portability. Creating well-structured XML documents is a fairly simple process in most programming languages by using inherent file manipulation functionality. These documents can then be processed by a Web service much like the sample, and the results can be published to the Web. XML documents can be created from just about any file format in this case and can be easily accessible over the Web using a process like this. Consuming the sample Web service well be described in a future article.
Steve Callan is a Web Applications Architect with an MS in CIS. He's worked with Microsoft languages for over ten years building internationally marketed software for both the Web and Windows. Languages he uses include VB, C#, ASP.NET, XML, HTML and C++.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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 --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|