on 10-27-2015 10:01 AM
Hi Experts,
I have to create a File to File interface using FTP adapter (Passthrough Interface)
Requirement : I need to create zip with name same as input file name.
Input file will have name like –SH_YYYYMMDD_HHMMSS.txt.
I need to achieve this functionality using the standard PayloadZipBean OR using Dynamic configuration (in dummy graphical mapping).
I have already gone through links which suggest solution of Adapter Module and Java Mapping but i want to do it using standard module or Dynamic Bean.
Please suggest how to proceed.
Regards
Rajat
Hi All,
This has been done using Dynamic Configuraton Bean,Payload Zip Bean and variable substitution in receiver channel.
Input file name abc.txt.
output File name abc.txt but zipped.
Thanks for your help and inputs.
Regards
Rajat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rajat,
If you want to use Java mapping solution
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try adding the parameter zip.filenameKey = contentType?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried creating a pass through scenario with 2 File channels.
Both file channels have ASMA ticked and module has been used in Receiver channel.
PFA screenshot.
When i place a file in source folder (.txt) with content as 1;2;3 then i am getting the same file at the target side with the same name.( not zip but .txt) and some junk content as :
PK ÚZ\G untitled.xml3´6²6 PK [¦ÄÙ PK ÚZ\G[¦ÄÙ untitled.xmlPK : A
Let me know what options can be used.
Regards
Rajat
Hi Rajat
The junk content you are seeing is actually the zip file. Try downloading the file to your PC and change the extension to .zip, then open it in WinZip/7Zip, and you will see that it is actually a compressed archive.
Do understand that file name and actual content are two different things here. PayloadZipBean just deals with the content and the name of the compressed item within the enclosing zip file.
If you want to change the name of the file that is written by the receiver adapter from .txt to .zip, unfortunately there is no standard solution for this that can handle dynamic filename values. If you insist on it being a pass through interface, then you need a custom module. You can consider the following.
Rgds
Eng Swee
When i am using ASMA at both sender and receiver side and using a dummy mapping in PI i am getting the .zip file with required name but it is a corrupted file.
UDF:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey keyFileName = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String keyval = conf.get(keyFileName);
String outfile = keyval.replaceAll(".txt",".zip");
conf.put(keyFileName,outfile);
return "";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try using Payload Zip Bean Module in your configuration.Please gothorugh below link:
Hi Sahithi,
Thanks for the prompt reply.
Case 1 : When i had xml data in a .txt file so it worked (with ZipBean) but the name of the file was MainDocument and i had to open it with notepad.
Case 2: When i add dummy data like 1234 it fails.
Please suggest solution for Case 2 as my file would have data like 1;2;3; in a .txt file.
Regards
Rajat
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.