Working with the PayloadZipBean module of the XI Adapter Framework
The use of the PayloadZipBean is tricky. I will show you a scenario where an XI message goes to a receiver file adapter. Here the payload is converted to a flat structure and the codepage is changed to ISO-8859-1 and then zipped.
With using additional modules in the receiver file adapter, it is not possible to use the standard conversion. The conversion must be done in another module. You can choose between the conversion of the MessageTransformBean which is described here or the XML-to-Text Conversion Module. You find the description in SAP help.
For changing the encoding it is not possible to use the encoding parameters of the file adapter (this would corrupt the zip file) but you can use the new Text Codepage Conversion Module.
Here you see the configuration of the file receiver channel:
You see the file name scheme end with .zip and the file type is set to Binary.
Here you see the modules in the module chain:
Now you see the modules in the row as described above. But why is the MessageTransforBean here? What is its purpose?
In the file adapter configuration you can only choose the name of the zip file. So you need to set the name of the file inside the zip file with help of this module. In this example we choose the file name file.txt.
Note: If you want to set the file name dynamically, you have to implement an adapter module. In this WIKI page you find a sample code. You need SP20/SP12 for this.
Here is the result displayed with WinRAR:
The parameters of the PayloadZipBean
The module name is: AF_Modules/PayloadZipBean
- You define if you want to zip or unzip the payload. For zipping you can have: zip or zipOne for zipping the main payload, zipAll for zipping the main payload and all attachments together and unzip for unzipping the payload.
- You define how the files inside the zip file should be named. You can choose: payloadName, contentType, contentDescription, and contentDisposition. This parameter is not needed, when zip.mode is unzip.
Here is a list of other useful adapter modules: Wiki XI Adapter