压缩Web服务请求 [英] Compressing web service request

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

问题描述

我在C#/ DOTNET一个Web服务和客户端,我用EnableDecompression给gzip压缩,我从Web服务器获得响应。它是可以压缩的要求呢?

I have a webservice and client in c#/dotnet and I am using EnableDecompression to gzip compress the responses that I get from the web server. Is it possible to compress the requests as well?

推荐答案

SOAP扩展让你的猴子与两个客户端上的SOAP流服务器。他们是很好的,因为你可以独自离开你的服务代码 - 一个WebMethod开始前和发生操纵它结束了。他们的工作很像一个HttpModule,但可以包含在客户/请求端以及

SOAP extensions allow you to monkey with the SOAP stream on both the client and server. They're nice because you can leave your service code alone - manipulation occurs before a webmethod begins and after it ends. They work a lot like an HttpModule but can be included on the client/request side as well.

  • http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapextension.aspx
  • http://msdn.microsoft.com/en-us/magazine/cc164007.aspx
  • SOAP Message Modification Using SOAP Extensions

除此之外,该想到的唯一的选择是手动序列化和压缩大型SOAP元素的byte [],然后手动解压缩并在服务器上反序列化(不寒而栗...)。这种方法的维护问题有可能过高。

Other than that, the only option that comes to mind is manually serializing and compressing large SOAP elements as byte[], then manually decompressing and deserializing on the server (shudder...). The maintenance issues with this approach are likely prohibitive.

这篇关于压缩Web服务请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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