DiscoveryExceptionDictionary.Add(String, Exception) Metod

Definition

Lägger till en Exception med en nyckel url för i DiscoveryExceptionDictionary.

public:
 void Add(System::String ^ url, Exception ^ value);
public void Add(string url, Exception value);
member this.Add : string * Exception -> unit
Public Sub Add (url As String, value As Exception)

Parametrar

url
String

URL:en som orsakade ett undantag vid IDENTIFIERING av XML-webbtjänster.

value
Exception

Det Exception som inträffade under xml-webbtjänstidentifieringen.

Undantag

url är null.

Det finns redan en post med nyckeln url för i DiscoveryExceptionDictionary.

Exempel

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;
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;
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

Gäller för

Se även