title: How do I disable gzip for wcf?
body: <p>I know both do the de/compression automatically, I still want to disable it. But how? I tried adding a <code>textEncoding="Utf8Encoding"</code> element, but then nothing worked anymore.</p>
  
  <p>I have this in my standard wcf service:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;protocolMapping&gt;
          &lt;add binding="basicHttpsBinding" scheme="https" /&gt;
      &lt;/protocolMapping&gt;    
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" /&gt;
  
      &lt;diagnostics&gt;
        &lt;messageLogging logEntireMessage="true"
                                    logMalformedMessages="true"
                                    logMessagesAtServiceLevel="true"
                                    logMessagesAtTransportLevel="true"
                                    maxMessagesToLog="500"/&gt;
      &lt;/diagnostics&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>This is my wcf client:</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;protocolMapping&gt;
        &lt;add binding="basicHttpsBinding" scheme="https" /&gt;
      &lt;/protocolMapping&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
      &lt;client&gt;
        &lt;endpoint address="http://localhost:5555/Service1.svc"
          binding="basicHttpBinding"
          contract="IService1"
          name="WebServiceEndpoint" /&gt;
      &lt;/client&gt;
      &lt;diagnostics&gt;
        &lt;messageLogging logEntireMessage="true"
                                    logMalformedMessages="true"
                                    logMessagesAtServiceLevel="true"
                                    logMessagesAtTransportLevel="true"
                                    maxMessagesToLog="500"/&gt;
      &lt;/diagnostics&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong>
  I added this to the service but it isnt working, I keep gettingHTTP/1.1 415 Cannot process the message because the content type 'text/xml;charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.</p>
  
  <pre><code>&lt;bindings&gt;
    &lt;customBinding&gt;
      &lt;binding name="test"&gt;
        &lt;httpTransport decompressionEnabled="false"&gt;&lt;/httpTransport&gt;
      &lt;/binding&gt;
    &lt;/customBinding&gt;
  &lt;/bindings&gt;
  &lt;protocolMapping&gt;
      &lt;add binding="customBinding" bindingConfiguration="test" scheme="http" /&gt;
  &lt;/protocolMapping&gt;  
  </code></pre>