DiscoveryExceptionDictionary Sınıf

Tanım

XML Web hizmetleri bulma sırasında oluşan özel durumları toplar. Bu sınıf devralınamaz.

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
Devralma
DiscoveryExceptionDictionary

Örnekler

#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

Açıklamalar

Errors özelliği DiscoveryClientProtocol türündedirDiscoveryExceptionDictionary.

Oluşturucular

DiscoveryExceptionDictionary()

DiscoveryExceptionDictionary sınıfının yeni bir örneğini başlatır.

Özellikler

Count

Örnekte bulunan DictionaryBase öğelerin sayısını alır.

(Devralındığı yer: DictionaryBase)
Dictionary

Örnekte bulunan DictionaryBase öğelerin listesini alır.

(Devralındığı yer: DictionaryBase)
InnerHashtable

Örnekte bulunan DictionaryBase öğelerin listesini alır.

(Devralındığı yer: DictionaryBase)
Item[String]

belirtilen URL'yi bulurken oluşan öğesini DiscoveryExceptionDictionaryalır veya ayarlarException.

Keys

içindeki DiscoveryExceptionDictionarytüm anahtarlara sahip bir ICollection nesnesi alır.

Values

içindeki DiscoveryExceptionDictionarytüm değerleri içeren bir ICollection nesnesi alır.

Yöntemler

Add(String, Exception)

Exception anahtarına urlDiscoveryExceptionDictionaryile ekler.

Clear()

Örneğin içeriğini DictionaryBase temizler.

(Devralındığı yer: DictionaryBase)
Contains(String)

öğesinin DiscoveryExceptionDictionary belirtilen URL'ye sahip bir Exception öğesini içerip içermediğini belirler.

CopyTo(Array, Int32)

Öğeleri belirtilen dizindeki DictionaryBase tek boyutlu Array bir öğeye kopyalar.

(Devralındığı yer: DictionaryBase)
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetEnumerator()

Örnekte yineleyen DictionaryBase bir IDictionaryEnumerator döndürür.

(Devralındığı yer: DictionaryBase)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
OnClear()

Örneğin içeriğini DictionaryBase temizlemeden önce ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnClearComplete()

Örneğin içeriğini DictionaryBase temizledikten sonra ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnGet(Object, Object)

Örnekte belirtilen anahtar ve değere DictionaryBase sahip öğesini alır.

(Devralındığı yer: DictionaryBase)
OnInsert(Object, Object)

Örneğe yeni bir öğe DictionaryBase eklemeden önce ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnInsertComplete(Object, Object)

Örneğe yeni bir öğe DictionaryBase ekledikten sonra ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnRemove(Object, Object)

Bir öğeyi örnekten DictionaryBase kaldırmadan önce ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnRemoveComplete(Object, Object)

Bir öğeyi örnekten DictionaryBase kaldırdıktan sonra ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnSet(Object, Object, Object)

Örnekte bir değer DictionaryBase ayarlamadan önce ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnSetComplete(Object, Object, Object)

Örnekte bir değer DictionaryBase ayarladıktan sonra ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
OnValidate(Object, Object)

Öğesi belirtilen anahtar ve değerle doğrulanırken ek özel işlemler gerçekleştirir.

(Devralındığı yer: DictionaryBase)
Remove(String)

belirtilen URL'ye sahip bir Exception öğesini içinden DiscoveryExceptionDictionarykaldırır.

ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

ICollection.IsSynchronized

Bir nesneye erişimin eşitlenip eşitlenmediğini belirten bir DictionaryBase değer alır (iş parçacığı güvenli).

(Devralındığı yer: DictionaryBase)
ICollection.SyncRoot

Bir nesneye erişimi eşitlemek için kullanılabilecek bir DictionaryBase nesne alır.

(Devralındığı yer: DictionaryBase)
IDictionary.Add(Object, Object)

öğesine belirtilen anahtar ve değere DictionaryBasesahip bir öğe ekler.

(Devralındığı yer: DictionaryBase)
IDictionary.Contains(Object)

öğesinin DictionaryBase belirli bir anahtar içerip içermediğini belirler.

(Devralındığı yer: DictionaryBase)
IDictionary.IsFixedSize

Bir DictionaryBase nesnenin sabit bir boyuta sahip olup olmadığını belirten bir değer alır.

(Devralındığı yer: DictionaryBase)
IDictionary.IsReadOnly

Bir nesnenin salt okunur olup olmadığını gösteren bir DictionaryBase değer alır.

(Devralındığı yer: DictionaryBase)
IDictionary.Item[Object]

Belirtilen anahtarla ilişkili değeri alır veya ayarlar.

(Devralındığı yer: DictionaryBase)
IDictionary.Keys

Nesnedeki DictionaryBase anahtarları içeren bir ICollection nesneyi alır.

(Devralındığı yer: DictionaryBase)
IDictionary.Remove(Object)

öğesinden belirtilen anahtara DictionaryBasesahip öğesini kaldırır.

(Devralındığı yer: DictionaryBase)
IDictionary.Values

Nesnedeki DictionaryBase değerleri içeren bir ICollection nesneyi alır.

(Devralındığı yer: DictionaryBase)
IEnumerable.GetEnumerator()

aracılığıyla DictionaryBaseyineleyen bir IEnumerator döndürür.

(Devralındığı yer: DictionaryBase)

Uzantı Metotları

Cast<TResult>(IEnumerable)

öğesinin IEnumerable öğelerini belirtilen türe atar.

OfType<TResult>(IEnumerable)

Öğesinin IEnumerable öğelerini belirtilen türe göre filtreler.

AsParallel(IEnumerable)

Sorgunun paralelleştirilmesini etkinleştirir.

AsQueryable(IEnumerable)

bir IEnumerable öğesini öğesine IQueryabledönüştürür.

Şunlara uygulanır

Ayrıca bkz.