Publishing an XML Web Service

Because XML Web services aim to share functionality between organizations, there needs to be some mechanism that enables an interested party to discover which XML Web services another entity offers. The most ambitious part of this strategy is the UDDI registry, which is still in its infancy. Essentially, UDDI is a specification that defines how an XML Web service registry should be organized and how XML Web services can be registered programmatically. There are currently several test UDDI implementations, including the Microsoft Registry at http://uddi.microsoft.com/developer. You can find general information about the UDDI standard at http://www.uddi.org. A link in a UDDI registry can point to a WSDL document or to a discovery document listing XML Web services. This book does not cover UDDI in any detail.

Microsoft also supports a simpler discovery standard. In the current version of Visual Studio .NET, this is DISCO (which is slated for replacement by a similar standard called WS-Inspection, as mentioned earlier). A DISCO document is essentially an XML file with a list of links to one or more WSDL documents. A client using Visual Studio .NET can enter the URL for a discovery document when adding a Web reference and can easily find the required XML Web service. Essentially, a discovery document offers a simple approach to sharing XML Web service URLs in a standardized format.

A typical discovery document has the extension .disco or .vsdisco and contains one or more <contractRef> elements, each of which points to a WSDL document. It can also contain <discoveryRef> links that point to other discovery files or <schemaRef> links that point to XSD documents. Here's an example that can allow a client to locate the CustomerDB XML Web service:

 <?xml version="1.0" encoding="utf-8" ?> <disco:discovery  xmlns:disco="http://schemas.xmlsoap.org/disco"  xmlns:wsdl="http://schemas.xmlsoap.org/disco/wsdl">   <wsdl:contractRef     ref="http://MyServer/WebServices/CustomerDB.asmx?WSDL"/> </disco:discovery> 

Note that the example doesn't use the localhost reference because the client requires the real name of the server.

Microsoft also supports a dynamic discovery format. When a client requests this file, the Web server automatically creates a list of all the XML Web services in the given virtual directory and any subdirectories. You can specifically exclude search paths (typically to save time) by using the <exclude> attribute, although this doesn't stop the client from adding a reference to an XML Web service in one of these directories if it is not secured through IIS.

 <?xml version="1.0" encoding="utf-8" ?> <dynamicDiscovery   xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17">   <exclude path="_vti_cnf" />   <exclude path="_vti_pvt" />   <exclude path="_vti_log" />   <exclude path="_vti_script" />   <exclude path="_vti_txt" /> </dynamicDiscovery> 


Microsoft. NET Distributed Applications(c) Integrating XML Web Services and. NET Remoting
MicrosoftВ® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting (Pro-Developer)
ISBN: 0735619336
EAN: 2147483647
Year: 2005
Pages: 174

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