Web Service Compression

I was porting some code to WSE 3 and had to look for a new method of compressing my web service requests and response.  It seems there are many options to handle compressing a response and decompressing it on the client but they all seem to overlook at the web service request.  They can be almost as large as a response and would benefit tremendously from compression.  So this weekend I threw together a HttpModule that could handle compressing the web service response and handle incoming compressed requests.  I also have the custom WebRequest and WebResponse classes for handling the compression on the client side.

Client side usage.

In your web service proxy class overload the GetWebRequest

partial class TestService : System.Web.Services.Protocols.SoapHttpClientProtocol 
{
    protected override System.Net.WebRequest GetWebRequest( System.Uri uri )
   {
      return new MicroFischCompress.CompressWebRequest( System.Net.WebRequest.Create( uri ), true);
   }
}
 
 WebServiceCompression.zip (147.02 KB)
Comments [0]
All comments require the approval of the site owner before being displayed.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview