DiscoveryDocumentReference.Document Property
.NET Framework (current version)
Gets the contents of the referenced discovery document as a DiscoveryDocument object.
Assembly: System.Web.Services (in System.Web.Services.dll)
Property Value
Type: System.Web.Services.Discovery.DiscoveryDocumentA DiscoveryDocument representing the contents of the referenced discovery document.
| Exception | Condition |
|---|---|
| InvalidOperationException | ClientProtocol property is null. -or- An error occurred during the download or resolution of the XSD schema using ClientProtocol. |
If the discovery document has not been downloaded and added to the Documents property of ClientProtocol, an attempt to download and resolve the document is made.
Dim myUrl As String = "http://localhost/Sample_vb.vsdisco" Dim myProtocol As New DiscoveryClientProtocol() ' Get the discovery document myDiscoveryDocument. Dim myDiscoveryDocument As DiscoveryDocument = myProtocol.Discover(myUrl) ' Get the references of myDiscoveryDocument. Dim myEnumerator As IEnumerator = myDiscoveryDocument.References.GetEnumerator() While myEnumerator.MoveNext() Dim myNewReference As DiscoveryDocumentReference = _ CType(myEnumerator.Current, DiscoveryDocumentReference) ' Set the ClientProtocol of myNewReference. Dim myNewProtocol As DiscoveryClientProtocol = myNewReference.ClientProtocol ' Verify for all the valid references. myNewReference.ResolveAll() ' Get the document of myNewReference. Dim myNewDiscoveryDocument As DiscoveryDocument = myNewReference.Document Dim myNewEnumerator As IEnumerator = _ myNewDiscoveryDocument.References.GetEnumerator() Console.WriteLine("The valid discovery document is : " + ControlChars.NewLine) While myNewEnumerator.MoveNext() ' Display the references of myNewDiscoveryDocument on the console. Console.WriteLine(CType(myNewEnumerator.Current, DiscoveryDocumentReference).Ref) End While End While
.NET Framework
Available since 1.1
Available since 1.1
Show: