05-06-2011 12:12 PM
I have a wierd issue the using GZIP compression.
I download data from server using RESTful WCF services. The data is compressed by IIS with GZIP encoding.
I am using standard GZIP decompress module to decompress the data stream received from HTTP connection.
Now, If the application is connecting to the server using Direct TCP connection, GZIPInputStream reads data without any problem. But if the application is connecting to the server using MDS connection, it throws the IO Exceptin with Incorrect Header Check error message. I guess the BES server is decoding data before supplying to the device.
How do we work around with this problem?
05-06-2011 12:26 PM
Are you setting the "accept" header correctly for the request?
Should be something like this:
05-06-2011 12:33 PM
Well I am setting accept header as
Do I need the "deflate" in the property? My concern is, the problem only occurs if MDS connection.
05-06-2011 12:39 PM
OK, I found a work around - I am not sure if it is the correct solution!
Check the response header by using
and if the field contains the gzip then read the response using GZIP Stream otherwise use the standard Input Stream.
Any comments would be very much appriciated.
06-20-2011 03:39 PM
This excerpt seems to answer your question:
"Compress content resources using GZIP. The benefit is reduced if a user browses through the BlackBerry MDS ConnectionService or the BlackBerry® Internet Service Browsing network gateway. These network gateways will uncompress thecomponents before they reach the wireless network in order to preprocess them and repackage them more efficiently fortransmission. However, when content is accessed over WAP or Wi-Fi® connections, using GZIP will reduce network traffic.Using GZIP can also improve transmission over wired networks."