This documentation is archived and is not being maintained.

DiscoveryExceptionDictionary.Add Method

Adds an Exception with a key of url to the DiscoveryExceptionDictionary.

[Visual Basic]
Public Sub Add( _
   ByVal url As String, _
   ByVal value As Exception _
)
[C#]
public void Add(
 string url,
 Exception value
);
[C++]
public: void Add(
 String* url,
 Exception* value
);
[JScript]
public function Add(
   url : String,
 value : Exception
);

Parameters

url
The URL that caused an exception during XML Web services discovery.
value
The Exception that occurred during XML Web services discovery.

Exceptions

Exception Type Condition
ArgumentNullException url is a null reference (Nothing in Visual Basic).
ArgumentException An entry with a key of url already exists in the DiscoveryExceptionDictionary.

Example

[Visual Basic] 
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

[C#] 
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;

[C++] 
DiscoveryExceptionDictionary* myNewExceptionDictionary =
   new DiscoveryExceptionDictionary();
// Add an exception with the custom error message.
Exception* myNewException =
   new Exception(S"The requested service is not available.");
myNewExceptionDictionary->Add(myUrlKey, myNewException);
myExceptionDictionary = myNewExceptionDictionary;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DiscoveryExceptionDictionary Class | DiscoveryExceptionDictionary Members | System.Web.Services.Discovery Namespace | Add

Show: