Wednesday, October 06, 2004

How to turn on dynamic discovery - XML Web Servcie

How to turn on dynamic discovery to allow XML Web service client applications to discover the available XML Web services on a Web server without creating a discovery document?

By publishing a .disco file, one can enable programmatic discovery of XML Web Services. A .disco file is an XML document that can contains links to other discovery documents, XSD schemas, and service descriptions.

By default, dynamic discovery is disabled when the .NET framework is installed on behalf of security.

To turn on dynamic discovery for a Web server, modify the machine.config to add the following element. (if you are using Visual Studio .NET)

#### Please note that the type attribute should be in one line.

<configuration>
<system.web>
<httphandlers>
<add verb="*" path="*.vsdisco"
type="System.Web.Services.Discovery.DiscoveryRequestHandler,
System.Web.Services, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false"/>
</httphandlers>
</system.web>
</configuration>

But please note that when dynamic discovery is turned on, all XML Web services and discovery documents existing on the Web server beneath the requested URL are discoverable. Hence I would suggest thinking twice before turning on dynamic discovery; unless you take the necessary precautionary steps.

There are two ways you can control the discoverability of an XML Web service.
1. Using the machine.config file that controls the overall discoverability of the server.
To enable discovery, you need to remove the comment characters in the following in machine.config.

2. The second one is a discovery file (You can create your custom disco file and publish it).

For more info check:
Enabling Discovery for an XML Web Service

1 comment:

Anonymous said...

Enabling discovery in machine.config will enable it to look up the iscovery file, but it does not generate the .vsdisco file when you create a projec.