压缩来自WCF的数据 [英] Compressing data coming out of WCF

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

问题描述

我想在基本HttpBinding上压缩来自WCF的数据。

我试图生成一个最初作为SOAP Web服务编写的系统的新版本。在我们收到一个请求时,我们返回了一个GZipStream。

I would like to compress the data coming out of WCF on a basicHttpBinding.
I am trying to produce a new version of a system originally written as SOAP web services. In that we returned a GZipStream when we received a request.

有什么方法可以做WCF吗?

Is there any way to do the same with WCF?

我使用的是VS2010,目前针对.Net 3.5,但是很灵活。

I am using VS2010, currently against .Net 3.5 but that's flexible.

感谢

推荐答案

如果您计划使用IIS主机和.NET 4.0客户端,您可以在IIS中使用动态内容压缩中的build。如果客户端向服务器发送Accept-Encoding:gzip / deflate标头,IIS将为您压缩响应。 .NET 4.0客户端能够自动解压缩响应。检查支持HTTP解压缩部分。

If you plan to use IIS hosting and .NET 4.0 client you can use build in dynamic content compression in IIS. If client sends Accept-Encoding: gzip/deflate header to the service IIS will compresses the response for you. .NET 4.0 client is able to automatically decompress the response. Check Support for HTTP Decompression section.

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

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