The following code snippet was posted in an MSDN blog, which seems to
indicate that "wired in" deserialization of SoapFault elements to .NET
exception types will work on Indigo/WCF. Is there any way to get this
without Indigo/WCF? I haven't had any luck using WSE3.
<blog snippet>
On the client, catching these custom exceptions is very easy. You need to
reference the shared CustomException type in your project and then...
try
{
// call the operation that generates the exception
}
catch (Fault<MyCustomException>)
{
Console.WriteLine("It worked! Custom Exception!");
}
catch (Exception e)
{
Console.WriteLine("Didn't work. Sorry. "+e.ToString());
}
Then, to map the fault to the local custom exception, you use:
catch (Fault<MyCustomException> fault)
{
Console.WriteLine("It worked! Custom Exception!");
MyCustomException mce = fault.Detail;
}
</blog snippet>
http://blogs.msdn.com/smguest/archiv...12/438084.aspx