Labels

Thursday, July 17, 2008

10 - Anatomy of a DISCO file

Hi,

The following code displays the contents of a discovery document (.disco file)

<?xml version="1.0" encoding="utf-8"?>


<
discovery xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.xmlsoap.org/disco/">
<discoveryRef ref="/Folder/Default.disco"/>
<contractRef
ref="http://Nancyd/mywebservice/Service1.asmx?wsdl" docRef="http://Nancyd/mywebservice/Service1.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://Nancyd/mywebservice/Service1.asmx" xmlns:q1="http://tempuri.org/" binding="q1:Service1Soap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<
/discovery>

· We can add multiple references of service descriptions within a <discovery> element.

· We can specify Service Description references by adding a <contractRef> element with the http://schemas.xmlsoap.org/disco/scl/XML namespace.

· We can specify Discovery Documents references by adding <discoveryRef>

· We can specify XSD schema references by addeing a <schemaRef> element with the http://schemas.xmlsoap.org/disco/schema.

For all referenced documents, you specify the location of the document by using the ref attribute.

Web Services Dynamic Discovery Mechanism:

· In addition to .disco files, Visual Studio .NET creates a .vsdisco file, which enables Dynamic Discovery of Web services.

· Dynamic discovery enables a client application to iteratively search through the folders on a Web server to locate all XML Web services available on the Web server and show their all the details as above.

· The .vsdisco file is an XML-based file with <dynamicDiscovery> as the root node instead of the <discovery> node in a .disco document. This node contains one or more <exclude> nodes. The <exclude> node contains a path attribute, which contains the relative path to a subfolder that the dynamic discovery process will exclude. The following code displays a sample .vsdisco file.

· Requests for .vsdisco files are handled by System.Web.Services.Discovery.DiscoveryRequestHandler, which dynamically generates a DISCO document based on the resources found in the target vroot.

· To generate the document, DiscoveryRequestHandler searches recursively through all subdirectories, looking for .asmx and .disco files.

o All .asmx files that are encountered are added to the DISCO document as a contractRef element.

o All .disco files found are added to the DISCO document as a discoveryRef element.

The resulting document looks just like the static documents that were shown earlier.

<?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" />
<exclude path="Web References" />
</dynamicDiscovery>

DISCO vs UDDI –

DISCO makes it possible to discover Web Services on a given server, but it's somewhat limited in scope and functionality because it doesn't attempt to sort Web Service-related information into categories to enable more sophisticated queries, as are possible with UDDI.

Thanks & Regards,

Arun Manglick || Senior Tech Lead

No comments:

Post a Comment