Using the FTP Binding Component in a Project

Runtime Configuration

The runtime configuration for FTP Binding Component is as follows:

  1. FTP Operation Element (<ftp:operation>)

  2. FTP Binding Element (<ftp:binding>)

  3. FTP Transfer Element (<ftp:transfer>)

  4. FTP Address Element (<ftp:address>)

  5. FTP Message Element (<ftp:message>)

FTP Operation Element (<ftp:operation>)

FTP operation indicates a ftp protocol based operation.

ftp operation

FTP Binding Element (<ftp:binding>)

FTP binding indicates a ftp protocol based binding.

ftp binding

FTP Transfer Element (<ftp:transfer>)

The FTP transfer element extends the WSDL binding element to allow you to specify a message transfer from a sender and a receiver's perspective. Typical reasons to use the FTP transfer element include the following:

FTP TransferTable 6 FTP Transfer Element

Attribute Name 

Description 

sendTo 

The FTP PUT target for the message. 

Specify the target using either a relative path or absolute path form: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

    patterN and filename can be literal or a pattern, depending on the value of the sendToHasPatterns property.

For more information, see Table 7.

append 

Specifies whether the message is appended to the target file specified by the sendTo property.

  • If append is true, the message is appended to the target file.

  • If append is false, then the message overwrites the target file.

Default value: false

sendToHasPatterns 

Specifies if the target specified by the sendTo property contains patterns in its path components and/or file name.

If sendToHasPatterns is false, then the target path and filename are literals.

Default value: false

For more information, see Table 7.

receiveFrom 

The target to poll for FTP GET messages. 

Specify the target using either a relative path or absolute path form: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

    patterN and filename can be literal or a regular expression, depending on the value of the receiveFromHasRegexs property.

For more information, see Table 7.

receiveFromHasRegexs 

Specifies if the target specified by the receiveFrom property contains regular expressions in its path components and/or file name.

If receiveFromHasRegexs is false, then the target path and filename are literals.

Default value: false

pollIntervalMillis 

The interval (in milliseconds) for an inbound component (receiver) to poll the target. 

Default value: 5000

preSendCommand 

Specifies the operation to perform before sending an FTP message. 

Values can be NONE, COPY, or RENAME 

Default value: NONE 

preSendLocation 

The destination file to be used with the preSendCommand.

Specify the file using either a relative path or absolute path: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

patterN and filename can be literal or a pattern, depending on the value of the preSendLocationHasPatterns property.

For more information, see Table 7.

preSendLocationHasPatterns 

Specifies if the file specified by the preSendLocation property contains patterns in its path components and/or file name.

If preSendLocationHasPatterns is false, then the target path and filename are literals.

Default value: false

postSendCommand 

Specifies the operation to perform after sending a message. 

The value can be either NONE or RENAME. 

Default value: NONE 

postSendLocation 

The destination file for the postSendCommand.

Specify the file using either a relative path or absolute path: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

patterN and filename can be literal or a pattern, depending on the value of the postSendLocationHasPatterns property.

For more information, see Table 7.

preReceiveCommand 

Specifies the operation to perform before receiving an FTP message. 

Values can be either NONE, COPY, RENAME 

Default value: NONE 

preReceiveLocation 

The destination file to be used with the preReceiveCommand.

Specify the file using either a relative path or absolute path: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

patterN and filename can be literal or a pattern, depending on the value of the preReceiveLocationHasPatterns property.

For more information, see Table 7.

preReceiveLocationHasPatterns 

Specifies if the file specified by the preReceiveLocation property contains patterns in its path components and/or file name.

If preReceiveLocationHasPatterns is false, then the target path and filename are literals.

Default value: false

postReceiveCommand 

Specifies the operation to perform after receiving an FTP message. Values can be either NONE, DELETE, or RENAME. 

Default value: NONE 

postReceiveLocation 

The destination file to be used with the preReceiveCommand.

Specify the file using either a relative path or absolute path: 

  • relative path

    pattern1/pattern2/. . ./filename

  • absolute path

    /pattern1/pattern2/. . ./filename

