Email:   
Home
In This Issue
Email a Friend
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.
How to create a Web service to extract data from XML documents (continued)

FIGURE C

This sample code will be generated. Click 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. Click 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. Click 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.

Product availability and resources
For more information on Web services, visit http://www-106.ibm.com/developerworks/webservices/.

Easy, flexible article reprints
ZATZ now offers a quick, easy, flexible and inexpensive way to use article reprints in your marketing and promotion efforts. You can now get article reprints for a one-time fee of only $200. For details, visit http://mediakit.zatz.com/reprints.

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++.




[ Prev ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- 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 --

DEPARTMENT CALENDAR - MANAGE AND SHARE A COMMON CALENDAR WITH YOUR TEAMS
Are you responsible for improving your organization's Group Calendaring tool? Have you been tasked to find a true group calendar tool with Itinerary, Time-Off, Sign In/Out and Bulletins/Events module that seamlessly integrates with Domino calendaring?

If so, Logic Springs Technologies will make answering these questions a whole lot easier!

Learn how by visiting us at www.departmentcalendar.com

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login