locked
HTTP Compression and WCF client RRS feed

  • Question

  • We are accessing a java based web service sending large xml blobs.... The server has the capability to zip the contents using standard http compression... But we need to send in the standard http headers that we are able yo handle the compression

    1)  how is it possible to add an http header  like "Accept-Encoding: gzip deflate"  to requests initiated by a WCF based proxy?

    2) how is it possible to detect the "Content-Encoding: gzip"  header and decode (unzip)  the message when receiving a reply from the server?


    • Edited by flalar Wednesday, November 5, 2008 4:26 PM
    Wednesday, November 5, 2008 4:04 PM

Answers

  • A good reference on how to setup the MS sample through code is provided here:

    http://www.vistax64.com/indigo/113763-wcf-client-j2ee-server-using-gzip.html 
    Lars
    • Marked as answer by flalar Tuesday, November 11, 2008 7:18 AM
    Tuesday, November 11, 2008 7:18 AM

All replies

  • Hi,

     Check out the GZIP Encoder Sample @ MSDN.

     --larsw

    Lars Wilhelmsen | Senior Consultant | Miles, Norway | MCTS WCF | http://www.sral.org/blogs/larsw/
    Wednesday, November 5, 2008 9:03 PM
  • Thanks for the reply Lars!

    Is it at all possible to configure this encoder through code utilizing  BasicHttpBinding? Have googled quite a bit for it but can not find anyone doing it that way...

    Lars
    • Edited by flalar Monday, November 10, 2008 8:13 PM clearification
    Monday, November 10, 2008 8:03 PM
  • A good reference on how to setup the MS sample through code is provided here:

    http://www.vistax64.com/indigo/113763-wcf-client-j2ee-server-using-gzip.html 
    Lars
    • Marked as answer by flalar Tuesday, November 11, 2008 7:18 AM
    Tuesday, November 11, 2008 7:18 AM