Hello,
I would like to add gzip compression to my axis2 services on server-side and
can't find how to do this. Can someone help?
Here is what I tried:
1) Service code : I added the following code to my service in the
generated skeleton:
MessageContext messageContext =
MessageContext.getCurrentMessageContext();
messageContext.setProperty(HTTPConstants.MC_GZIP_RESPONSE,
Boolean.TRUE);
messageContext.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
2) Tomcat config : I also tried to modify the server.xml file as
follows:
<Connector
port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="2" maxSpareThreads="75"
enableLookups="false" redirectPort="8443"
acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true"
compression="on" compressionMinSize="1"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
/>
Even with this config, when I monitor requests and responses with Eclipse
TCP/IP Monitor I see no compression in the message content, and I don't see
the header Content-Encoding : gzip
Can you tell me if I forgot something?
Thanks in advance for your help,
Romain Larvet