An FTP Scripting target is a polling target that runs according to the schedule you set. The behavior of an FTP Scripting target is governed by an FTP command script.
Unlike the FTP target, which polls a directory on your FTP server, the FTP Scripting target polls directories on another server (for example, a VAN).
The FTP servers can have specific requirements for the commands they will accept. To use an FTP Scripting target, you create a file that includes all the FTP commands required by the FTP server to which you are connecting. (You must receive this information from the administrator of the FTP server.)
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD% cd %BCGOPTION1% mget * quit
The placeholders (for example, %BCGSERVERIP%) are replaced when the target is put in service by the values you enter when you create a specific instance of an FTP Scripting target. The %BCGOPTION% in this example is the name of the directory in the cd command. The script parameters and their associated FTP Scripting Target fields are shown in Table 2:
Script parameter | FTP Scripting target field entry |
---|---|
%BCGSERVERIP% | Server IP |
%BCGUSERID% | User ID |
%BCGPASSWORD% | Password |
%BCGOPTIONx% | Optionx, under User defined attributes |
You can use the following commands when creating the script:
These commands are not sent to the FTP Server. They modify the mode of transfer (ascii, binary, or passive) to the FTP Server.
This command changes to the specified directory.
This command removes a file from the FTP server.
This command takes a single argument -- the name of the file to retrieve from the remote system. The requested file is then transferred into WebSphere Partner Gateway. Use this command only if you are picking up a single file and the name is known; otherwise, the mget command with wildcards should be used.
This command is the same as the get command, except that the file is removed from the remote system when WebSphere Partner Gateway gets the file for processing.
This command takes a single argument, which describes a group of files to be retrieved. The description can include the standard wildcard characters ('*' and '?'). One or more files are then retrieved from the remote system.
This command takes a single argument, which describes a group of files to be retrieved and then deleted from the FTP server. The description can include the standard wildcard characters (* and ?). One or more files are retrieved and then deleted from the remote system.
This command creates a directory on the FTP server.
This command takes three parameters--the FTP server IP address, the user name, and a password. These parameters map to the %BCGSERVERIP%, %BCGUSERID%, and %BCGPASSWORD% variables.
The first line of your FTP Scripting target script, therefore, should be:
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD%
This command ends an existing connection to an FTP Server.
This command indicates that everything after the QUOTE should be sent to the remote system as a command. This allows you to send commands to a remote FTP server that might not be defined in the standard FTP protocol.
This command renames a file on the FTP server.
This command removes a directory from the FTP server.
This command can be used to issue site-specific commands to the remote system. The remote system determines if the contents of this command are valid.
The following steps describe what you need to specify for an FTP Scripting target.
In the Target Details section, perform the following steps:
In the Target Configuration section of the page, perform the following steps:
If you want to specify additional attributes, perform the following steps. The value you enter for the option will replace %BCGOPTIONx% when the FTP script is run (where x corresponds to the number of the option).
For example, suppose your FTP script looked like this:
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD% cd %BCGOPTION1% mget * quit
The %BCGOPTION% in this case would be a directory name.
Indicate whether you want interval-based scheduling or calendar-based scheduling.
If you will be receiving files containing multiple EDI interchanges or XML or ROD documents that need to be split, configure the appropriate splitter handler in the Preprocess configuration point.
To modify the Preprocess configuration point, go to Modifying configuration points. Otherwise, click Save.