DiscoveryExceptionDictionary クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)



Imports System Imports System.Web.Services.Discovery Imports System.Xml Imports System.Collections Imports System.Runtime.Remoting Imports System.Net Public Class MySample Shared Sub Main() Dim myDiscoFile As String = "http://localhost/MathService_vb.disco" Dim myUrlKey As String = "http://localhost/MathService_vb.asmx?wsdl" Dim myDiscoveryClientProtocol1 As New DiscoveryClientProtocol() Dim myDiscoveryDocument As DiscoveryDocument = myDiscoveryClientProtocol1.Discover(myDiscoFile) Dim myEnumerator As IEnumerator = myDiscoveryDocument.References.GetEnumerator() While myEnumerator.MoveNext() Dim myContractReference As ContractReference = CType(myEnumerator.Current, ContractReference) Dim myDiscoveryClientProtocol2 As DiscoveryClientProtocol = myContractReference.ClientProtocol myDiscoveryClientProtocol2.ResolveAll() Dim myExceptionDictionary As DiscoveryExceptionDictionary = myDiscoveryClientProtocol2.Errors If myExceptionDictionary.Contains(myUrlKey) = True Then Console.WriteLine("'myExceptionDictionary' contains " + _ "a discovery exception for the key '" + myUrlKey + "'") Else Console.WriteLine("'myExceptionDictionary' does not contain" + _ " a discovery exception for the key '" + myUrlKey + "'") End If If myExceptionDictionary.Contains(myUrlKey) = True Then Console.WriteLine("System generated exceptions.") Dim myException As Exception = myExceptionDictionary(myUrlKey) Console.WriteLine(" Source : " + myException.Source) Console.WriteLine(" Exception : " + myException.Message) Console.WriteLine() ' Remove the discovery exception.for the key 'myUrlKey'. myExceptionDictionary.Remove(myUrlKey) Dim myNewExceptionDictionary As New DiscoveryExceptionDictionary() ' Add an exception with the custom error message. Dim myNewException As New Exception("The requested service is not available.") myNewExceptionDictionary.Add(myUrlKey, myNewException) myExceptionDictionary = myNewExceptionDictionary Console.WriteLine("Added exceptions.") Dim myArray(myExceptionDictionary.Count -1 ) As Object myExceptionDictionary.Keys.CopyTo(CType(myArray, Array), 0) Console.WriteLine(" Keys are :") Dim myObj As Object For Each myObj In myArray Console.WriteLine(" " + myObj.ToString()) Next myObj Console.WriteLine() Dim myCollectionArray(myExceptionDictionary.Count -1 ) As Object myExceptionDictionary.Values.CopyTo(CType(myCollectionArray, Array), 0) Console.WriteLine(" Values are :") For Each myObj In myCollectionArray Console.WriteLine(" " + myObj.ToString()) Next myObj End If End While End Sub 'Main End Class 'MySample
using System; using System.Web.Services.Discovery; using System.Xml; using System.Collections; using System.Runtime.Remoting; using System.Net; public class MySample { static void Main() { string myDiscoFile = "http://localhost/MathService_cs.disco"; string myUrlKey = "http://localhost/MathService_cs.asmx?wsdl"; DiscoveryClientProtocol myDiscoveryClientProtocol1 = new DiscoveryClientProtocol(); DiscoveryDocument myDiscoveryDocument = myDiscoveryClientProtocol1.Discover(myDiscoFile); IEnumerator myEnumerator = myDiscoveryDocument.References.GetEnumerator(); while ( myEnumerator.MoveNext() ) { ContractReference myContractReference = (ContractReference)myEnumerator.Current; DiscoveryClientProtocol myDiscoveryClientProtocol2 = myContractReference.ClientProtocol; myDiscoveryClientProtocol2.ResolveAll(); DiscoveryExceptionDictionary myExceptionDictionary = myDiscoveryClientProtocol2.Errors; if ( myExceptionDictionary.Contains(myUrlKey) == true ) { Console.WriteLine("'myExceptionDictionary' contains " + " a discovery exception for the key '" + myUrlKey + "'"); } else { Console.WriteLine("'myExceptionDictionary' does not contain" + " a discovery exception for the key '" + myUrlKey + "'"); } if (myExceptionDictionary.Contains(myUrlKey) == true ) { Console.WriteLine("System generated exceptions."); Exception myException = myExceptionDictionary[myUrlKey]; Console.WriteLine(" Source : " + myException.Source); Console.WriteLine(" Exception : " + myException.Message); Console.WriteLine(); // Remove the discovery exception.for the key 'myUrlKey'. myExceptionDictionary.Remove(myUrlKey); DiscoveryExceptionDictionary myNewExceptionDictionary = new DiscoveryExceptionDictionary(); // Add an exception with the custom error message. Exception myNewException = new Exception("The requested service is not available."); myNewExceptionDictionary.Add(myUrlKey, myNewException); myExceptionDictionary = myNewExceptionDictionary; Console.WriteLine("Added exceptions."); object[] myArray = new object[myExceptionDictionary.Count]; myExceptionDictionary.Keys.CopyTo((Array)myArray,0); Console.WriteLine(" Keys are :"); foreach(object myObj in myArray) { Console.WriteLine(" " + myObj.ToString()); } Console.WriteLine(); object[] myCollectionArray = new object[myExceptionDictionary.Count]; myExceptionDictionary.Values.CopyTo((Array)myCollectionArray,0); Console.WriteLine(" Values are :"); foreach(object myObj in myCollectionArray) { Console.WriteLine(" " + myObj.ToString()); } } } } }
#using <System.Xml.dll> #using <System.Web.Services.dll> #using <System.dll> using namespace System; using namespace System::Web::Services::Discovery; using namespace System::Xml; using namespace System::Collections; using namespace System::Runtime::Remoting; using namespace System::Net; int main() { String^ myDiscoFile = "http://localhost/MathService_cs.disco"; String^ myUrlKey = "http://localhost/MathService_cs.asmx?wsdl"; DiscoveryClientProtocol^ myDiscoveryClientProtocol1 = gcnew DiscoveryClientProtocol; DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol1->Discover( myDiscoFile ); IEnumerator^ myEnumerator = myDiscoveryDocument->References->GetEnumerator(); while ( myEnumerator->MoveNext() ) { ContractReference^ myContractReference = dynamic_cast<ContractReference^>(myEnumerator->Current); DiscoveryClientProtocol^ myDiscoveryClientProtocol2 = myContractReference->ClientProtocol; myDiscoveryClientProtocol2->ResolveAll(); DiscoveryExceptionDictionary^ myExceptionDictionary = myDiscoveryClientProtocol2->Errors; if ( myExceptionDictionary->Contains( myUrlKey ) == true ) { Console::WriteLine( "'myExceptionDictionary' contains a discovery exception for the key '{0}'", myUrlKey ); } else { Console::WriteLine( "'myExceptionDictionary' does not contain a discovery exception for the key '{0}'", myUrlKey ); } if ( myExceptionDictionary->Contains( myUrlKey ) == true ) { Console::WriteLine( "System generated exceptions." ); Exception^ myException = myExceptionDictionary[ myUrlKey ]; Console::WriteLine( " Source : {0}", myException->Source ); Console::WriteLine( " Exception : {0}", myException->Message ); Console::WriteLine(); // Remove the discovery exception.for the key 'myUrlKey'. myExceptionDictionary->Remove( myUrlKey ); DiscoveryExceptionDictionary^ myNewExceptionDictionary = gcnew DiscoveryExceptionDictionary; // Add an exception with the custom error message. Exception^ myNewException = gcnew Exception( "The requested service is not available." ); myNewExceptionDictionary->Add( myUrlKey, myNewException ); myExceptionDictionary = myNewExceptionDictionary; Console::WriteLine( "Added exceptions." ); array<Object^>^myArray = gcnew array<Object^>(myExceptionDictionary->Count); myExceptionDictionary->Keys->CopyTo( (Array^)myArray, 0 ); Console::WriteLine( " Keys are :" ); for each(Object^ myObj in myArray) { Console::WriteLine(" " + myObj->ToString()); } Console::WriteLine(); array<Object^>^myCollectionArray = gcnew array<Object^>(myExceptionDictionary->Count); myExceptionDictionary->Values->CopyTo( (Array^)myCollectionArray, 0 ); Console::WriteLine( " Values are :" ); for each(Object^ myObj in myCollectionArray) { Console::WriteLine(" " + myObj->ToString()); } } } }
import System.*; import System.Web.Services.Discovery.*; import System.Xml.*; import System.Collections.*; import System.Runtime.Remoting.*; import System.Net.*; public class MySample { public static void main(String[] args) { String myDiscoFile = "http://localhost/MathService_jsl.disco"; String myUrlKey = "http://localhost/MathService_jsl.asmx?wsdl"; DiscoveryClientProtocol myDiscoveryClientProtocol1 = new DiscoveryClientProtocol(); DiscoveryDocument myDiscoveryDocument = myDiscoveryClientProtocol1. Discover(myDiscoFile); IEnumerator myEnumerator = myDiscoveryDocument. get_References().GetEnumerator(); while (myEnumerator.MoveNext()) { ContractReference myContractReference = (ContractReference) myEnumerator.get_Current(); DiscoveryClientProtocol myDiscoveryClientProtocol2 = myContractReference.get_ClientProtocol(); myDiscoveryClientProtocol2.ResolveAll(); DiscoveryExceptionDictionary myExceptionDictionary = myDiscoveryClientProtocol2.get_Errors(); if (myExceptionDictionary.Contains(myUrlKey) == true) { Console.WriteLine("'myExceptionDictionary' contains " + " a discovery exception for the key '" + myUrlKey + "'"); } else { Console.WriteLine("'myExceptionDictionary' does not contain" + " a discovery exception for the key '" + myUrlKey + "'"); } if (myExceptionDictionary.Contains(myUrlKey) == true) { Console.WriteLine("System generated exceptions."); System.Exception myException = myExceptionDictionary. get_Item(myUrlKey); Console.WriteLine(" Source : " + myException.get_Source()); Console.WriteLine(" Exception : " + myException.get_Message()); Console.WriteLine(); // Remove the discovery exception.for the key 'myUrlKey'. myExceptionDictionary.Remove(myUrlKey); DiscoveryExceptionDictionary myNewExceptionDictionary = new DiscoveryExceptionDictionary(); // Add an exception with the custom error message. Exception myNewException = new Exception("The requested service is not available."); myNewExceptionDictionary.Add(myUrlKey, myNewException); myExceptionDictionary = myNewExceptionDictionary; Console.WriteLine("Added exceptions."); Object myArray[] = new Object[myExceptionDictionary. get_Count()]; myExceptionDictionary.get_Keys().CopyTo((Array)myArray, 0); Console.WriteLine(" Keys are :"); Object myObj = null; for ( int iCtr=0; iCtr < myArray.length; iCtr++ ) { myObj = myArray[iCtr]; Console.WriteLine(" " + myObj.ToString()); } Console.WriteLine(); Object myCollectionArray[] = new Object[myExceptionDictionary. get_Count()]; myExceptionDictionary.get_Values(). CopyTo((Array)myCollectionArray, 0); Console.WriteLine(" Values are :"); for (int iCtr = 0; iCtr < myCollectionArray.length; iCtr++) { myObj = myCollectionArray[iCtr]; Console.WriteLine(" " + myObj.ToString()); } } } } //main } //MySample

System.Collections.DictionaryBase
System.Web.Services.Discovery.DiscoveryExceptionDictionary


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


DiscoveryExceptionDictionary コンストラクタ
アセンブリ: System.Web.Services (system.web.services.dll 内)


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


DiscoveryExceptionDictionary プロパティ

名前 | 説明 | |
---|---|---|
![]() | Count | DictionaryBase インスタンスに格納されている要素の数を取得します。 ( DictionaryBase から継承されます。) |
![]() | Item | DiscoveryExceptionDictionary から指定 URL を探索しているときに発生した Exception を取得または設定します。 |
![]() | Keys | DiscoveryExceptionDictionary 内のすべてのキーを保持している System.Collections.ICollection オブジェクトを取得します。 |
![]() | Values | DiscoveryExceptionDictionary 内のすべての値を格納している System.Collections.ICollection オブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Dictionary | DictionaryBase インスタンスに格納されている要素のリストを取得します。 ( DictionaryBase から継承されます。) |
![]() | InnerHashtable | DictionaryBase インスタンスに格納されている要素のリストを取得します。 ( DictionaryBase から継承されます。) |

DiscoveryExceptionDictionary メソッド

名前 | 説明 | |
---|---|---|
![]() | Add | url のキーを使用して、Exception を DiscoveryExceptionDictionary に追加します。 |
![]() | Clear | DictionaryBase インスタンスの内容を消去します。 ( DictionaryBase から継承されます。) |
![]() | Contains | 指定した URL の Exception が DiscoveryExceptionDictionary に格納されているかどうかを確認します。 |
![]() | CopyTo | 1 次元の Array の指定したインデックスに DictionaryBase の要素をコピーします。 ( DictionaryBase から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetEnumerator | DictionaryBase インスタンスを反復処理する IDictionaryEnumerator を返します。 ( DictionaryBase から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | Remove | 指定した URL を持つ Exception を DiscoveryExceptionDictionary から削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | OnClear | DictionaryBase インスタンスの内容を消去する前に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnClearComplete | DictionaryBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnGet | 指定したキーおよび値を持つ、DictionaryBase インスタンスの要素を取得します。 ( DictionaryBase から継承されます。) |
![]() | OnInsert | DictionaryBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnInsertComplete | DictionaryBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnRemove | DictionaryBase インスタンスから要素を削除する前に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnRemoveComplete | DictionaryBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnSet | DictionaryBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnSetComplete | DictionaryBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |
![]() | OnValidate | 指定したキーおよび値を持つ要素を検証するときに、追加のカスタム プロセスを実行します。 ( DictionaryBase から継承されます。) |

DiscoveryExceptionDictionary メンバ
XML Web サービス探索中に発生した例外を収集します。このクラスは継承できません。
DiscoveryExceptionDictionary データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | DiscoveryExceptionDictionary |

名前 | 説明 | |
---|---|---|
![]() | Count | DictionaryBase インスタンスに格納されている要素の数を取得します。(DictionaryBase から継承されます。) |
![]() | Item | DiscoveryExceptionDictionary から指定 URL を探索しているときに発生した Exception を取得または設定します。 |
![]() | Keys | DiscoveryExceptionDictionary 内のすべてのキーを保持している System.Collections.ICollection オブジェクトを取得します。 |
![]() | Values | DiscoveryExceptionDictionary 内のすべての値を格納している System.Collections.ICollection オブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Dictionary | DictionaryBase インスタンスに格納されている要素のリストを取得します。(DictionaryBase から継承されます。) |
![]() | InnerHashtable | DictionaryBase インスタンスに格納されている要素のリストを取得します。(DictionaryBase から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Add | url のキーを使用して、Exception を DiscoveryExceptionDictionary に追加します。 |
![]() | Clear | DictionaryBase インスタンスの内容を消去します。 (DictionaryBase から継承されます。) |
![]() | Contains | 指定した URL の Exception が DiscoveryExceptionDictionary に格納されているかどうかを確認します。 |
![]() | CopyTo | 1 次元の Array の指定したインデックスに DictionaryBase の要素をコピーします。 (DictionaryBase から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEnumerator | DictionaryBase インスタンスを反復処理する IDictionaryEnumerator を返します。 (DictionaryBase から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | Remove | 指定した URL を持つ Exception を DiscoveryExceptionDictionary から削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | OnClear | DictionaryBase インスタンスの内容を消去する前に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnClearComplete | DictionaryBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnGet | 指定したキーおよび値を持つ、DictionaryBase インスタンスの要素を取得します。 (DictionaryBase から継承されます。) |
![]() | OnInsert | DictionaryBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnInsertComplete | DictionaryBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnRemove | DictionaryBase インスタンスから要素を削除する前に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnRemoveComplete | DictionaryBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnSet | DictionaryBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnSetComplete | DictionaryBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |
![]() | OnValidate | 指定したキーおよび値を持つ要素を検証するときに、追加のカスタム プロセスを実行します。 (DictionaryBase から継承されます。) |

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

- DiscoveryExceptionDictionaryのページへのリンク