As mentioned in the previous chapter, discovery is the process of finding out what web services are available, what methods and properties are exposed by a specific web service, what parameters those methods and properties expect to receive, and what data type the web method or property returns. All of this information is contained in the WSDL (Web Services Description Language) document, introduced in the previous chapter and described in more detail below.
As noted in the previous chapter, discovery is an optional process. If the consuming developer knows the URL of the web service file ( .asmx ) itself, there will be no need for discovery.
However, the consuming developer often will not know the location of the web service file or the WSDL document on a given server. In these instances, ASP.NET provides a discovery command-line utility called disco.exe that takes the URL of the web service as an argument, and creates discovery documents on the client machine from which the client-application developer can create the consuming application.
To do this, execute the disco utility from a command line, giving it the URL of the web service as an argument. For example:
disco http://WebSrvcDomain.com/StockTicker
This command will search the specified URL for any discovery documents and save them to the current directory of the local machine. A .wsdl file will be generated and saved there as well.
To force the output directory to be somewhere other than the current directory, use the /out: parameter, or /o: for short:
disco /out:<output directory name> http://WebSrvcDomain.com/StockTicker
The disco utility executed in the previous command line will put two files in the output directory:
This is the same WSDL for the web service generated by entering the .asmx file in a browser with ?wsdl appended to the URL or created using the WSDL command line utility described below.
Alternative discovery document. This can be used as input to the WSDL utility, described later in this chapter.
For a complete listing of all the parameters available to the disco utility, enter the following command line:
disco /?
UDDIUniversal Description, Discovery, and Integration (UDDI) is a registry that allows businesses to locate web services exposed on the Internet. For complete information about UDDI, visit http://www.UDDI.org. UDDI is a joint project of IBM, Microsoft, and Ariba, and will be turned over to a standards organization, such as the W3C (http://www.w3c.org). UDDI will have two main components :
The UDDI specification is still under development. However, it is reasonable to expect that in time, UDDI will become a universal "phone book" for finding and consuming web services. |