Obtaining Metadata

The metadata contained in WSDL documents is crucial information for any application that wants to use a distributed service. One problem: how do you find this information in the first place? The process of looking up a service on the Internet and obtaining its WSDL descriptor is a top-down search similar to how Domain Name Service (DNS) 6 works. Figure 8-1 illustrates the Web Service lookup procedure.

Figure 8-1 An illustration of the steps necessary to locate a Web Service.

If the location of the desired service is unknown ahead of time, you must begin your search with a registry of service providers such as UDDI. These registries are maintained by different organizations. You can query the service registry to get links to service discovery documents hosted by any listed providers of the service you requested.

The UDDI Web site (http://www.uddi.org) is home to many useful specifications, white papers, and best practices surrounding Web Services. The UDDI project is a cooperative effort among industry leaders. Check out this site to download the latest information on WSDL and UDDI. WSDL was submitted to W3C for consideration for further development. See http://www.w3.org/TR/wsdl.

You can download a list of specific services that a specific provider offers by following the link to the provider's discovery document. Discovery documents usually have a .disco or .vsdisco extension. The discovery document contains a detailed list of the Web Services hosted by the provider, including links to service-specific discovery documents. Listing 8-7, a service discovery document, contains a link to the service's WSDL contract.

Listing 8-7 HelloWorld.vsdico: the Hello World discovery document that points the way to the HelloWorld WSDL contract.

 <?xml version="1.0" encoding="utf-8"?> <discovery xmlns="http://schemas.xmlsoap.org/disco/"> <contractRef ref="http://localhost/HelloWorld/HelloWorld.asmx?wsdl" 
docRef="http://localhost/HelloWorld/HelloWorld.asmx" xmlns=
"http://schemas.xmlsoap.org/disco/scl/" /> </discovery>

Now that you have the service definition document in hand, you're ready to begin using the HelloWorld Web Service. Let the bliss begin.



XML Programming
XML Programming Bible
ISBN: 0764538292
EAN: 2147483647
Year: 2002
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net