Installing the component
The compression library should be installed on both the WCF service hosting project and the client project, that consumes the service. This can be done easily by using Nuget.- If the Nuget package console is used, then execute the following command for each project (i.e. service and Clients).
PM> Install-Package Rashans.WCF.Compression
- If the Nuget GUI is used, then search for “wcf compression encoder” and select the package with Id Rashans.WCF.Compression.
Configuring the WCF Service hosting project
1. The configuration details related to the compression library are defined in a custom binding element. So the first thing you have to do is to register the custom binding element as bellow;2. Define the customBinding based on the inner encoder type. In the following example, I am defining 2 custom bindings; one is based on textMessageEncoder over HTTP transport and the other based on binaryMessageEncoding over TCP. Also note that I have set the compression type as “gzip”. Currently, the only compression method supports is gzip, but soon I will add the support for other compression types.
Configuring the WCF Service consuming projects
1. Just like in the service project, we need to register the custom binding element and define the custom bindings. That is, repeat the 1 and 2 operations in each client project that accessing the WCF service.2. Register the custom metadata\policy importer.
A sample application with both server and client components can be found here;
Hi,
ReplyDeleteI need permission to access to the files.
you may login using any gmail account
ReplyDelete