DiscoveryExceptionDictionary DiscoveryExceptionDictionary DiscoveryExceptionDictionary DiscoveryExceptionDictionary Class

Definition

Erfasst Ausnahmen, die während der XML-Webdienstsuche aufgetreten sind.Collects exceptions that occurred during XML Web services discovery. Diese Klasse kann nicht vererbt werden.This class cannot be inherited.

public ref class DiscoveryExceptionDictionary sealed : System::Collections::DictionaryBase
public sealed class DiscoveryExceptionDictionary : System.Collections.DictionaryBase
type DiscoveryExceptionDictionary = class
    inherit DictionaryBase
Public NotInheritable Class DiscoveryExceptionDictionary
Inherits DictionaryBase
Vererbung
DiscoveryExceptionDictionaryDiscoveryExceptionDictionaryDiscoveryExceptionDictionaryDiscoveryExceptionDictionary

Beispiele

#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());
         }
      }
   }
}
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());
            }
         }
      }
   }
}
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
End Class

Hinweise

Die Errors -Eigenschaft DiscoveryClientProtocol von ist vom DiscoveryExceptionDictionaryTyp.The Errors property of DiscoveryClientProtocol is of type DiscoveryExceptionDictionary.

Konstruktoren

DiscoveryExceptionDictionary() DiscoveryExceptionDictionary() DiscoveryExceptionDictionary() DiscoveryExceptionDictionary()

Initialisiert eine neue Instanz der DiscoveryExceptionDictionary-Klasse.Initializes a new instance of the DiscoveryExceptionDictionary class.

Eigenschaften

Count Count Count Count

Ruft die Anzahl der Elemente ab, die in der DictionaryBase-Instanz enthalten sind.Gets the number of elements contained in the DictionaryBase instance.

(Inherited from DictionaryBase)
Dictionary Dictionary Dictionary Dictionary

Ruft die Liste der in der DictionaryBase-Instanz enthaltenen Elemente ab.Gets the list of elements contained in the DictionaryBase instance.

