
Creating a Web Service | 67
Web Services
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
You’ve written a web service and you tested it by opening the .asmx file in a
browser and invoking the methods. What’s next? Unless your web service will be
consumed only by yourself or by someone with whom you have regular communi-
cation, you need to publish or advertise your web service in some way. Potential
clients also need to locate your web service to use it.
Publishing a web service can be accomplished in either of two ways: through a
discovery document or by registering the web service with a UDDI directory.
Discovery Documents
A discovery document is a file with the extension .disco that contains references to
the WDSL contracts for web services you want to publish, references to docu-
mentation for your web services, and/or references to other discovery documents.
Publishing and Locating Web Services
You can publish a discovery document on your web server and provide clients
with a link to or a URL for the discovery document. Clients can then use the
disco.exe .NET command-line utility to generate WSDL contracts locally for
creating proxy classes to communicate with the web service. Example 4-4 shows
the format of a discovery document for the
Qotd web service.
Figure 4-6. Browsing Qotd_cb.asmx
Example 4-4. Qotd.disco
<?xml version="1.0"?> ...