patterN and filename can be literal or a pattern, depending on the value of the preReceiveLocationHasPatterns property.

For more information, see Table 7.

postReceiveLocationHasPatterns 

Specifies if the file specified by the preReceiveLocation property contains patterns in its path components and/or file name.

If preReceiveLocationHasPatterns is false, then the target path and filename are literals.

Default value: false

senderUsePassive 

Specifies whether to use passive FTP on the sender side. 

Default value: true

ReceiverUsePassive 

Specifies whether to use passive FTP on the receiver side. 

Default value: true

use 

Specifies whether a message (or message part) is literal or encoded. 

If encoded is specified, then you must also specify the encoder using the encodingStyle property.

Default value: Literal

encodingStyle 

Specifies the encoding type associated with the message (or message part). This also defines the encoder type responsible to process the encoded data. 

There is no default value: ud1encoder-1.0  

part 

References which part of the message described in the abstract WSDL to use for the message. 

It is Part1.

If the part property is not specified, then the first part listed in the abstract WSDL is used.

messageCorrelate 

Specifies whether UUID tagging-based message correlation is enabled. 

If true, then the message correlation is enabled. Otherwise, message correlation is not enabled. 

Default value: false

Pattern Matching

You can use pattern matching to generate filenames for messages and to retrieve messages according to the generated filename patterns. The following message properties make use of pattern matching:

The % character precedes a character that indicates the pattern to be expanded.

For example, %y%y%y%y expands to 2007

Use an additional % as an escape character to print the % character as a literal.

For example, %%y%%y%%y%%y expands to %y%y%y%y

The table describes various Pattern Matching for FTP Binding Component Message Transfer Targets

Table 7 Pattern Matching for FTP Binding Component Message Transfer Targets

Pattern Type 

Description 

Timestamp 

The FTP Binding Component specifies a timestamp using the simple Java date/time formats: 

%[GyMdhHmsSEDFwWakKz] 

For example, abc%y%y%y%y expands to abc2007  

For more information, see Table 4.

Directory and Filename Replacement 

%p/%f

Typically used to specify the directory name and filename for pre-transfer and post-transfer operations. 

For example, if sendTo specifies my_in_box/invoice.dat, then the following pattern:

%p_backup/%f.bak

Expands to:

my_in_box_backup/invoice.dat.bak

UUID 

%u

Inserts a UUID value compliant with Java 1.5 UUID. 

Sequence Numbering 

%0, %1, ... , %9

Inserts the current value of a sequence counter that is incremented after each reference. The initial value of a sequence counter is 0. There can be as many as ten sequence counters at runtime, identified as %0 through %9. 

The sequence counters are not persisted and will be reset to 0 after either of the following occurrences: 

  • The application server restarts.

  • The FTP Binding Component is redeployed.

FTP Address Element (<ftp:address>)

The FTP address element extends the WSDL service element to allow you to specify the connectivity information to an FTP server. You can specify properties such as the Internet address of the FTP server, style for listing directories, the mode of transfer (for example, binary, ASCII, or EBCDIC), and timeout settings for connecting to the FTP server.

ftp addressTable 8 FTP Address Element

Attribute Name 

Description 

url 

The address of the FTP host. This address must be in the following format:  

ftp://[user]:[password]@[hostname or IP address]:[port]

  • user is the FTP account login

  • password is the password for the account

  • hostname is the hostname for where the FTP server is running

  • IP address is the IP address for the ftp host

  • port is the FTP port (default is 21)

Default value: ftp://anonymous:user\@yahoo.com@localhost:21

user 

FTP login ID — user ID 

Enter the user ID in ftp:url

password 

FTP login password 

Enter the password. 

dirListStyle 

Specifies which style to use for listing directories. Choose a style from the list. 


Note –

The style you select should match the platform for the target FTP host to make sure FTP operations and pattern matching specifications.


Default value: UNIX 

useUserDefinedHeuristics: 

