Using compression with C# webservice client in Visual Studio 2010

偶尔善良 提交于 2019-12-02 21:36:48

问题


I'm invoking a webservice using C# and Visual Studio 2010. VS2010 takes care of generating the client proxy code when I provide the link to the WSDL. Is there a way to configure the client code to set the 'Accept-Encoding' header to (gzip, deflate) and handle compressed responses from the server? If not, how do I write custom code to handle this?


回答1:


Try this. It is an article on using compression with a WCF service. I am making the assumption (possibly incorrect) that you have control of both the service and the client. If this is somebody else's service, you can't perform a Harry Potter and make it magically compress, unless they have coded that possibility. If you are in complete control of both ends, you can make the magic happen. ;-)



来源:https://stackoverflow.com/questions/9787923/using-compression-with-c-sharp-webservice-client-in-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!