gzip Overview

gzip (GNU zip) is a compression utility that uses algorithms to compress data. gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access, and modification times. GWS uses gzip to compress responses from the Web Services Gateway.

gzip Encoding

gzip encoding over an HTTP transport is a method for improving the performance of Web applications. High-traffic Web sites use gzip to make their user's experience faster, and compression is widely used to make files smaller for download and exchange.

You can enable gzip compression on the request, the response, both, or neither. The request for the type of gzip encoding is contained within the request HTTP header. This section details the handling of gzipped requests and responses in the following three language/framework combinations:

Requirements

You need:

Request/Response Format Header Languages

To gzip the request, set the GZipRequest property to true. To accept gzip compression in the response, specify “Accept-Encoding: gzip” in your header, and the GWS Response will send “Content-Encoding: gzip” in the response header.

The Web Services system requires all GWS customers to properly read the response HTTP header to determine if the message payload has been compressed or not. Failure to read this HTTP header may result in the inability for the client to read the response payload or can cause customer error responses.

In the response:

There is a potential for service interruption/failure for those customers that always expect the response to be compressed.  The compression has to meet a response size threshold before the server will compress the response.  If the response is small enough, the server will NOT compress the response.

Follow the HTTP1.1 specifications, look for the Content-Encoding Header in the response, and write your code to act accordingly. Either unzipping the content or process the raw content, and the content will display with no errors.

Click the appropriate link below.

Perl/SOAPLite

To enable the HTTP header request to accept gzip requests, encode the response for gzip compression on a Perl/SOAPLite system, and to accept gzip compression in the response:

Java/Axis

To enable the HTTP header request to accept gzip requests, encode the response for gzip compression on a Java/Axis system, and to accept gzip compression in the response:

C#/.NET

To enable the HTTP header request to accept gzip requests, encode the response for gzip compression on a C#/.NET system, and to accept gzip compression in the response: