开发者

How to create a WCF MessageFault

开发者 https://www.devze.com 2023-01-13 23:46 出处:网络
I see two ways to create a MessageFault: FaultException fe = new FaultException(\"error\"); MessageFault f = fe.CreateMessageFault();

I see two ways to create a MessageFault:

   FaultException fe = new FaultException("error");
   MessageFault f = fe.CreateMessageFault();

Or

   FaultCode fc = new FaultCode("error");
   MessageFault f = MessageFault.CreateFaul开发者_如何学Pythont(fc, "error");

What's the difference b/w two? Is anyone preferred?


There are many more ways to create a MessageFault than that. See MessageFault members.

All of these create an instance of the MessageFault class. The documentation tells you how they differ.

0

精彩评论

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

关注公众号