How to Use gzip to compress messages in web services before send?

1.2k Views Asked by At

I know Java prog. langugage but, I am a complete beginner in Java EE and web services, soap etc. I need to compress a message before sending and add a signature to it with Apache wss4j. I followed tutorials in Netbeans website and created a web service and a web service client which consumes the corresponding service.(A number adding service and a client) I am reading the official Java EE documents but i couldn't understand and write something. I am searching for example codes and projects but coulndn't find related codes or understand which I found.

These are the ones I found:

But where to add these codes in my project. How to add signature and compress? Thanks, in advance.

1

There are 1 best solutions below

0
On

You can use GZip present in java.util.zip pkg.

java.util.zip.GZIPInputStream;
java.util.zip.GZIPOutputStream;

to zip and unzip you need to use org.apache.axis.encoding.Base64 to encode and decode.