Apache Axis2 Web服务:Gzip resquet和响应

时间:2021-10-30 13:38:34

I am developed a web service that return simple string using axis2 . But i want to apply gzip compression techniques , in my web service. can anyboby give me server code and client code for it. I developed web service from this reference http://blog.sencide.com/2011/06/create-web-service-using-apache-axis2.html Please provide proper guidance.

我开发了一个使用axis2返回简单字符串的Web服务。但我想在我的网络服务中应用gzip压缩技术。 anyboby可以给我服务器代码和客户端代码。我从此参考资料开发了Web服务http://blog.sencide.com/2011/06/create-web-service-using-apache-axis2.html请提供正确的指导。

Thanx

1 个解决方案

#1


0  

Are you trying to do the Zip yourself, or just trying to compress the bits as they travel through the wire?

你是想自己做拉链,还是只是在穿过电线时试图压缩它们?

If you just want to compress the responses from your server, I know Apache has several ways of doing it. I would suggest looking here as a start.

如果您只想压缩服务器的响应,我知道Apache有几种方法可以做到这一点。我建议把这看作一个开始。

If you are trying to create your own zip file, which you are sending in the response of your WS, and the client is expecting a zip file, then you want to look at java.util.zip. It provides several classes that read/write various ZIP formats. I would look at GZipOutputStream. It appears to work like any other OutputStream, allowing you to write out some byte[] array.

如果您正在尝试创建自己的zip文件(您在WS的响应中发送,并且客户端需要zip文件),那么您需要查看java.util.zip。它提供了几个读/写各种ZIP格式的类。我会看看GZipOutputStream。它似乎像任何其他OutputStream一样工作,允许你写出一些byte []数组。

#1


0  

Are you trying to do the Zip yourself, or just trying to compress the bits as they travel through the wire?

你是想自己做拉链,还是只是在穿过电线时试图压缩它们?

If you just want to compress the responses from your server, I know Apache has several ways of doing it. I would suggest looking here as a start.

如果您只想压缩服务器的响应,我知道Apache有几种方法可以做到这一点。我建议把这看作一个开始。

If you are trying to create your own zip file, which you are sending in the response of your WS, and the client is expecting a zip file, then you want to look at java.util.zip. It provides several classes that read/write various ZIP formats. I would look at GZipOutputStream. It appears to work like any other OutputStream, allowing you to write out some byte[] array.

如果您正在尝试创建自己的zip文件(您在WS的响应中发送,并且客户端需要zip文件),那么您需要查看java.util.zip。它提供了几个读/写各种ZIP格式的类。我会看看GZipOutputStream。它似乎像任何其他OutputStream一样工作,允许你写出一些byte []数组。