cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip the file archived by the File adapter

Former Member
0 Kudos

Hi Experts,

we have a scenario where we are archiving a xml file using the File adapter and also it is being zipped by the OS command.

the script not only zips the file, it also rename the file from *.zip to *.xml.

Hence after archiving when I am trying to open it, the content appears to be junk.

Please suggest how to unzip the file as it got a extension *.xml.

And I also tried renaming the file to *.zip and then to uncompress, but it shows below error

Cannot open : it does not appear to be a valid archive

Thanks in advance,

MK

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi Mk,

instead of using OS command try using the exesting module provided by the SAP, so your job will be easy.

follow this steps in the module processing for UN ZIP

Processing sequence:

Module name: AF_Modules/PayloadZipBean

Type: Local Enterprise Bean

Module key: 3

u2022 Module configuration:

Module key: 3

Parameter name: zip.mode

Parameter value: unzip.

in the commincation channel specify filename.xml

so you can open the file in XML format

Thanks,

Madhav

Note:points if useful

Edited by: madhav poosarla on Aug 14, 2008 8:31 AM

ravi_raman2
Active Contributor
0 Kudos

MK...........

This is what i would suggest........

1) dont rename the file and try to open it.....if that works then ur zipping is good......and renaming is bad......If that doesent work....you might want to investigate ur os zipping command..........

Regards

Ravi Raman

Former Member
0 Kudos

Hi Mk,

Are you exactly trying to zipping the files?

Then please follow these steps:

In Receiver communication channel Module tab please specify the following details:

Module Name: AF_Modules/PayloadZipBean

Parameter Name: zip.Mode

Parameter Value: zipAll

And in the File Name Scheme: .zip file

Call the PayloadZipBean module after the CallSapAdapter module.

I hope this will be helpful

Regards,

Nutan

Former Member
0 Kudos

HI M.K,

If your OS command is executed before the message processing in receiver File adapter you can use modules to change the extention from .xml to .zip.

If your OS command is executed after the message processing you have to search for some other options.

If this renaming part is going to happen in sender side then you can use Modules Message Transform Bean, PayloadSwapBean to change the extention of the files.

Best Regards

Praveen

Former Member
0 Kudos

Sorry Praveen, I am just trying to read the file contents from the Archive directory.

As the file is been zipped and the extention got changed from *.zip to *.xml, I am just wondering how can unzip it and open the file contents.

Appreciate your help.

Thanks,

MK

Former Member
0 Kudos

Dear M.K.

As per your clarification I could understand that you are picking up a file that has extention .xml ( renamed from .rar)through sender File adapter.

as per file adapter is concerned you have to provide a valid file extention that XI can process. If your File is not proper then try to use OS command to execute before files to be processed to make them readable by XI.

Plz correct me if my understanding of your issue is wrong.

Best Regards

Praveen

Former Member
0 Kudos

Hi MK,

It sounds like corrupted zip file.

How you are transferring a file? FTP?

- Pinkle

Former Member
0 Kudos

Pinkle,

Yes, we are using FTP.

Is the issue due to the renaming the file from *.zip to *.xml ?

Please suggest further.

Thanks,

MK

Former Member
0 Kudos

Hi MK,

If it is ftp then try changing transfer mode (BIN/ASC).

- Pinkle

Former Member
0 Kudos

Pinkle,

I already tried doing so, it does not helps.

please suggest further to resolve the issue.,

Thanks,

MK