Compressing as GZip WCF requests (SOAP and REST)
- by Joannes Vermorel
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?