Exceptions and TDetail
Here's what I need to do:
catch (System.ServiceModel.FaultException&l开发者_开发知识库t;CustomFault> ex)
{
throw ex;
}
The problem is, the fault I'm getting is
System.ServiceModel.Security.MessageSecurityException
How do I return the custom fault?
Are you trying to catch the fault server-side? That's not going to work; MessageSecurityException
is thrown before server code gets executed.
If you're trying to catch the fault in client-side code, just use
catch (System.ServiceModel.Security.MessageSecurityException ex)
{
// handle exception
}
精彩评论