You need to configure the receiver file/FTP adapter to save XML messages from the Integration Engine in files.
To configure the adapter you must specify the following:
The configuration of the receiver file/FTP adapter comprises five functional subareas:
Specify the class name as follows:
classname=com.sap.aii.messaging.adapter.ModuleXMB2FILE
This specification is mandatory.
version=30
This specification is mandatory. If no specification is entered, the configuration is interpreted as an XI 2.0 adapter configuration. Other values are not permitted and trigger an error.
Specify the mode of the receiver file/FTP adapter. The following values are permitted:
XMB2FILE
The system saves the document sent from the Integration Engine as a file.
XMB2FILEWITHCONVERSION
A text file is expected that contains an XML document that represents a table. This document can be converted to a text file that stores the contents of the document as a list, with elements separated by commas or with fixed column lengths. The expected XML format corresponds to the result of the conversion of the sender JDBC or file/FTP adapter. You must make the necessary specifications for the conversion in step 5.
XMBSTREAM2FILE
A special file format is generated here that represents a completely serialized Integration Engine message. This file format can be processed by the sender file/FTP adapter in the mode FILE2XMBSTREAM. This format can be used to temporarily save complete Integration Engine messages, including all Integration Engine-specific parameters that then no longer need to be specified in the sender file/FTP adapter.
XMB2FILE
The receiver file/FTP adapter provides you with a dispatcher that you can use to convert messages after they have been received. The settings required for the dispatcher are explained in the example .
<port_no>
<port_no>
<service>
<service> describes the service part of the address where the Integration Engine must send its messages.
These specifications are mandatory.
XI.httpPort=1234XI.httpService=/file/Receiver
http://<fileadapterhost>:1234/file/Receiver
The end point address must be extended as follows for the Integration Engine in Release 1.0:
http://<fileadapterhost>:1234/file/Receiver?action=execute&pipelineid=Receiver
If the Integration Engine message is sent to a non-specified adapter service, the system displays the following error message:
No registered listener for <Service> found
Die gleiche Fehlermeldung erhält man, wenn der Adapter initialisiert, aber nicht gestartet ist (sich also im Status ANGEHALTEN oder INITIALISIERTbefindet).
<Service>
This entry is optional.
<Service>
If no connection can be established with the SLD, or if the business system does not exist in the SLD, the specification is meaningless.
<n>
101
The following specifications are mandatory:
<directoryName>
Specify the target directory where incoming documents are to be saved. The system creates this directory automatically if you do not make any specifications for file.createDir.
<fileName>
Specify the file name where the system is to save the first incoming document.
Specify whether the system is to save all inbound documents under the file name that you specified in file.targetFilename. The following values are permitted:
overwrite
overwrite
This parameter is replaced by file.overWrite.
append
append
addTimeStamp
addTimestamp
This mode guarantees that no data is overwritten. In this way, files that originate from the same adapter configuration can simply be sorted according to the date that they entered processing
addMessageId
addMessageId
This mode guarantees that no data is overwritten.
addCounter
addCounterdefault002.file
addCounter
addCounter
SeparatorString>
SeparatorString
FormatString>
FormatString
000
StepNo>
1
Specify when a counter is to be added. The following values are permitted:
afterFirst
Only add the counter after the file name specified under file.targetFilename was used unaltered.
immediately
The counter is added after the first incoming document.
afterFirst
<default.file><default000.file><default001.file><default002.file>
If instead of the default values, you set the following explicit values
file.targetFilename=test.dat
file.counterMode=immediately
file.counterSeparator=_
file.counterFormat=00005
file.counterStep=2
then the file names test_00005.dat, test_00007.dat, and test_00009.dat etc. will be created.
This list is also continued once the adapter has been stopped and restarted, without overwriting existing files.
Define if a file with a file name that already exists in the target directory is to be overwritten. The default value is false which means an existing file in the target directory is overwritten. If you set the value to true, this existing file is not overwritten.
This parameter is optional.
The default value for binary data is the code page used by the Integration Server (that is, the data is saved without being changed). The default value for text data is the system code page of the Adapter Engine (that is, the text data coded by the Integration Server in UTF-8 is converted accordingly).
If file.encoding is specified and the Integration Server sends binary data, this is interpreted as text coded in UTF-8.
Permitted values for the code page are the existing Charsets of the Java runtime. According to the SUN specification for the Java runtime, at least the following standard character sets must be supported:
Java Runtime Character Sets
Character Set | Description |
---|---|
US-ASCII |
Seven-bit ASCII, also known as ISO646-US, or Basic Latin block of the Unicode character set |
ISO -8859-1 |
ISO character set for Western European languages (Latin Alphabet No. 1), also known as ISO-LATIN-1 |
UTF-8 |
8-bit Unicode character format |
UTF-16BE |
16-bit Unicode character format, big-endian byte order |
UTF-16LE |
16-bit Unicode character format, little-endian byte order |
UTF-16 |
16-bit Unicode character format , byte order |
Check which other character sets are supported in the documentation for your Java runtime implementation.
An operating system command specified here is executed after a file has been successfully processed. The default value is an empty character string (no command).
You can also enter the currently processed file name with the placeholder %f (file name) or %F (absolute filename including path) in the operating system command.
>
60
If the value is set to 0 or to a negative value, all management information is deleted each time the adapter is initialized. This can be useful for test purposes but must not be used for production operation.
If a message is received with the service attribute Exactly Once, a temporary file with the name of the adapter configuration is generated first in the target directory. This file is then automatically renamed during the Exactly Once handling. It must not be renamed or edited manually in any way, or deleted since this can lead to the message being lost.
If you want to save files on an FTP server and not in the file system, you need to make the following additional specifications:
addCounter
<ftp-server>
The host name or IP address of the FTP server. If this specification is made, it is assumed that you are accessing an FTP server. The specifications file.targetDir and file.targetFileName refer to the FTP server.
The port number of the FTP server. It is not obligatory that you specify the port number here. The default is the standard port for the FTP server (21).
user name>
password>
anonymousanonymous
perFileTransfer|permanently
permanently
Use this specification to define whether a transferred file is first created with a temporary name and only renamed once the transfer is complete (YES), or whether it is created with its final name at the start of the transfer (NO). The latter case can lead to problems if an application on the FTP server accesses the file before the transfer is complete. If you specify YES, this problem is avoided because the file only becomes visible with the search name when the transfer is complete.
The default value is NO.
XMB2FILEWITHCONVERSION
XMB2FILEWITHCONVERSION
FILE2XMBWITHROWCONVERSION
<resultset>
<row>
<column-name1>column-value</column-name1>
<column-name2>column-value</column-name2>
<column-name3>column-value</column-name3>
</row>
<row>
<column-name1>column-value</column-name1>
<column-name2>column-value</column-name2>
<column-name3>column-value</column-name3>
</row>
</resultset>
This is an example for 3 columns and 2 lines. The number of lines and columns is, of course, unlimited. The XML elements in italics can be defined by the user and the elements of a line must be grouped within an element of type <row>… </row>. Using the following specifications, the system constructs a text file from this XML document.
<n>
Specify whether the text file will have a header line with column names. The following values are permitted:
0
1
21
3
43
This specification is mandatory.
<headerLineString>
34
<String>
Specify a character string containing a list of fixed column widths that are separated by commas and determine the number and the length of columns generated in the text file.
If you do not make any specifications for xml.fieldSeparator, the specification xml.fieldFixedLengths is mandatory.
<handling>
Specify how you want the system to respond when column widths in the actual document exceed those defined in xml.fieldFixedLengths. The following values are permitted:
Error
Error
Cut
Cut
Ignore
Ignore
Error
If you do not specify xml.fieldFixedLengths, this specification is obsolete.
<SeparatorString>
If you specify a character string here, it is added as a separator to all columns except the last. You can also specify this string in addition to xml.fieldFixedLengths.
If you made no specification for xml.fieldFixedLengths, this is the only specification to identify the individual columns in a row.
If you made a specification for xml.fieldFixedLengths, the length of the separator is not taken into account.
You must specify at least either xml.fieldFixedLengths orxml.fieldSeparator.
If you have only specified xml.fieldSeparator, the structures of the XML document can have differing numbers of elements that are added to each other separately in the text file by the value from xml.fieldSeparator . If you specify xml.fieldFixedLenghts this is not possible since the number of columns is defined when the column widths are given.
<lastSeparatorString>
If you enter a character string here, the system adds it to the last column as a closing character. You can also make this specification in addition to xml.fieldFixedLengths. To include a line break following the closing character, you must explicitly define it by attaching ´nl´ (including the quotation marks) to the string.
The default value is a line break (no explicit separator after the last column; instead the structures are arranged line-by-line).
<firstSeparatorString>
If you specify a character string here, the system places it before the first column. You can also make this specification in addition to xml.fieldFixedLengths.
The default value is an empty character string (no separator before the first column).
Special Characters in the Strings for Separators:
0xHH´HH´nl´
Fixed Column Width of the Text Document
<noOfColumns>
<noOfColumns>
This value requires xml.addHeaderLine=0 to be specified.