DiscoveryClientProtocol.Errors 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 클래스에서 메서드를 호출하는 동안 발생한 예외의 컬렉션을 가져옵니다.
public:
property System::Web::Services::Discovery::DiscoveryExceptionDictionary ^ Errors { System::Web::Services::Discovery::DiscoveryExceptionDictionary ^ get(); };
public System.Web.Services.Discovery.DiscoveryExceptionDictionary Errors { get; }
member this.Errors : System.Web.Services.Discovery.DiscoveryExceptionDictionary
Public ReadOnly Property Errors As DiscoveryExceptionDictionary
속성 값
예외의 DiscoveryExceptionDictionary입니다.
예제
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_cs.vsdisco";
string myUrlKey = "http://localhost/MathService_cs.asmx?wsdl";
DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the discovery document.
DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myDiscoFile);
IEnumerator myEnumerator =
myDiscoveryDocument.References.GetEnumerator();
while ( myEnumerator.MoveNext() )
{
ContractReference myContractReference =
(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 : " + myException.Source);
Console.WriteLine(" Exception : " + myException.Message);
}
}
Dim myDiscoFile As String = "http://localhost/MathService_vb.vsdisco"
Dim myUrlKey As String = "http://localhost/MathService_vb.asmx?wsdl"
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
' Get the discovery document.
Dim myDiscoveryDocument As DiscoveryDocument = myDiscoveryClientProtocol.Discover(myDiscoFile)
Dim myEnumerator As IEnumerator = myDiscoveryDocument.References.GetEnumerator()
While myEnumerator.MoveNext()
Dim myContractReference As ContractReference = CType(myEnumerator.Current, ContractReference)
' Get the DiscoveryClientProtocol from the ContractReference.
myDiscoveryClientProtocol = myContractReference.ClientProtocol
myDiscoveryClientProtocol.ResolveAll()
Dim myExceptionDictionary As DiscoveryExceptionDictionary = myDiscoveryClientProtocol.Errors
If myExceptionDictionary.Contains(myUrlKey) Then
Console.WriteLine("System generated exceptions.")
' Get the exception from the DiscoveryExceptionDictionary.
Dim myException As Exception = myExceptionDictionary(myUrlKey)
Console.WriteLine(" Source : " & myException.Source)
Console.WriteLine(" Exception : " & myException.Message)
Console.WriteLine()
End If
End While
설명
컬렉션은 Errors , DiscoverAnyResolveAll및 ResolveOneLevel 메서드를 호출하는 동안 발생한 예외로 Discover채워집니다. 이러한 DiscoveryExceptionDictionary 메서드의 호출에서 지워집니다.