title: Accepting gzipped requests in CXF
body: <p>I'm using Apache CXF to develop a JAX-RS service.  My service is working, but I want to change it to accept compressed (gzipped) requests.</p>
  
  <p>I've done some googling and added this to my <code>beans.xml</code> file:</p>
  
  <pre><code>&lt;bean id="GZIPInInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor"/&gt;
  &lt;bean id="compressGZIPFeature" class="org.apache.cxf.transport.http.gzip.GZIPFeature"/&gt;
  &lt;cxf:bus&gt;
      &lt;cxf:inInterceptors&gt;
          &lt;ref bean="GZIPInInterceptor"/&gt;
      &lt;/cxf:inInterceptors&gt;
      &lt;cxf:features&gt;
          &lt;ref bean="compressGZIPFeature"/&gt;
          &lt;cxf:logging/&gt;
      &lt;/cxf:features&gt;
  &lt;/cxf:bus&gt;
  </code></pre>
  
  <p>but when I call the service from my client application with a compressed request, I get the error <strong>Invalid UTF-8 start byte 0x8b</strong> and this in the log file:</p>
  
  <pre><code>28-May-2012 12:59:42 org.apache.cxf.interceptor.AbstractLoggingInterceptor log
  INFO: Inbound Message
  ----------------------------
  ID: 5
  Address: http://localhost:8080/ ... /
  Encoding: ISO-8859-1
  Http-Method: POST
  Content-Type: application/xml
  Headers: {Accept=[application/xml], connection=[Keep-Alive], content-encoding=[g
  zip], Content-Length=[246], content-type=[application/xml], expect=[100-continue
  ], host=[localhost:8080]}
  Payload: ?     ? ý¢`?I?%&amp;/m-{¦J§JÎÓt?`?$Ï?@?ý-?-µ?ý?iG#)½*?-eVe]f?@¦Ý?+¸Ì{´¢¸Ì{´
  ¢¸¦;?N'¸¯ ?\fd?l÷+J++?!?¬+??~|??"? ?´?ez?ÎMQ-?¹hw+¾Q?/ºi¼X^|÷Ð¦=¯&gt;°Þ¸8z|Íµ?ú4}|·
  ???¡-÷t+ÍÎgO?÷vv¸v÷w÷´¦ tg¦¸-/Õ+´Ý}¦¦w?¦+C¤/²®_·dþÚ¦²{;'??&gt;³¶ßÚ+¦'¤?Ý|·õ¦±¦¦¦?O?
  ¯Ý&gt;¥¦?·°.w
  --------------------------------------
  28-May-2012 12:59:43 org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleJA
  XBException
  WARNING: javax.xml.bind.UnmarshalException
   - with linked exception:
  [com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x8b (at char #2, by
  te #-1)]
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStrea
  mException(UnmarshallerImpl.java:426)
  
  ...
  
  28-May-2012 12:59:43 org.apache.cxf.interceptor.AbstractLoggingInterceptor log
  INFO: Outbound Message
  ---------------------------
  ID: 5
  Response-Code: 400
  Content-Type: text/plain
  Headers: {Content-Type=[text/plain], Date=[Mon, 28 May 2012 11:59:43 GMT]}
  Payload: JAXBException occurred : Invalid UTF-8 start byte 0x8b (at char #2, byt
  e #-1). Invalid UTF-8 start byte 0x8b (at char #2, byte #-1).
  --------------------------------------
  </code></pre>