次の方法で共有


DiscoveryDocumentReference.Document プロパティ

参照される探索ドキュメントの内容を DiscoveryDocument オブジェクトとして取得します。

Public ReadOnly Property Document As DiscoveryDocument
[C#]
public DiscoveryDocument Document {get;}
[C++]
public: __property DiscoveryDocument* get_Document();
[JScript]
public function get Document() : DiscoveryDocument;

プロパティ値

参照される探索ドキュメントの内容を表す DiscoveryDocument

例外

例外の種類 条件
InvalidOperationException ClientProtocol プロパティが null 参照 (Visual Basic では Nothing) です。

または

ClientProtocol を使用した XSD スキーマのダウンロードまたは解決の実行中に、エラーが発生しました。

解説

探索ドキュメントをダウンロードして ClientProtocolDocuments プロパティに追加していない場合は、ドキュメントをダウンロードして解決しようとします。

使用例

 
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

[C#] 
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);
   }
}

[C++] 
String* myUrl = S"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 =
      dynamic_cast<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(S"The valid discovery document is : \n");
   while(myNewEnumerator->MoveNext()) {
      // Display the references of myNewDiscoveryDocument on the console.
      Console::WriteLine((dynamic_cast<DiscoveryDocumentReference*>(myNewEnumerator->Current))->Ref);
   }
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

DiscoveryDocumentReference クラス | DiscoveryDocumentReference メンバ | System.Web.Services.Discovery 名前空間