Indicates whether to use a user-defined style for listing directories. 

If the property is set to true, then you must specify a style using the userDefDirListStyle property.

Default value: false

userDefDirListStyle  

Names the user-defined directory listing style, which should correspond to the style defined by the property userDefDirListHeuristics

userDefDirListHeuristics  

Path pointing to a user provided heuristics file. 

This file should be accessible to the FTP Binding Component runtime in the deployed environment. 

enabledCCC 

Enable Clear Command Channel after handshake, only applicable when securedFTP - 'ExplicitSSL' 

keyStore 

Key store location 

keyStorePassword 

Key store password 

keyAlias 

Key alias for client authentication 

keyPassword 

Password protecting the key alias 

trustStore 

Trust store location 

trustStorePassword 

Trust store password 

mode 

Specifies whether the transfer is binary, ASCII, or EBCDIC. 

Default value: binary

controlChannelencoding 

Encoding (Charset) for FTP control channel IO. Default is ISO-8859-1. When left blank the default is assumed. 

cmdChannelTimeout 

Time, in milliseconds, to attempt reading the socket for the FTP command channel before a timeout occurs. 

0 indicates no timeout. 

Default value: 45000

dataChannelTimeout 

Time, in milliseconds, to attempt reading the socket for the FTP data channel before a timeout occurs. 

0 indicates no timeout. 

Default value: 45000

FTP Message Element (<ftp:message>)

The FTP message element extends the WSDL binding element to allow you to specify message transfer details. These details include the locations on an FTP server on which a message is persisted, staged, retrieved, and archived.

ftp messageTable 9 FTP Message Element

Attribute Name 

Description 

Message Repository 

The Message Repository path pointing to a directory on the remote FTP server where messages will be processed and archived. 

For more information, see Table 3.

Message Name 

Message Name is the filename where a message is put into, usually in the form of a name pattern. Pattern is a string containing special characters preceded by a percentage sign. The following are all the symbols supported: 

For more information, see Table 4.

  1. UUID %u, will be substituted by a UUID value compliant with Java 1.5 UUID.

  2. sequence number reference %0, %1, %2, %3, %4, %5, %6, %7, %8, %9, this symbol will be replaced by the current value of sequence number which is an integer count that increment after each reference.

Default value: %u

messageNamePrefixIB 

A prefix placed before the value of messageName to form the actual message name for messages transported in the INBOUND direction (consumer to provider).

messageNamePrefixIB should not contain any pattern symbols or the percentage sign '%'.

Default value: req

messageNamePrefixOB 

A prefix placed before the value of messageName to form the actual message name for messages transported in the OUTBOUND direction (provider to consumer).

messageNamePrefixIB should not contain any pattern symbols or the percentage sign '%'.

Default value: resp

pollintervalMillis 

The polling interval (in milliseconds) for an inbound component (receiver) to poll the remote target. 

Default value: 5000

archive 

Specifies whether a message is archived after it is fetched by a component (either consumer or provider). 

When true, the message is archived (moved to a destination directory such as inarchive or outarchive.

When false, the message is deleted. 

Default value: true

protect 

Specifies how a message is moved to a dedicated directly such as inprotect or outprotect before an incoming message overwrites it.

  • If true, the message is moved (protected).

  • If false, the message is overwritten.

Default value: true

stage 

Specifies whether staging is enabled during message transfer. 

Default value: true

use 

Specified if the message is literal or encoded 

It encoded is specified. then you must also specify the encoder using the encodingStyle property.

Default value: Literal

encodingStyle 

Specifies the encoding type associated with the message. This also defines the encoder type responsible to process the encoded data. 

The value specified here is only applied if the use property is set to encoded. 

Has no default value. ud1encoder-1.0  

part 

References which part of the message described in the abstract WSDL is to be used for the message. 

Default value: Part1

If the part property is not specified, then the first part listed in the abstract WSDL is used. 

messageCorrelate 

Specifies whether UUID tagging-based message correlation is enabled. 

If true, then message correlation is enabled. 

Default value: true