DiscoveryClientProtocol::Discover Method (String^)

 

Discovers the supplied URL to determine if it is a discovery document.

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

public:
[PermissionSetAttribute(SecurityAction::LinkDemand, Name = "FullTrust")]
DiscoveryDocument^ Discover(
	String^ url
)

Parameters

url
Type: System::String^

The URL where XML Web services discovery begins.

Return Value

Type: System.Web.Services.Discovery::DiscoveryDocument^

A DiscoveryDocument containing the results of XML Web services discovery at the supplied URL.

Exception Condition
WebException

Accessing the supplied URL returned an HTTP status code other than OK.

InvalidOperationException

The url parameteris a valid URL, but does not point to a valid discovery document.

The Discover method expects that the supplied URL is a discovery document. If the URL refers to a service description or an XML schema an exception is thrown. To discover an XML schema or a service description invoke the DiscoverAny method.

If the supplied URL points to a valid discovery document, the discovery document at the supplied URL is added to the Documents and References collection. Additionally, references within the discovery document are added to the References collection, but not verified to point to valid discovery documents. To verify the references, point to valid discovery documents to invoke the ResolveAll or ResolveOneLevel methods.

The following code example is a Web Form that populates a DataGrid with the details about the documents in the Documents property together with the references found in each document during XML Web services discovery. The PopulateGrid method fills the DataGrid with the results from a Discover invocation followed by a call to ResolveAll.

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

.NET Framework
Available since 1.1
Return to top
Show: