DiscoveryClientProtocol.Discover メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DiscoveryClientProtocol.Discover メソッドの意味・解説 

DiscoveryClientProtocol.Discover メソッド

指定された URL を探索し、探索ドキュメントかどうかを判断します。

名前空間: System.Web.Services.Discovery
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public Function Discover ( _
    url As String _
) As DiscoveryDocument
Dim instance As DiscoveryClientProtocol
Dim url As String
Dim returnValue As DiscoveryDocument

returnValue = instance.Discover(url)
public DiscoveryDocument Discover (
    string url
)
public:
DiscoveryDocument^ Discover (
    String^ url
)
public DiscoveryDocument Discover (
    String url
)
public function Discover (
    url : String
) : DiscoveryDocument

パラメータ

url

XML Web サービス探索を開始する URL。

戻り値
指定された URL にある、XML Web サービス探索の結果を格納している DiscoveryDocument。

例外例外
例外の種類条件

WebException

指定した URL へのアクセスにより、OK 以外の HTTP ステータス コードが返されました。

InvalidOperationException

url パラメータは有効な URL ですが、有効な探索ドキュメントを指していません。

解説解説
使用例使用例

Documents プロパティのドキュメントの詳細と共に、XML Web サービスの探索中に各ドキュメントで見つかった参照を DataGrid に読み込む Web フォームのコード例を次に示します。PopulateGrid メソッドは、Discover 呼び出しおよびそれに続く ResolveAll 呼び出しの結果を DataGrid に設定します。

Public Sub Discover_Click(Source As
 Object, e as EventArgs )
   ' Specify the URL to discover.
   Dim sourceUrl as String
 = DiscoURL.Text
   ' Specify the URL to save discovery results to or read from.
   Dim outputDirectory As String
 = DiscoDir.Text

   Dim client as DiscoveryClientProtocol =
 new DiscoveryClientProtocol()
   ' Use default credentials to access the URL being discovered.
   client.Credentials = CredentialCache.DefaultCredentials
   Try 
        Dim doc As DiscoveryDocument
     ' Only discover discovery documents, which might contain references
 to other types of discoverable documents. 
     doc = client.Discover(sourceUrl)

 ' Resolve all possible references from the supplied URL.
     client.ResolveAll()
           
    Catch e2 As Exception
          DiscoveryResultsGrid.Columns.Clear()
       Status.Text = e2.Message
    End Try

    ' If documents were discovered, display the results in a data grid.
    If (client.Documents.Count > 0) Then
         'populate our Grid with the discovery results
     PopulateGrid(client)
    End If

    ' Save the discovery results to disk.        
    Dim results As DiscoveryClientResultCollection
 
    results = client.WriteAll(outputDirectory, "results.discomap")
    Status.Text = "The following file holds the links to each
 of the discovery results: <b>" + _ 
                                  Path.Combine(outputDirectory,"results.discomap")
 + "</b>"
   End Sub
 protected void Discover_Click(object Source,
 EventArgs e)
 {
  // Specify the URL to discover.
  string sourceUrl = DiscoURL.Text;
  // Specify the URL to save discovery results to or read from.
  string outputDirectory = DiscoDir.Text;

      DiscoveryClientProtocol client = new DiscoveryClientProtocol();
  // Use default credentials to access the URL being discovered.
      client.Credentials = CredentialCache.DefaultCredentials;

      try 
      {
           DiscoveryDocument doc;
        
        // Only discover discovery documents, which might contain references
 to other types of discoverable documents.  
    doc = client.Discover(sourceUrl);
   
        // Resolve all possible references from the supplied URL.
        client.ResolveAll();
      }
      catch ( Exception e2) 
      {
        DiscoveryResultsGrid.Columns.Clear();
        Status.Text = e2.Message;
      }
  // If documents were discovered, display the results in a data grid.
      if (client.Documents.Count > 0)
      PopulateGrid(client);

  // Save the discovery results to disk.
      DiscoveryClientResultCollection results = client.WriteAll(outputDirectory,
 "results.discomap");
      Status.Text = "The following file holds the links to each of the discovery
 results: <b>" + 
                                  Path.Combine(outputDirectory,"results.discomap")
 + "</b>";
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DiscoveryClientProtocol クラス
DiscoveryClientProtocol メンバ
System.Web.Services.Discovery 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

DiscoveryClientProtocol.Discover メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DiscoveryClientProtocol.Discover メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS