为 WCF 启用解压缩 - 服务?
这对我来说是一个重大问题。早期,Web 服务客户端只需使用 EnableDecompression = true 就可以了,但是为什么微软不添加类似于 WCF 的东西呢?
我真的需要来自我的 WCF 服务的 gzip 压缩响应(它们需要是 http...遗留问题,像往常一样...你知道...)。
This is a major issue for me. In earlier times, web service clients could simply use EnableDecompression = true and all was good, but why did Microsoft not add something similar to WCF?
I really NEED gzip compressed responses from my WCF services (and they need to be http... legacy issues, as usual... you know...).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个 博客文章 基本上最终建议:
Codeplex 上还有一个 WCF 扩展项目,它有一个 WCF 压缩通道 - 也许这就是您正在寻找的。
最划算的方法是在 WCF 中使用
binaryMessageEncoding
而不是 textMessageEncoding(这是 HTTP 绑定的默认值)。这需要您 创建基于自定义 http 的绑定,并且会使您的服务与除也使用相同自定义绑定配置的 .NET 客户端之外的其他基于 http 的客户端不兼容。Check out this blog post which basically ends up suggesting:
There's also a WCF Extensions project on Codeplex which has a WCF Compression Channel - maybe that'll be what you're looking for.
The most bang for the buck would be to use the
binaryMessageEncoding
in WCF instead of the textMessageEncoding (which is the default for HTTP bindings). That would require you to create a custom http based binding, and would render your service incompatible with other http-based clients other than .NET clients that are also using the same custom binding configuration.