How to use Gzip compression with Axis ?

Client Side

On the client side, you need to use the CommonsHTTPSender (instead of the default HTTPSender ) and you have to set to true the properties HTTPConstants.MC_GZIP_REQUEST and HTTPConstants.MC_ACCEPT_GZIP to respectively compress the request and tell the server it can compress the response

(!) If you get in your client an exception org.xml.sax.SAXParseException: Content is not allowed in prolog., it means that you activated the compression of the request when the server does not support it. You should then enable server side support of request compression or disable client side compression of the request (removing binding._setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);)

Server Side

Further readings

FrontPage/Axis/GzipCompression (last edited 2009-09-20 22:49:05 by localhost)