在WCF中使用Gzip压缩的配置方法
这是一种基于WCF通道传输数据的压缩技术,只要通过配置就可以在自己的项目中使用压缩技术,比较方便!
04 |
<service behaviorConfiguration= "metadataBehavior" name= "WcfTest.Services.SwfBuilderService" > |
05 |
<endpoint address= "http://127.0.0.1:99/swfbuild" binding= "customBinding" bindingConfiguration= "BufferedHttpSampleServer" bindingName= "BufferedHttpSampleServer" contract= "WcfTest.Contracts.ISwfBuilder" /> |
09 |
<bindingElementExtensions> |
10 |
<add name= "gzipMessageEncoding" type= "GZipEncoder.GZipMessageEncodingElement, GZipEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> |
11 |
</bindingElementExtensions> |
15 |
<binding name= "BufferedHttpSampleServer" > |
16 |
<gzipMessageEncoding innerMessageEncoding= "textMessageEncoding" /> |
17 |
<httpTransport hostNameComparisonMode= "StrongWildcard" |
18 |
manualAddressing= "False" |
19 |
maxReceivedMessageSize= "65536" |
20 |
authenticationScheme= "Anonymous" |
21 |
bypassProxyOnLocal= "False" |
23 |
useDefaultWebProxy= "True" /> |
05 |
<binding name= "WSHttpBinding_SwfBuilderService" > |
06 |
<gzipMessageEncoding innerMessageEncoding= "textMessageEncoding" /> |
07 |
<httpTransport manualAddressing= "false" |
08 |
authenticationScheme= "Anonymous" |
09 |
bypassProxyOnLocal= "false" |
10 |
hostNameComparisonMode= "StrongWildcard" |
11 |
proxyAuthenticationScheme= "Anonymous" |
13 |
useDefaultWebProxy= "true" /> |
17 |
</system.serviceModel> |
19 |
<bindingElementExtensions> |
20 |
<add name= "gzipMessageEncoding" type= "GZipEncoder.GZipMessageEncodingElement, GZipEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> |
21 |
</bindingElementExtensions> |
25 |
bindingConfiguration= "WSHttpBinding_SwfBuilderService" contract= "SwfBuild.SwfBuilderService" |
26 |
name= "WSHttpBinding_SwfBuilderService" > |
30 |
<extension type= "GZipEncoder.GZipMessageEncodingBindingElementImporter, GZipEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> |