Setting up an FTP Scripting target

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).

Creating the FTP script

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.)

  1. Create a script for the targets, to indicate the actions you want performed. The following script is an example of connecting to the specified FTP server (with the name and password specified), changing to the specified directory on the FTP server, and receiving all the files in that directory:
    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:

    Table 2. How script parameters map to FTP Scripting target field entries
    Script parameter FTP Scripting target field entry
    %BCGSERVERIP% Server IP
    %BCGUSERID% User ID
    %BCGPASSWORD% Password
    %BCGOPTIONx% Optionx, under User defined attributes
  2. Save the file.

FTP scripting commands

You can use the following commands when creating the script:

Target Details

The following steps describe what you need to specify for an FTP Scripting target.

  1. Click Hub Admin > Hub Configuration > Targets to display the Targets List page.
  2. From the Target List page, click Create Target.

In the Target Details section, perform the following steps:

  1. Type a name for the target. For example, you might call the target FTPScriptingTarget1. This is a required field. The name you enter here will be displayed on the Targets list.
  2. Optionally indicate the status of the target. Enabled is the default. A target that is enabled is ready to accept documents. A target that is disabled cannot accept documents.
  3. Optionally enter a description of the target.
  4. Select FTP Scripting from the Transport list.

Target Configuration

In the Target Configuration section of the page, perform the following steps:

  1. Optionally indicate the gateway type. The gateway type defines the nature of the transmission. For example, if you want to test a document exchange before putting it into production, you would enter Test. The default is Production.
  2. Enter the server IP address of the FTP server to which you are connecting. The value you enter here will replace %BCGSERVERIP% when the FTP script is run.
  3. Enter the user ID and password you use to access the server. The values you enter here will replace %BCGUSERID% and %BCGPASSWORD% when the FTP script is run.
  4. Indicate whether the target will operate in secure sockets layer (SSL) mode. If so, you will need to exchange certificates with your participants, as described in Setting up security for inbound and outbound exchanges.
  5. Upload the script file by following these steps:
    1. Click Upload Script File.
    2. Type the name of the file that contains the script for processing documents, or use Browse to navigate to the file.
    3. Click Load File to load the script file into the Currently loaded script file text box.
    4. If the script file is the one you want to use, click Save.
    5. Click Close Window.
  6. For Connection Timeout, enter the number of seconds a socket will remain open with no traffic.
  7. In the Lock User field, indicate whether the target will request a lock, so that no other instances of an FTP Scripting target can gain access to the same FTP server directory at the same time.
Note: The Global FTP Scripting Attributes values are already filled in, and you cannot edit them from this page. To modify these values, you use the Global Transport Attributes page, as described in Setting global transport values.

User-Defined Attributes

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).

  1. Click New.
  2. Type a value next to Option 1.
  3. If you have additional attributes to specify, click New again and type a value.
  4. Repeat step 3 as often as necessary to define all the attributes.

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.

Schedule

Indicate whether you want interval-based scheduling or calendar-based scheduling.

Handlers

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.

Copyright IBM Corp. 2003, 2005