This documentation is archived and is not being maintained.

DiscoveryClientProtocol Class

Provides support for programmatically invoking XML Web services discovery.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in

public ref class DiscoveryClientProtocol : public HttpWebClientProtocol
public class DiscoveryClientProtocol extends HttpWebClientProtocol
public class DiscoveryClientProtocol extends HttpWebClientProtocol
Not applicable.

XML Web service discovery is the process of locating, or discovering, one or more related documents that describe available XML Web services. It is through XML Web services discovery that XML Web service clients learn about the available XML Web services at a given URL and how to use them. XML Web services discovery works from the premise that you have already obtained the URL to a discovery document, possibly through a directory service, such as, however, you do not have the details about the XML Web services offered. Through XML Web services discovery, you can discover the details about the XML Web services listed in a DiscoveryDocument at a specific URL.

An XML Web service client starts XML Web services discovery by supplying a URL to either the Discover or DiscoverAny methods. Typically, this URL refers to a discovery document, which in turn refers to documents that describe one or more XML Web services, which are added to the References property. At that point, only that document is downloaded and verified to point to valid information about XML Web services. However, the references contained in that document are not verified at this stage. Instead they are added to the References property. To verify that the references are valid, invoke the ResolveAll or ResolveOneLevel methods, which add valid referenced documents to the Documents property. Last, if a client wants to save the discovery results to disk, invoke the WriteAll method.

If programmatic access to XML Web services discovery is not needed, the .NET Framework SDK ships the Web Services Discovery tool (Disco.exe) for discovering XML Web services within a command prompt. For more details, see Web Services Discovery Tool (Disco.exe).

The following code example is a Web Form demonstrating how to use the DiscoveryClientProtocol class together with the other classes in the System.Web.Services.Discovery namespace to programmatically invoke XML Web services discovery. The code example demonstrates using the Discover, DiscoverAny, Discover, ResolveAll, ResolveOneLevel, ReadAll and WriteAll methods.

Security noteSecurity Note:

This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview (Visual Studio).

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0