DiscoveryClientProtocol.Errors Property
.NET Framework 3.0
Gets a collection of exceptions that occurred during invocation of method from this class.
Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public: property DiscoveryExceptionDictionary^ Errors { DiscoveryExceptionDictionary^ get (); }
/** @property */ public DiscoveryExceptionDictionary get_Errors ()
public function get Errors () : DiscoveryExceptionDictionary
Not applicable.
Property Value
A DiscoveryExceptionDictionary of exceptions.The Errors collection is populated with exceptions that occurred during invocations to the Discover, DiscoverAny, ResolveAll, and ResolveOneLevel methods. The DiscoveryExceptionDictionary is cleared on invocation of these methods.
String^ myDiscoFile = "http://localhost/MathService_cs.vsdisco"; String^ myUrlKey = "http://localhost/MathService_cs.asmx?wsdl"; DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol; // Get the discovery document. DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol->Discover( myDiscoFile ); IEnumerator^ myEnumerator = myDiscoveryDocument->References->GetEnumerator(); while ( myEnumerator->MoveNext() ) { ContractReference^ myContractReference = dynamic_cast<ContractReference^>(myEnumerator->Current); // Get the DiscoveryClientProtocol from the ContractReference. myDiscoveryClientProtocol = myContractReference->ClientProtocol; myDiscoveryClientProtocol->ResolveAll(); DiscoveryExceptionDictionary^ myExceptionDictionary = myDiscoveryClientProtocol->Errors; if ( myExceptionDictionary->Contains( myUrlKey ) ) { Console::WriteLine( "System generated exceptions." ); // Get the exception from the DiscoveryExceptionDictionary. Exception^ myException = myExceptionDictionary[ myUrlKey ]; Console::WriteLine( " Source : {0}", myException->Source ); Console::WriteLine( " Exception : {0}", myException->Message ); } } }
String myDiscoFile = "http://localhost/MathService_jsl.vsdisco";
String myUrlKey = "http://localhost/MathService_jsl.asmx?wsdl";
DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the discovery document.
DiscoveryDocument myDiscoveryDocument = myDiscoveryClientProtocol.
Discover(myDiscoFile);
IEnumerator myEnumerator = myDiscoveryDocument.get_References().
GetEnumerator();
while (myEnumerator.MoveNext()) {
ContractReference myContractReference = (ContractReference)
myEnumerator.get_Current();
// Get the DiscoveryClientProtocol from the ContractReference.
myDiscoveryClientProtocol = myContractReference.
get_ClientProtocol();
myDiscoveryClientProtocol.ResolveAll();
DiscoveryExceptionDictionary myExceptionDictionary =
myDiscoveryClientProtocol.get_Errors();
if (myExceptionDictionary.Contains(myUrlKey)) {
Console.WriteLine("System generated exceptions.");
// Get the exception from the DiscoveryExceptionDictionary.
System.Exception myException = myExceptionDictionary.
get_Item(myUrlKey);
Console.WriteLine(" Source : " + myException.get_Source());
Console.WriteLine(" Exception : " + myException.get_Message());
}
}
Windows 98, Windows Server 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
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: