uCosminexus Service Platform, Reception and Adapter Definition Guide
This subsection describes how to define FTP adapters.
For the message format definition file of FTP adapters, use the schema provided by the service platform. Therefore, you need not create the message format definition file.
The contents of the message format used by FTP adapters are described here.
The storage location of the file is "Installation directory of the service platform\CSC\custom-adapter\FTP\schema".
The operation-wise request message format for FTP adapters is described here.
Table 3-46 Request message format (PUT operation)
| Tag name | Occurrence count#1 | Description | ||
|---|---|---|---|---|
| <request> | 1 time | - | ||
| <host-ipaddr> | 0 or 1 time | Specifies the IP address or the host name of the FTP server to be connected.
|
||
| <host-con-port> | 0 or 1 time | Specifies the port number for the control connection of FTP server.
|
||
| <file-name-charset> | 0 or 1 time | Specifies a tag that indicates the name of the character set to be used when sending and receiving information such as file names using the control connection between FTP servers. The specified value is either of the following values: UTF-8: Use "UTF-8" in the character set. MS932: Use "MS932" in the character set.
|
||
| <ftps> | 0 or 1 time | Specifies a tag indicating the settings related to FTPS. If the tag is not present, the value given in FTP adapter runtime-environment property file becomes valid for the entire setting related to FTPS. | ||
| <ftps-enable> | 0 or 1 time | Specifies a tag that indicates whether to use FTPS to connect to an FTP server. The specified value is either of the following values: true: Use FTPS to connect to an FTP server. false: Use normal FTP to connect to an FTP server.#2 When you use FTPS, the communication of control connection and data connection is encrypted. However, the destination FTP server must support the connection using FTPS. Even if you specify "true", when encryption of the communication of data connection is not set, the communication of data connection is also not encrypted.
|
||
| <ftps-protocol-name> | 0 or 1 time | Specifies a tag that indicates the protocol for security communication to be used, when using FTPS to connect to an FTP server. The specified value is either of the following values: TLS: Use TLS in the protocol for security communication. SSL: Use SSL in the protocol for security communication.
|
||
| <ftps-implicit-mode> | 0 or 1 time | Specifies a tag that indicates whether to use Implicit mode of FTPS, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Use Implicit mode. false: Use Explicit mode.#2
|
||
| <ftps-data-con-secure> | 0 or 1 time | Specifies a tag that indicates whether to encrypt the communication of data connection, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Encrypt the communication of data connection. false: Do not encrypt the communication of data connection.
|
||
| <ftps-server-authentication> | 0 or 1 time | Specifies a tag that indicates whether to perform server authentication, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Perform server authentication. false: Do not perform server authentication.
|
||
| <ftp-user>#3 | 0 or 1 time | Specifies a tag that indicates the login user name of the FTP server to be connected. Use it as an argument for USER command. The login user specified in this tag must have the permission to execute file operations. If this tag is set repetitively in the FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <ftp-acct>#3 | 0 or 1 time | Specifies a tag that indicates the billing information of the FTP server to be connected. If this tag is set repetitively in FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <ftp-type> | 0 or 1 time | Specifies a tag that indicates the data type to be transferred (transmission mode). Use this tag as an argument in TYPE command. If this tag is set repetitively in FTP adapter runtime-environment property file, the value given in the request message becomes valid. The specified value is either of the following values: A: Transfer the data in ASCII format. I: Transfer the data in binary format.
|
||
| <ftp-mode> | 0 or 1 time | Specifies a tag that indicates transfer mode (compression mode). Use this tag as an argument in MODE command. If this tag is set repetitively in FTP adapter runtime-environment property file, the value given in the request message becomes valid. The specified value is either of the following values: S: Transfer the file without compressing it. C: Compress the file and transfer it.
|
||
| <transfer-type> | 1 time | Specifies a tag that indicates the transfer type. Set either of the following values: STOR: Overwriting a file APPE: Adding information to a file
|
||
| <request-id> | 0 or 1 time | Specifies a tag that indicates the request ID created in FTP reception.
|
||
| <local-folder> | 1 time | Specifies a tag that indicates a local folder.
|
||
| <local-file-name> | 1 time | Specifies a tag that indicates the name of a local file. Specify a file, which is present just under the working folder or common folder. You can use a delimiting character such as slash (/) or back slash (\) only at the beginning of a file name. If you use a slash (/) at the beginning of a file name, slash (/) is ignored. Also, specify a file not having a symbolic link.
|
||
| <remote-path>#5 | 1 time | Specifies a tag that indicates the remote path name (name of the destination path at the time of transferring to FTP server).
|
||
| <ftp-commands-before> | 0 or 1 time | Specifies a tag that indicates the FTP command and its argument to be executed prior to file transfer.#6 When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;), and then and set. (Example: MKD transdir;CWD transdir).
|
||
| <ftp-commands-after> | 0 or 1 time | Specifies a tag that indicates the FTP command and its argument to be executed after file transfer.#6 When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;) and set them (Example: RNFR oldfile.txt;RNTO newfile.txt).
|
||
Table 3-47 Request message format (GET operation)
| Tag name | Occurrence count#1 | Description | ||
|---|---|---|---|---|
| <request> | 1 time | - | ||
| <host-ipaddr> | 0 or 1 time | Specifies the IP address or the host name of the FTP server to be connected.
|
||
| <host-con-port> | 0 or 1 time | Specifies the port number for control connection of the FTP server.
|
||
| <file-name-charset> | 0 or 1 time | Specifies a tag that indicates the name of the character set to be used when sending and receiving information such as file name using control connection with the FTP server. The specified value is either of the following values: UTF-8: Use "UTF-8" in the character set. MS932: Use "MS932" in the character set.
|
||
| <ftps> | 0 or 1 time | Specifies a tag that indicates the settings related to FTPS. If the tag is not present, the value given in FTP adapter runtime-environment property file becomes valid for all settings related to FTPS. | ||
| <ftps-enable> | 0 or 1 time | Specifies a tag that indicates whether to use FTPS to connect to an FTP server. The specified value is either of the following values: true: Use FTPS to connect to an FTP server. false: Use a normal FTP to connect to an FTP server.#2 When using FTPS, the communication of control connection and data connection is encrypted. However, the destination FTP server must support the connection done by FTPS. Even if you specify "true", when the encryption of communication of data connection is not set, even the communication of data connection is not encrypted.
|
||
| <ftps-protocol-name> | 0 or 1 time | Specifies a tag that indicates the protocol for security communication to be used, when using FTPS to connect to an FTP server. The specified value is either of the following values: TLS: Use TLS in the protocol for security communication. SSL: Use SSL in the protocol for security communication.
|
||
| <ftps-implicit-mode> | 0 or 1 time | Specifies a tag that indicates whether to use Implicit mode of FTPS, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Use Implicit mode. false: Use Explicit mode.#2
|
||
| <ftps-data-con-secure> | 0 or 1 time | Specifies a tag that indicates whether to encrypt the communication of data connection, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Encrypt the communication of data connection. false: Do not encrypt the communication of data connection.
|
||
| <ftps-server-authentication> | 0 or 1 time | Specifies a tag that indicates whether to perform server authentication, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Perform server authentication. false: Do not perform server authentication.
|
||
| <ftp-user>#3 | 0 or 1 time | Specifies a tag that indicates the login user name of FTP server to be connected. Use it as an argument of USER command. The login user specified in this tag must have permission to execute file operations. If this tag is set repetitively in FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <ftp-acct>#3 | 0 or 1 time | Specifies a tag that indicates the billing information of the FTP server to be connected. If this tag is set repetitively in FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <ftp-type> | 0 or 1 time | Specifies a tag that indicates the data type to be transferred (transmission mode). Use this tag as an argument in TYPE command. If this tag is set repetitively in FTP adapter runtime-environment property file, the value given in the request message becomes valid. The specified value is either of the following values: A: Transfer the data in ASCII format. I: Transfer the data in binary format.
|
||
| <ftp-mode> | 0 or 1 time | Specifies a tag that indicates the transfer mode (compression mode). Use this tag as an argument in the MODE command. If this tag is set repetitively in FTP adapter runtime-environment property file, the value given in the request message becomes valid. The specified value is either of the following values: S: Transfer the file without compressing it. C: Compress the file and transfer it.
|
||
| <request-id> | 0 or 1 time | Specifies a tag that indicates the request ID created in FTP reception.
|
||
| <local-folder> | 1 time | Specifies a tag that indicates a local folder.
|
||
| <local-file-name> | 1 time | Specifies a tag that indicates name of a local file.
|
||
| <remote-path>#5 | 1 time | Specifies a tag that indicates the remote path name (name of the destination path at the time of transferring to the FTP server).
|
||
| <ftp-commands-before>#6 | 0 or 1 time | Specifies a tag that indicates the FTP command and its argument to be executed prior to file transfer. When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;) and set them. (Example: MKD transdir;CWD transdir)
|
||
| <ftp-commands-after>#6 | 0 or 1 time | Specifies a tag that indicates the FTP command and its argument to be executed after file transfer. When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;) and set them. (Example: RNFR oldfile.txt;RNTO newfile.txt)
|
||
GETINFO operation
The following table describes the request message format of GETINFO operation, which a business process passes on to an FTP adapter. The file name is "ftpadp_getinfo_request.xsd". The name of the name space is "http://www.hitachi.co.jp/soft/xml/cosminexus/csaftp/getinfo_request".
Table 3-48 Request message format (GETINFO operation)
| Tag name | Occurrence count #1 | Description | ||
|---|---|---|---|---|
| <request> | 1 time | - | ||
| <host-ipaddr> | 0 or 1 time | Specifies the IP address or the host name of the FTP server to be connected.
|
||
| <host-con-port> | 0 or 1 time | Specifies the port number for the control connection of FTP server.
|
||
| <file-name-charset> | 0 or 1 time | Specifies a tag that indicates the name of the character set to be used when sending and receiving the following information using the control connection between FTP servers.
UTF-8: Use "UTF-8" in the character set. MS932: Use "MS932" in the character set.
|
||
| <ftps> | 0 or 1 time | Specifies a tag that indicates the settings related to FTPS. If the tag is not present, the value given in FTP adapter runtime-environment property file becomes valid for all the settings related to FTPS. | ||
| <ftps-enable> | 0 or 1 time | Specifies a tag that indicates whether to use FTPS to connect to an FTP server. The specified value is either of the following values: true: Use FTPS to connect to an FTP server. false: Use normal FTP to connect to an FTP server.#2 When you use FTPS, the communication of control connection and data connection is encrypted. However, the connection destination FTP server must support the connection using FTPS. Even if you specify "true", when encryption of communication of data connection is not set, communication of data connection is also not encrypted.
|
||
| <ftps-protocol-name> | 0 or 1 time | Specifies a tag that indicates the protocol for security communication to be used, when using FTPS to connect to an FTP server. The specified value is either of the following values: TLS: Use TLS in the protocol for security communication. SSL: Use SSL in the protocol for security communication.
|
||
| <ftps-implicit-mode> | 0 or 1 time | Specifies a tag that indicates whether to use Implicit mode of FTPS, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Use Implicit mode. false: Use Explicit mode.#2
|
||
| <ftps-data-con-secure> | 0 or 1 time | Specifies a tag that indicates whether to encrypt the communication of data connection, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Encrypt the communication of data connection. false: Do not encrypt the communication of data connection.
|
||
| <ftps-server-authentication> | 0 or 1 time | Specifies a tag that indicates whether to perform server authentication, when using FTPS to connect to an FTP server. The specified value is either of the following values: true: Perform server authentication. false: Do not perform server authentication.
|
||
| <ftp-user>#3 | 0 or 1 time | Specifies a tag that indicates the login user name of the FTP server to be connected. Use it as an argument for USER command. The login user specified in this tag must have permission to execute file operations. If this tag is set repetitively in FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <ftp-acct>#3 | 0 or 1 time | Specifies a tag that indicates the billing information of the FTP server to be connected. If this tag is set repetitively in FTP adapter runtime-environment property file, the value of a request message becomes valid.
|
||
| <getinfo-type> | 1 time | Specifies a tag that indicates the acquisition type of the information acquired from the FTP server to be connected. Either of the following values is the setup value: LIST: Execute LIST command and acquire the list of file information. NLST: Execute NLST command and acquire the list of file names.
|
||
| <getinfo-option> | 0 or 1 time | Specifies a tag that indicates the acquisition option for the information acquired from the FTP server to be connected. This option is to be specified when executing the command specified in <getinfo-type>.
|
||
| <getinfo-path> | 0 or 1 time | Specifies a tag that indicates the acquisition path of the information acquired from the FTP server to be connected. This path is to be specified when executing the command specified in <getinfo-type>.
|
||
| <request-id> | 0 or 1 time | Specifies a tag that indicates the request ID created in FTP reception.#5
|
||
| <local-folder> | 0 or 1 time | Specifies a tag that indicates a local folder.#5
|
||
| <local-file-name> | 0 or 1 time | Specifies a tag that indicates the name of a local file.#5
|
||
| <ftp-commands-before>#4 | 0 or 1 time | Specifies a tag that indicates the FTP command and its arguments to be executed before executing the list command. When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;) and set them (Example: MKD transdir;CWD transdir).
|
||
| <ftp-commands-after>#4 | 0 or 1 time | Specifies a tag that indicates the FTP command and its arguments to be executed after executing the list command. When executing multiple commands, separate the commands in the sequence in which they will be executed using a semicolon (;) ,and set them (Example: RNFR oldfile.txt;RNTO newfile.txt).
|
||
Table 3-49 Response message format (PUT operation)
| Tag name | Occurrence count | Description | ||
|---|---|---|---|---|
| <response> | 1 time | - | ||
| <local-folder> | 1 time | Specifies a tag that indicates a local folder. If you use a working folder, "common="false"" is set in the attribute. Null is set in the value. If you use a common folder, "common="true"" is set in the attribute. The name of the common folder definition specified in the <local-folder> tag of a request message is set in the value. |
||
| <local-file-name> | 1 time | Specifies a tag that indicates name of the local file. The value specified in <local-file-name> of a request message is set. |
||
| <command-info> | More than 1 time | - | ||
| <command> | 1 time | Specifies a tag that indicates the command executed by an FTP adapter. #1 All the FTP commands, which are executed are output. |
||
| <command-message> | More than 1 time | Specifies a tag that indicates display message of the command executed by an FTP adapter.#2 The message of the FTP command consists of FTP response code and a message. In case of a message having multiple lines, if the response code of these lines is same, 1 tag is generated. In case of FTP response code of multiple types, multiple tags are generated. |
||
Table 3-50 Response message format (GET operation)
| Tag name | Occurrence count | Description | ||
|---|---|---|---|---|
| <response> | 1 time | - | ||
| <local-folder> | 1 time | Specifies a tag that indicates a local folder. If you use a working folder, "common="false"" is set in the attribute. Null is set in the value. If you use a common folder, "common="true"" is set in the attribute. The name of the common folder definition specified in the <local-folder> tag of a request message is set in the value. |
||
| <local-file-name> | 1 time | Specifies a tag that indicates name of a local file.
|
||
| <file-size> | 1 time | Specifies a tag that indicates the size of the remote file, which is sent and received. Size of the local file acquired from an FTP server is set. |
||
| <command-info> | More than 1 time | - | ||
| <command> | 1 time | Specifies a tag that indicates the FTP command executed by an FTP adapter.#1 All the FTP commands, which are executed are output. |
||
| <command-message> | More than 1 time | Specifies a tag that indicates the display message of the command executed by an FTP adapter .#2 The message of the FTP command consists of the FTP response code and a message. In case of a message having multiple lines, if the response code of these lines is same, 1 tag is generated. In case of the FTP response code of multiple types, multiple tags are generated. |
||
Table 3-51 Response message format (GETINFO operation)
| Tag name | Occurrence count | Description | ||
|---|---|---|---|---|
| <response> | 1 time | - | ||
| <local-folder> | 0 or 1 time | Specifies a tag that indicates a local folder. This tag appears when the output is to be generated in a common folder. This tag does not appear when the output is to be generated in a working folder or a response message.
|
||
| <local-file-name> | 0 or 1 time | Specifies a tag that indicates the name of a local file. This tag appears, when the output is to be generated in a working folder or common folder. This tag does not appear, when the output is to be generated in a response message.
|
||
| <reply-code> | 1 time | Specifies a tag that indicates reply code of the LIST command or the NLST command. When you execute LIST command or NLST command, either of the following values is set as the reply code which is sent at the end by FTP server:
|
||
| <reply-message> | 1 time | Specifies a tag that indicates the reply message of the LIST command or the NLST command. When you execute the LIST command or the NLST command, the reply message which is sent at the end is set by the FTP server. |
||
| <command-info> | More than 1 time | - | ||
| <command> | 1 time | Specifies a tag that indicates an FTP command executed by an FTP adapter. #1 All the FTP commands, which are executed are output. |
||
| <command-message> | More than 1 time | Specifies a tag that indicates a display message of the command executed by an FTP adapter.#2 The message of the FTP command consists of FTP response code and a message. In case of a message having multiple lines, if the response code of these lines is same, 1 tag is generated. In case of the FTP response code of multiple types, multiple tags are generated. |
||
| <list-info> | 0 or 1 time | Appears when the output is to be generated in a response message.#3 | ||
| <list> | More than 0 | Appears when the output is to be generated in a response message.#3 | ||
Table 3-52 Output format of the commands executed by an FTP adapter and examples of output
| Item | FTP command | Output format | Example of output | Remarks |
|---|---|---|---|---|
| 1 | (Connection process) | Connected to <xxxxx>. | Connected to 10.208.180.254. | <xxxxx> is the IP address of the FTP server or the host name. |
| 2 | USER | USER <user name> | USER user1 | - |
| 3 | PASS | PASS ******** | PASS ******** | The password is displayed with 8 * symbols. |
| 4 | ACCT | ACCT <Billing information> | ACCT acct1 | - |
| 5 | TYPE | TYPE <format option> | TYPE A | Either "A" or "I" is displayed in <format option>. |
| 6 | MODE | MODE <transfer mode option> | MODE S | Either "S" or "C" is displayed in <transfer mode option>. |
| 7 | PASV | PASV | PASV | - |
| 8 | PORT | PORT <aaa>,<bbb>,<ccc>,<ddd>,<mmm>,<nnn> | PORT 10,208,182,27,14,160 | <aaa>,<bbb>,<ccc>,<ddd> is the local IP address. <mmm>,<nnn> is the port number. The local data connection port number appears in the format of 256*mmm+nnn. |
| 9 | SITE | SITE FSIZE [<file size>] | SITE FSIZE 4096 | For GET operation, <file size> is not output. Also, for PUT operation, size of the file present in the transfer path of the source file is output to <file size>. |
| 10 | Command prior to transfer or command prior to list | <command name> [<command argument>] | CWD ./workdir | - |
| 11 | STOR | STOR <path name> | STOR work/fileA.txt | - |
| 12 | APPE | APPE <path name> | APPE work/fileA.txt | - |
| 13 | RETR | RETR <path name> | RETR fileA.txt | - |
| 14 | LIST | LIST [<option>] [<path name>] | LIST -l work | - |
| 15 | NLST | NLST [<option>] [<path name>] | NLST -l work | - |
| 16 | Command after transfer or command after list | <command name> [<command argument>] | RNFR fileA.txt RNTO fileB.txt |
- |
| 17 | QUIT | QUIT | QUIT | - |
Table 3-53 Message format of FTP commands and examples of output
| Condition | Message format | Example of output |
|---|---|---|
| Single response code | <FTP response code> <message> | 226 File receive OK. |
| <FTP response code>-<message 1> [<message 2>] : <FTP response code> <message n#> |
214-The following commands are recognized. ACCT ALLO APPE CDUP ... MDTM MKD NLST NOOP OPTS PASS ... RMD RNFR 214 Help OK. |
|
| Multiple response code | <FTP response code 1> <message 1> <FTP response code 2> <message 2> |
150 File status okay; about to open data connection. 226 Transfer complete. |
The following table describes the tags which must be specified in a request message, and the tags which appear in a response message, when you want to output the result of the LIST command or the NLIST command to a response message, a working folder, and a common folder.
For details on the setup contents of each tag and the tags which are not described in the table, see (a) Request message format for FTP adapters and (b) Response message format for FTP adapters.
Table 3-54 Relation between an output destination and a request message
| Output destination | Tag to be specified in a request message | ||
|---|---|---|---|
| <request-id> | <local-folder> | <local-file-name> | |
| Response message | - | - | - |
| Working folder | Y | Y | - |
| Common folder | - | Y | Y |
Table 3-55 Relation between an output destination and a response message
| Output destination | Tag to be specified in a response message | |||
|---|---|---|---|---|
| <local-folder> | <local-file-name> | <list-info> | <list> | |
| Response message | - | - | Y | Y |
| Working folder | - | Y | - | - |
| Common folder | Y | Y | - | - |
Types of the definition file to be created are as follows:
The following is the procedure for creating each definition file. You can create a definition file using the template file provided by the FTP adapter.
Define data transformation of the message format definition file of transformation source and the message format definition file of the transformation destination using the data transformation definition screen.
For details on how to define data transformation, see 6. Defining Data Transformation in the manual Service Platform Basic Development Guide.
The procedure for defining FTP adapters is as follows:
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.