开发者

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
} 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