Search code examples
androidwcf-data-servicesodata4j

WCF Data Service compression for an Android client


I use a WCF Data Services service that resides in a Windows Service program and get data with an Android phone using Odata4j. I get lots of data from it and I need to compress the data coming from the Data Service. I was thinking of GZip as a standard compressing algorythm and Android should have the necessary decoding methods.

Is it possible? I couldn't find the compression settings for my data service let alone the Android side of the decompression. What is the best way to accomplish this?


Solution

  • So here are my findings regarding to the compression problem.

    • With a WCF Data Service in a Windows Service, you cannot create compression because you cannot modify the output as there is no HTTPContext - it is a property of the ASP context that can be found only in IIS (Express)
    • You need an IIS for compressing the data - it is easy that way
    • Much to my astonishment, the compressed data could be read by odata4j without any modification
    • It is good to know that the decompressing of the incoming data takes notable time, comparable to the time gained by transferring less data

    See here for more information.