Zip amp Unzip

Rob Eamon uploaded a zip/unzip utility here on wmusers. Click the software link at the top this page and browse for it.

It’s called zip sample 2.1.

Also, I believe there is a sample for zipping/unzipping in either PSUtils or WmSamples.

Hi Ray

Thank you for your help.

In PSUtil package using unzip service i can unzip the file.But in this service get the zip file from one directory and after unzip put this file in one more directory.

But my project

Get this zip file via http(using pub.client.http), so how to map this http body to Unzip service input.

Plese help me


If the file is being to be posted to a folder ,you can use the file polling utility of IS.(Ports in IS Admin page).Pick the file from there and then unzip it.I hope that may help.


The zip utilities are written to work with files since the contents tend to be large. You might copy the PSUtilities service then modify the copy to accept a stream.

Retrieve the file using pub.client:http with loadAs set to stream. Pass the stream to your new unzip service and then you’ll have your raw content to process from there.

I don’t see anything explicitly wrong with the service (although the BufferedInputStream isn’t needed–just pass the ByteArrayInputStream instance directly to the ZipInputStream constructor) so I would check the http call. Are you setting loadAs to bytes? As you step through your service, does each step result in the proper output? For example, bytesToString should result in a readable string. Given that documentToRecord is the service that is failing, you’ll want to check each step leading up to that call to make sure all the inputs and outputs look right.

Hi Rob

After removing the BufferedInputStream it’s working with out errors but not getting the out put.

http call is working properly and also setting loadAs to bytes,but each step result is not getting proper output.
http-------- service is running properly
unzip—service is running properly and getting the out in bytes( like [B@72c796)
bytesToString—This service not getting the output.output String field is empty.

is there any problem in unzip java service ?

pls help me


Can you post your service and the sample file for troubleshooting?

Hi Rob

i am sending my service and zip file.


service (10.4 k)

Zip file
TO00001.AXML (0.8 k)

Sorry but I wasn’t thinking straight when replying to your e-mail with the modified Samples unzip service. You can’t use that. It works only with GZIP formats. The file you posted is not gzip.

To work with zip files, a bit more work is needed to properly process the file. You’ll need to use the as a template. If your retrieved file will always only contain one compressed file, then you can copy and modify unzipFiles to make that assumption (you might throw an exception if there is more than one) and return the uncompressed bytes of the first (and only) file entry in the zip.

Again, apologies for the wrong turn. Hopefully this will get you on the right path.

How do I password protect a zipped file and unzip a password protected file in webMethods?