
68
|
Chapter 4: Web Services
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Once clients know the location of the discovery file, they can use the disco.exe
command-line utility to create local WSDL files for all of their web services, as
shown in the following code snippet:
disco http://localhost/aspnetian/Chapter_4/Qotd.disco
This line creates local WSDL files for both the Qotd and Qotd_cb web services.
UDDI
The other method used for publishing and locating web services is UDDI. Still
maturing, UDDI works by providing multiple replicated directories in which
public web services can be registered. The UDDI web site (http://www.uddi.com)
contains a list of the participating directory sites from which clients or providers
of web services can choose. Providers of web services give relevant information,
such as the type of web service, an appropriate category (such as Construction or
Financial and Insurance), and most importantly, the URL for the application’s
WSDL file. Potential clients can search the UDDI directory for web services that
match their needs and then locate and consume them via their WSDL contract.
Consuming a Web Service
In ASP.NET, consuming a web service is nearly as easy as creating one. ASP.NET
provides a utility called wsdl.exe that can create a proxy class, which is a class that
knows all of the necessary details