Freigeben über


DiscoveryDocumentReference.Document-Eigenschaft

Ruft den Inhalt des Discovery-Dokuments, auf das verwiesen wird, als DiscoveryDocument-Objekt ab.

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

Syntax

'Declaration
Public ReadOnly Property Document As DiscoveryDocument
'Usage
Dim instance As DiscoveryDocumentReference
Dim value As DiscoveryDocument

value = instance.Document
public DiscoveryDocument Document { get; }
public:
property DiscoveryDocument^ Document {
    DiscoveryDocument^ get ();
}
/** @property */
public DiscoveryDocument get_Document ()
public function get Document () : DiscoveryDocument

Eigenschaftenwert

Ein DiscoveryDocument, das den Inhalt des Discovery-Dokuments darstellt, auf das verwiesen wird.

Ausnahmen

Ausnahmetyp Bedingung

InvalidOperationException

Die ClientProtocol-Eigenschaft ist NULL (Nothing in Visual Basic).

- oder -

Ein Fehler ist beim Downloaden oder Auflösen des XSD-Schemas mit ClientProtocol aufgetreten.

Hinweise

Wenn das Discovery-Dokument nicht erfolgreich gedownloadet und der Documents-Eigenschaft von ClientProtocol hinzugefügt wurde, wird ein Versuch unternommen, das Dokument zu downloaden und aufzulösen.

Beispiel

Dim myUrl As String = "https://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
string myUrl = "https://localhost/Sample_cs.vsdisco";
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();
// Get the discovery document myDiscoveryDocument.
DiscoveryDocument myDiscoveryDocument = myProtocol.Discover(myUrl);
// Get the references of myDiscoveryDocument.
IEnumerator myEnumerator = myDiscoveryDocument.References.GetEnumerator();
while(myEnumerator.MoveNext())
{
   DiscoveryDocumentReference myNewReference = 
                  (DiscoveryDocumentReference)myEnumerator.Current;
   // Set the ClientProtocol of myNewReference.
   DiscoveryClientProtocol myNewProtocol = myNewReference.ClientProtocol;
   // Verify for all the valid references.
   myNewReference.ResolveAll();

   // Get the document of myNewReference.
   DiscoveryDocument myNewDiscoveryDocument = 
                                        myNewReference.Document;

   IEnumerator myNewEnumerator = 
                  myNewDiscoveryDocument.References.GetEnumerator();
   Console.WriteLine("The valid discovery document is : \n");
   while(myNewEnumerator.MoveNext())
   {
      // Display the references of myNewDiscoveryDocument on the console.
      Console.WriteLine(((DiscoveryDocumentReference)myNewEnumerator.Current).Ref);
   }
}

Plattformen

Windows 98, Windows 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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DiscoveryDocumentReference-Klasse
DiscoveryDocumentReference-Member
System.Web.Services.Discovery-Namespace