如何为 IIS 7 上的 SOAP WebService 的 POST(上传)请求启用 GZIP 压缩? [英] How do I enable GZIP compression for POST (upload) requests to a SOAP WebService on IIS 7?

查看:28
本文介绍了如何为 IIS 7 上的 SOAP WebService 的 POST(上传)请求启用 GZIP 压缩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为上传到 .NET WebService(SOAP,而不是 WCF)的 POSTed 数据启用压缩?我认为在 IIS 中 启用动态压缩 会很简单,但是在启用之后,它只是压缩响应,而不是 POST 请求.

How can I enable compression for POSTed data uploaded to a .NET WebService (SOAP, not WCF)? I thought it would be a simple matter of enabling dynamic compression in IIS but after enabling, it's only compressing the response, not the POST request.

我已将其添加为服务引用,但在生成的 SOAPClient 上找不到任何启用请求压缩的设置.

I've added it as a Service Reference and I can't find any settings on the generated SOAPClient to enable compression of requests.

在将请求发送到服务器之前,我似乎缺少客户端的配置设置或代码来压缩请求?或者甚至不支持我正在尝试做的事情(GZipping POST 数据)?

It seems I might be missing a configuration setting or code on the client side to compress the request before sending it to the server? Or is what I'm trying to do (GZipping POST data) not even supported?

更多信息:我在客户端和服务器上使用 .NET 4.0.

Further info: I'm using .NET 4.0 on the client and server.

推荐答案

我在 4 年前写过博客

I've blogged on that 4 years ago

http://netpl.blogspot.com/2009/07/aspnet-webservices-two-way-response-and.html

我想知道为什么你没有通过谷歌搜索找到这个.无论如何,这应该对您有用,我们已经在生产环境中运行了 4 年.

I wonder why you haven't found this by googling. Anyway, this should work for you, we have it working in a production environment for 4 years now.

这篇关于如何为 IIS 7 上的 SOAP WebService 的 POST(上传)请求启用 GZIP 压缩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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