(Inherited from DictionaryBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

Ruft einen Wert ab, der angibt, ob der Zugriff auf ein DictionaryBase-Objekt synchronisiert (threadsicher) ist.Gets a value indicating whether access to a DictionaryBase object is synchronized (thread safe).

(Inherited from DictionaryBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

Ruft ein Objekt ab, mit dem der Zugriff auf ein DictionaryBase-Objekt synchronisiert werden kann.Gets an object that can be used to synchronize access to a DictionaryBase object.

(Inherited from DictionaryBase)
IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize

Ruft einen Wert ab, der angibt, ob ein DictionaryBase-Objekt eine feste Größe hat.Gets a value indicating whether a DictionaryBase object has a fixed size.

(Inherited from DictionaryBase)
IDictionary.IsReadOnly IDictionary.IsReadOnly IDictionary.IsReadOnly IDictionary.IsReadOnly

Ruft einen Wert ab, der angibt, ob ein DictionaryBase-Objekt schreibgeschützt ist.Gets a value indicating whether a DictionaryBase object is read-only.

(Inherited from DictionaryBase)
IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object]

Ruft den Wert ab, der dem angegebenen Schlüssel zugeordnet ist, oder legt diesen fest.Gets or sets the value associated with the specified key.

(Inherited from DictionaryBase)
IDictionary.Keys IDictionary.Keys IDictionary.Keys IDictionary.Keys

Ruft ein ICollection-Objekt ab, das die Schlüssel im DictionaryBase-Objekt enthält.Gets an ICollection object containing the keys in the DictionaryBase object.

(Inherited from DictionaryBase)
IDictionary.Values IDictionary.Values IDictionary.Values IDictionary.Values

Ruft ein ICollection-Objekt ab, das die Werte des DictionaryBase-Objekts enthält.Gets an ICollection object containing the values in the DictionaryBase object.

(Inherited from DictionaryBase)
InnerHashtable InnerHashtable InnerHashtable InnerHashtable

Ruft die Liste der in der DictionaryBase-Instanz enthaltenen Elemente ab.Gets the list of elements contained in the DictionaryBase instance.

(Inherited from DictionaryBase)
Item[String] Item[String] Item[String] Item[String]

Ruft die Exception ab, die beim Ermitteln der angegebenen URL aus dem DiscoveryExceptionDictionary aufgetreten ist, oder legt diese fest.Gets or sets the Exception that occurred while discovering the specified URL from the DiscoveryExceptionDictionary.

Keys Keys Keys Keys

Ruft ein ICollection-Objekt mit allen Schlüsseln aus der DiscoveryExceptionDictionary ab.Gets a ICollection object with all the keys in the DiscoveryExceptionDictionary.

Values Values Values Values

Ruft ein ICollection-Objekt mit allen Werten aus dem DiscoveryExceptionDictionary ab.Gets a ICollection object containing all the values in the DiscoveryExceptionDictionary.

Methoden

Add(String, Exception) Add(String, Exception) Add(String, Exception) Add(String, Exception)

Fügt dem Exception eine DiscoveryExceptionDictionary mit einem Schlüssel von url hinzu.Adds an Exception with a key of url to the DiscoveryExceptionDictionary.

Clear() Clear() Clear() Clear()

Löscht den Inhalt der DictionaryBase-Instanz.Clears the contents of the DictionaryBase instance.

(Inherited from DictionaryBase)
Contains(String) Contains(String) Contains(String) Contains(String)

Bestimmt, ob das DiscoveryExceptionDictionary eine Exception mit der angegebenen URL enthält.Determines whether the DiscoveryExceptionDictionary contains an Exception with the specified URL.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Kopiert die DictionaryBase-Elemente am angegebenen Index in ein eindimensionales Array.Copies the DictionaryBase elements to a one-dimensional Array at the specified index.

(Inherited from DictionaryBase)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Gibt einen IDictionaryEnumerator zurück, der die DictionaryBase-Instanz durchläuft.Returns an IDictionaryEnumerator that iterates through the DictionaryBase instance.

(Inherited from DictionaryBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Fungiert als Standardhashfunktion.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object.

(Inherited from Object)
OnClear() OnClear() OnClear() OnClear()

Führt vor dem Löschen des Inhalts der DictionaryBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.Performs additional custom processes before clearing the contents of the DictionaryBase instance.

(Inherited from DictionaryBase)
OnClearComplete() OnClearComplete() OnClearComplete() OnClearComplete()

Führt nach dem Löschen des Inhalts der DictionaryBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.Performs additional custom processes after clearing the contents of the DictionaryBase instance.

(Inherited from DictionaryBase)
OnGet(Object, Object) OnGet(Object, Object) OnGet(Object, Object) OnGet(Object, Object)

Ruft das Element mit dem angegebenen Schlüssel und Wert aus der DictionaryBase-Instanz ab.Gets the element with the specified key and value in the DictionaryBase instance.

(Inherited from DictionaryBase)
OnInsert(Object, Object) OnInsert(Object, Object) OnInsert(Object, Object) OnInsert(Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse vor dem Einfügen eines neuen Elements in die DictionaryBase-Instanz aus.Performs additional custom processes before inserting a new element into the DictionaryBase instance.

(Inherited from DictionaryBase)
OnInsertComplete(Object, Object) OnInsertComplete(Object, Object) OnInsertComplete(Object, Object) OnInsertComplete(Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Einfügen eines neuen Elements in die DictionaryBase-Instanz aus.Performs additional custom processes after inserting a new element into the DictionaryBase instance.

(Inherited from DictionaryBase)
OnRemove(Object, Object) OnRemove(Object, Object) OnRemove(Object, Object) OnRemove(Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse vor dem Entfernen eines Elements aus der DictionaryBase-Instanz aus.Performs additional custom processes before removing an element from the DictionaryBase instance.

(Inherited from DictionaryBase)
OnRemoveComplete(Object, Object) OnRemoveComplete(Object, Object) OnRemoveComplete(Object, Object) OnRemoveComplete(Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Entfernen eines Elements aus der DictionaryBase-Instanz aus.Performs additional custom processes after removing an element from the DictionaryBase instance.

(Inherited from DictionaryBase)
OnSet(Object, Object, Object) OnSet(Object, Object, Object) OnSet(Object, Object, Object) OnSet(Object, Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse vor dem Festlegen eines Werts in der DictionaryBase-Instanz aus.Performs additional custom processes before setting a value in the DictionaryBase instance.

(Inherited from DictionaryBase)
OnSetComplete(Object, Object, Object) OnSetComplete(Object, Object, Object) OnSetComplete(Object, Object, Object) OnSetComplete(Object, Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Festlegen eines Werts in der DictionaryBase-Instanz aus.Performs additional custom processes after setting a value in the DictionaryBase instance.

(Inherited from DictionaryBase)
OnValidate(Object, Object) OnValidate(Object, Object) OnValidate(Object, Object) OnValidate(Object, Object)

Führt bei der Überprüfung des Elements mit dem angegebenen Schlüssel und Wert zusätzliche benutzerdefinierte Aktionen aus.Performs additional custom processes when validating the element with the specified key and value.

(Inherited from DictionaryBase)
Remove(String) Remove(String) Remove(String) Remove(String)

Entfernt eine Exception mit der angegebenen URL aus dem DiscoveryExceptionDictionary.Removes an Exception with the specified URL from the DiscoveryExceptionDictionary.

ToString() ToString() ToString() ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object.

(Inherited from Object)

Explizite Schnittstellenimplementierungen

IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object)

Fügt dem DictionaryBase ein Element mit dem angegebenen Schlüssel und Wert hinzu.Adds an element with the specified key and value into the DictionaryBase.

(Inherited from DictionaryBase)
IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object)

Stellt fest, ob der DictionaryBase einen bestimmten Schlüssel enthält.Determines whether the DictionaryBase contains a specific key.

(Inherited from DictionaryBase)
IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object)

Entfernt das Element mit dem angegebenen Schlüssel aus dem DictionaryBase.Removes the element with the specified key from the DictionaryBase.

(Inherited from DictionaryBase)
IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Gibt einen IEnumerator zurück, der DictionaryBase durchläuft.Returns an IEnumerator that iterates through the DictionaryBase.

(Inherited from DictionaryBase)

Erweiterungsmethoden

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ umCasts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filtert die Elemente eines IEnumerable anhand eines angegebenen TypsFilters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Ermöglicht die Parallelisierung einer Abfrage.Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Konvertiert einen IEnumerable in einen IQueryable.Converts an IEnumerable to an IQueryable.

Gilt für:

Siehe auch