WCF的Xml VS二进制序列化的优点和缺点优点、缺点、序列化、WCF

2023-09-04 03:14:21 作者:寄给你悲喜

我知道,如果我使用二进制序列化与WCF我失去interopability。

I know that if I use binary serialization with WCF I lose interopability.

如果我愿意忍受这一点,我是wonderinf如果在使用二进制基于XML的效率优势。

If I'm willing to live with this I was wonderinf if there is an efficiency benefit in using binary over Xml.

如果有,我没有上面

推荐答案

是 - 一个潜在的大单。与二进制相当于比XML序列化的数据是很大的。随着二,你失去可读性和互操作性。你也失去了在IIS来承载能力,除非你是在Windows Server 2008或Windows Vista或更高。

Yes - potentially a big one. XML serialized data is big compared with the binary equivalent. With binary, you lose readability and interoperability. You also lose the ability to host in IIS unless you are on Windows Server 2008 or Windows Vista or higher.

不过,如果你是在一个.NET以.NET方案的性能提升outweight在许多情况下这些缺点。

However, the performance gains if you are in a .NET to .NET scenario outweight these drawbacks in many situations.