In .NET 2.0 the property .EnableDecompression was added which will allow you to use IIS 6 Native Compression in your smart client application. The following article explains how to implement compression in your application and how to configure IIS 6 to support compression of asmx web services.
Configure client side code to allow for compression/decompression. For your client application you must first generate a proxy class that will allow you to connect to your web service. To do this, you can use the wsdl.exe tool and pass in your web service WSDL:
Next, add the proxy class to your project, instantiate your proxy and set the EnableDecompression property to true:
Enable compression on the Web Services IIS server.
1. On the IIS server, open Inetmgr, right click on the web site node and select properties. Click on the Service tab.
2. Under the HTTP compression section, check “Compress application files” and “Compress static files” click Apply – OK.
3. Click on Web Service Extensions.
4. Click “Add a new Web service extension” and add the gzip.dll extension.
Finally – Add the asmx extension to your HcScriptFileExtensions collection by running the following adsutil.vbs statement:
Verify that compression is working by using Fiddler and checking the response body of your web service call. Check the transformer section and look for the HTTP Compression section.
- Before compression the data sent over the wire from server <> client is ~14 MB
- After compression the data sent over the wire from server <> client is 578 KB or < 1 MB.
- The duration of the call was decreased by roughly half a second. However, the NIC utilization was substantial. Watching Task Manager while testing this I saw 75% NIC utilization for a single request when the data was not compressed. With compression I saw < 5% NIC utilization.
- Compression is very easy to implement in a smart client. Simply set the EnableDecompression = true property on the client and configure IIS native compression adding the “asmx” to the HCCriptFileExtentions section.
For more information see the following:
Microsoft – ACE Team