Microsoft KB Archive/833382

= How to use static discovery and dynamic discovery in XML Web services with the .NET Framework =

Article ID: 833382

Article Last Modified on 4/29/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.0
 * Microsoft ASP.NET 1.0

-





IN THIS TASK

 * SUMMARY
 * Use XML Web services static discovery
 * Discuss XML Web services dynamic discovery
 * Enable XML Web services dynamic discovery
 * Understand the implications for XML Web services when you enable dynamic discovery
 * REFERENCES



SUMMARY
This step-by-step article describes how to use XML Web services static discovery and XML Web services dynamic discovery. You can use XML Web services discovery to locate and to interrogate XML Web services descriptions. XML Web services discovery is the first step that you do when you access an XML Web service. XML Web services discovery is a Microsoft-specific technology that you can use to locate the XML Web services in a particular directory on a particular server. There are three types of XML Web services discovery files. These XML Web services discovery files use the following extensions:
 * .disco
 * .vsdisco
 * .map

back to the top

Use XML Web services static discovery
Create the XML Web services discovery file and then point the XML Web services discovery file to XML Web Services Description Language (WSDL). The XML Web services discovery file contains a root   element. The root   element contains one or more  elements and one or more  elements. The following URL contains the definition of the  element and of the  element:

http://schemas.xmlsoap.org/disco/scl/

In the following code sample, the  tag references is the actual XML Web service URL that returns the WSDL. The  element refers to another discovery document. The XML Web services static discovery file code is shown in the following code sample:      You can access the XML Web services static discovery file by using an .asmx file.

back to the top

Discuss XML Web services dynamic discovery
The XML Web services dynamic discovery file returns XML code that contains references to WSDL and references to the XML Web services discovery file when you access the URL. If a client computer requests an XML Web services dynamic discovery file (.vsdisco), the Microsoft .NET Framework analyzes the folder that contains the XML Web services dynamic discovery file. The .NET Framework then generates XML code that contains the references to all XML Web services in that folder and in its subfolders. To enhance security, you can use the XML Web services dynamic discovery file (.vsdisco) to specify that the .NET Framework must not search certain folders while the XML code is generated.

back to the top

Enable XML Web services dynamic discovery
To enable XML Web services dynamic discovery, follow these steps:  Click Start, and then click My Computer.</li> <li>In the following folder, open the Machine.config file:

% %\Framework\v1.0.3705\

Note In this step,  is the placeholder for the absolute path of your Microsoft Windows directory.

In the following folder, open the Machine.config file by using Notepad if you are using Microsoft .NET Framework 1.1:

\Framework\v1.1.4322\</li> <li>In the Machine.config file, locate the   element.</li> <li> Add the following XML code between the   element and the   element: <system.web> <httpHandlers> <add verb=&quot;*&quot; path=&quot;*.vsdisco&quot; type=&quot;System.Web.Services.Discovery.DiscoveryRequestHandler, System.Web.Services, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; validate=&quot;false&quot;/> </httpHandlers> </system.web> Note Make sure that the type attribute is on one line. </li> <li>On the File menu, click Save All to save the file, and then close the file.</li></ol>

back to the top

Understand the implications for XML Web services when you enable dynamic discovery
When you enable dynamic discovery, you must be aware of the following implications:
 * If you enable the XML Web services dynamic discovery option, you can access all the XML Web services that exist on the Web server for the URL that you requested. Therefore, you must be cautious when you enable dynamic discovery. You may unintentionally expose sensitive data.
 * The XML Web services dynamic discovery file generates more performance overhead than the XML Web services static discovery file. This issue occurs because you must always perform a search operation to access the XML Web services dynamic discovery file.

back to the top

<div class="references_section">