17.1 DiscoveryDiscovery 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 returns. All of this information is contained in the WSDL (Web Services Description Language) document, introduced in Chapter 16. Discovery is an optional process. If the consuming developer knows the URL of the web service file (.asmx) itself, then there is no need to do discovery. However, it will often be the case that the consuming developer will not know the location of the web service file or the WSDL document. In these instances, ASP.NET provides a discovery command-line utility called disco.exe that provides the consuming developer with the information necessary to create the client. You have already seen in Chapter 16 how the disco utility allows the developer who created the web service to generate a .disco file. Now the consuming developer can use the same utility to aid in creation of the client. There are two equivalent ways of using the disco utility to generate the WSDL file. If you know the URL of the web service file, you can use that as input, as shown in the following command line: disco http://WebSrvcDomain.com/csStockTicker.asmx?WSDL If you don't know the URL of the .asmx file but do know the URL of the .disco file, you can use that file as input to disco, as in: disco http://WebSrvcDomain.com/csStockTicker.disco In either case, a WSDL file will be generated in the output directory. To force the output directory to be somewhere other than the current directory, use the /out: parameter, or /o: for short, as in: disco /out:<output directory name> http://WebSrvcDomain.com/csStockTicker.disco The disco utility executed in the previous command line will put three files, summarized in Table 17-1, in the output directory.
For a complete listing of all the parameters available to the disco utility, enter the following command line: disco /? In addition to outputting a .disco file and a WSDL file, the disco utility will also create a .discomap file, which can be used as input to the WSDL utility, described later in this chapter.
|