WCF - GZip Compression & wsHttpBinding

WCF - GZip Compression & wsHttpBinding

Old forum URL: forums.lhotka.net/forums/t/5074.aspx


JoOfMetL posted on Wednesday, July 09, 2008


Hi, I use WCF Like PTWcfService in ProjectTracker.

<system.serviceModel>
    <services>
      <service behaviorConfiguration="PTServiceBehavior" name="PTService">       
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="UserNameWS" contract="IPTService" />

        <!-- this endpoint is used for metadata exchange -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/PTService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
   
    <bindings>
      <wsHttpBinding>
        <binding name="UserNameWS">
          <security mode="Message">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
   
    <behaviors>
      <serviceBehaviors>
        <behavior name="PTServiceBehavior">
          <serviceAuthorization principalPermissionMode="Custom">
            <authorizationPolicies>
              <add policyType="PTWcfServiceAuth.PrincipalPolicy, PTWcfServiceAuth"/>
            </authorizationPolicies>
          </serviceAuthorization>
         
          <serviceCredentials>
            <serviceCertificate
              findValue="localhost"
              storeLocation="LocalMachine"
              storeName="My"
              x509FindType="FindBySubjectName" />
            <userNameAuthentication
              userNamePasswordValidationMode="Custom"
              customUserNamePasswordValidatorType="PTWcfServiceAuth.CredentialValidator, PTWcfServiceAuth" />
          </serviceCredentials>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>




I know the SDK gzip sample.

But how to do, to use the Gzip Encoder with wsHttpBinding with the option :

<binding name="UserNameWS">
          <security mode="Message">
            <message clientCredentialType="UserName" />
          </security>
        </binding>

?

Thank you

Copyright (c) Marimer LLC