DiscoveryClientProtocol.ResolveOneLevel メソッド
アセンブリ: System.Web.Services (system.web.services.dll 内)


ResolveOneLevel は見つけたすべての有効な参照を解決して Documents プロパティに格納します。ResolveAll と ResolveOneLevel はどちらも References プロパティの XSD スキーマとサービスの説明をダウンロードして検証します。ただし、これら 2 つのメソッドでは探索ドキュメントの処理方法が異なります。ResolveOneLevel は References プロパティ内にある探索ドキュメントのすべての参照を解決します。探索ドキュメントが他の探索ドキュメントへの参照を含んでいる場合は、ResolveOneLevel は当該探索ドキュメントだけを解決します。これらの探索ドキュメント内で見つかった探索ドキュメントのうち、1 レベル入れ子になっているドキュメントは ResolveOneLevel では解決されないのに対し、ResolveAll はすべてを解決します。ResolveAll は参照がなくなるまで入れ子になっている探索ドキュメントの参照の解決を継続します。
ResolveOneLevel によって実行される検査プロセスの間に発生したエラーは、そのときに例外をスローするのではなく、収集されて Errors プロパティに追加されます。

Documents プロパティのドキュメントの詳細と共に、XML Web サービスの探索中に各ドキュメントで見つかった参照を DataGrid に読み込む Web フォームのコード例を次に示します。PopulateGrid メソッドは、DiscoverAny 呼び出しおよびそれに続く ResolveOneLevel 呼び出しの結果を 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 ' Discover the URL for any discoverable documents. doc = client.DiscoverAny(sourceUrl) ' Resolve references just one level deep. client.ResolveOneLevel() 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; // Discover the URL for any discoverable documents/ doc = client.DiscoverAny(sourceUrl); // Resolve references just one level deep/ client.ResolveOneLevel(); } 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>"; }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDiscoveryClientProtocol.ResolveOneLevel メソッドを検索する場合は、下記のリンクをクリックしてください。

- DiscoveryClientProtocol.ResolveOneLevel メソッドのページへのリンク