FaultException and custom exception WCF

风流意气都作罢 提交于 2019-11-29 11:13:30

You do need to mark it with [DataContract] as described at this page: http://msdn.microsoft.com/en-us/library/ms576199.aspx.

I'm assuming (but don't know for sure) that ArgumentException works because it's known on both sides of the wire (assuming you're using .NET on each side). Without declaring your exception as a DataContract, it can't be described and serialized/deserialized correctly by the DataContractSerializer.

You certainly need to Mark it as DataContract. It is a custom type, which the other side (your client) does not know.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!