webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Zip amp Unzip

  • 1.  Zip amp Unzip

    Posted Tue December 13, 2005 04:19 PM

    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.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Zip amp Unzip

    Posted Mon December 19, 2005 09:41 AM

    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

    Regards
    Pavan


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Zip amp Unzip

    Posted Mon December 19, 2005 04:57 PM

    Hi,
    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.

    Thanks


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: Zip amp Unzip

    Posted Mon December 19, 2005 07:10 PM

    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.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Zip amp Unzip

    Posted Tue December 20, 2005 07:09 PM

    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.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: Zip amp Unzip

    Posted Wed December 21, 2005 05:21 AM

    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

    Regards
    Pavan


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: Zip amp Unzip

    Posted Wed December 21, 2005 04:03 PM

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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: Zip amp Unzip

    Posted Thu December 22, 2005 04:40 AM

    Hi Rob

    i am sending my service and zip file.

    Regards
    Pavan

    service
    EXTAGILEUPGRADE.zip (10.4 k)

    Zip file
    TO00001.AXML (0.8 k)


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 9.  RE: Zip amp Unzip

    Posted Thu December 22, 2005 07:34 PM

    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 PSUtilities.zip:unzipFiles 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.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 10.  RE: Zip amp Unzip

    Posted Wed March 16, 2011 08:36 PM

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


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB