Compressing as GZip WCF requests (SOAP and REST)

Posted by Joannes Vermorel on Stack Overflow See other posts from Stack Overflow or by Joannes Vermorel
Published on 2010-05-01T07:49:41Z Indexed on 2010/05/01 7:57 UTC
Read the original article Hit count: 266

Filed under:
|
|
|
|

I have a .NET 3.5 web app hosted on Windows Azure that exposes several WCF endpoints (both SOAP and REST). The endpoints typically receive 100x more data than they serve (lot of data is upload, much fewer is downloaded).

Hence, I am willing to take advantage from HTTP GZip compression but not from the server viewpoint, but rather from the client viewpoint, sending compressed requests (returning compressed responses would be fine, but won't bring much gain anyway).

Here is the little C# snippet used on the client side to activate WCF:

var binding = new BasicHttpBinding();
var address = new EndpointAddress(endPoint);

_factory = new ChannelFactory<IMyApi>(binding, address);
_channel = _factory.CreateChannel(); 

Any idea how to adjust the behavior so that compressed HTTP requests can be made?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about Azure