如何压缩来自WCF服务的返回数据 [英] How to compress Return data from WCF service

查看:112
本文介绍了如何压缩来自WCF服务的返回数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在Service(WCF)端实现压缩,以将数据压缩的方式发送到客户端.我已经在Push中实现了,我的意思是将大量数据发送到WCF服务.从服务到客户我都做不到.请任何人帮帮我.

在此先感谢
Manjunath

Hi,

I want to implement compression in Service(WCF) side to send in data compressed manner to Client. I have implemented in Push I mean sending huge data to WCF service. I am not able to do from service to Client. Please anyone help me out.

Thanks in Advance
Manjunath

推荐答案

尝试使用MTOM编码. MTOM编码器试图在效率和互操作性之间取得平衡.
这意味着您还希望更改绑定类型.看看MtomMessageEncodingBindingElement [ ^ ].
Try using MTOM encoding. MTOM encoder attempts to create a balance between efficiency and interoperability.
This would mean you would want to change the binding type as well. Have a look at the MtomMessageEncodingBindingElement class[^].


看看:
在.NET中优化序列化 [在.NET中优化序列化-第2部分 [
Have a look at:
Optimizing Serialization in .NET[^]
Optimizing Serialization in .NET - part 2[^]

In your case I think they are well worth reading - and the code is pretty fast too :)

Best regards
Espen Harlinn


这篇关于如何压缩来自WCF服务的返回数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