WCF数据集压缩
我有一个 wcf 客户端,它从 wcf 服务接收数据集。它通过 LAN 并使用 NetTcpBinding。我正在使用默认的二进制编码。根据调用类型,数据集的大小可能会很大(这些类型的调用可能占总调用的 5%)。此外,将来该服务可能会通过 http 绑定提供。
据我所知,二进制编码提供了所有可用编码器的最佳压缩。有没有办法在将数据集发送到客户端之前对其进行更好的压缩?
I have a wcf client which receives a dataset from a wcf service. It is over LAN and uses NetTcpBinding. I am using the default binary encoding. The size of the dataset can be huge depending on the type of call (these types of calls maybe 5% of the total calls). Also in future the service might be available through http binding.
As far as I know binary encoding provides the best compression of all the available encoders. Is there a way to get better compression on the dataset before sending it to the client?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
二进制与 HTTP 绑定并不代表压缩。 MSDN 中的这篇文章深入讨论了如何实现自定义消息编码器这涉及到数据流的压缩。
Binary vs. HTTP binding does not represent compression. This article in MSDN provides a thorough discussion how to implement a custom message encoder that involves compression of the data stream.
看一下 protobuf-net(r356)。 StackOverflow 上的一位优秀用户 Marc Gravell 还发表了一篇博客文章: http://marcgravell.blogspot.com/2010/10/datatable-life-in-old-beast.html
Take a look at protobuf-net(r356). There is also a blog post from Marc Gravell, a great user here on StackOverflow: http://marcgravell.blogspot.com/2010/10/datatable-life-in-old-beast.html