FTP Client Adapter (V5.2.6.3_3 or later)

The FTP Client adapter uses the FTP Client services to send FTP requests to trading partners by using a perimeter server. It replaces the B2B FTP Client adapter, the FTP Send adapter, and the FTP GET adapter.

The following table provides an overview of the FTP Client adapter:

System name FTP Client Adapter
Graphical Process Modeler (GPM) category Not available in the GPM
Description This adapter is used with the FTP Client services to send FTP requests to trading partners by using a Perimeter server. The FTP Client adapter replaces the B2B FTP Client adapter, the FTP Send adapter, and the FTP GET adapter, which is being retired. The FTP Client adapter and its related services provide all the functionality of the former three adapters plus the following enhancements:
  • Uses Perimeter Services
  • Scriptable through BPML
  • Highly scalable
  • Supports large files (up to 15 GB)
  • Designed to work easily with nearly any FTP server
Business usage Use this adapter to send FTP requests to perform activities such as to get or put files into a directory on the trading partner's FTP server.
Usage example A Sterling B2B Integrator business process is executed that translates a document that must be sent to a trading partner. After the translation, Sterling B2B Integrator looks up information about how to transport data to the trading partner in the trading profile. The trading profile specifies FTP as the transport protocol. Sterling B2B Integrator then uses the FTP Client adapter to send the document to the trading partner.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services Related services:
  • FTP Client Begin Session service
  • FTP Client CD service
  • FTP Client DELETE service
  • FTP Client End Session service
  • FTP Client GET service
  • FTP Client LIST service
  • FTP Client MOVE service
  • FTP Client PUT service
  • FTP Client PWD service
  • FTP Client QUOTE service
  • FTP Client SITE service
Application requirements An FTP server at the external trading partner location. When this adapter is configured with a ‘non-local-mode' Perimeter server, the Perimeter server must be installed and running.
Note: You should use a specific external interface for communications with trading partners. Using a wildcard address can cause problems with FTP sessions. If some other process has bound the port used for the data channel on an interface, it may receive connections intended for the data channel. Using a specific TCP/IP address or DNS name prevents this from occurring.
Initiates business processes? This adapter does not initiate business processes.
Invocation This adapter is invoked from one of the FTP Client services used within a business process.
Business process context considerations Business processes using FTP client services should not be marked as Auto Resume. These services require an established session which will no longer exist after a restart.
Returned status values
Returned status values:
  • 0 – Success
  • 1 – Error
Restrictions None
Persistence level None
Testing considerations Test this adapter by running the FTPClientDemoAllServices business process provided with Sterling B2B Integrator. This business process tests the FTP Client adapter and all its related services. The FTPClientDemoAllServices business process uses the preconfigured instance of the FTP Server adapter, which is disabled by default, and must be enabled before running this test. To verify that the preconfigured FTP Server adapter is enabled, perform the following steps from the Sterling B2B Integrator Admin Console:

1. Choose Business Processes > Deployment > Services > Configuration.

2. Find FTP Server Adapter.

3. If not already selected, select the Enabled check box.

To test the FTP Client adapter, perform the following steps from the Sterling B2B Integrator Admin Console:

1. Choose Business Processes > Manager.

2. Find the FTPClientDemoAllServices business process.

3. Run the FTPClientDemoAllServices business process with the following settings:
  • Run As User = Admin
  • Server filename =
    <install_directory>/installed_data/
    psftpclient/FTPClientDemoImport.xml.
4. Verify that the business process runs successfully. Debug information for this adapter can be found in the FTP Client adapter and services log files.
Notes Every FTP Client service returns a response code from the server. If this code is an error code as defined by the FTP specification (that is, 4xx or 5xx) then the business process will produce a fault. If the error code is expected, use an OnFault service to continue interacting with the trading partner. There are two exceptions to this rule:
  • FTP Client GET service: If using the remoteFilePattern parameter and one of the files returns an error code indicating that the file could not be found, the GET command will continue without producing a fault. The error code will still be visible in the Transcript Document.
  • FTP Client QUOTE service: This service never produces a fault, because the service does not know what constitutes a valid response from the quoted command.

Business Scenario

You want to send a file to a trading partner, using FTP. The file must be placed in a specific directory on the trading partner's FTP server. After putting the file in the directory, you want to list the contents of the directory to verify that it was copied correctly.

Business Solution Example

The following approaches are used to solve the above business scenario.
  1. Create an FTP Client adapter configuration to be used by the FTP client services that will be included in a business process to send the file.
  2. Create a business process that:
    • Opens an FTP communications session with the trading partner (using the FTP Client Begin Session service)
    • Changes to the correct directory on the trading partner's FTP server (using the FTP Client CD service)
    • Puts the file in the directory (using the FTP Client PUT service)
    • Generates a list of the directory contents to verify that the put command was successful (using the FTP Client LIST service)
    • Closes the FTP session (using the FTP Client End Session service)

This business solution is described for both the GPM and the BPML.

GPM Example

The following example shows a solution to the above business scenario using the GPM:

GPM Example

Business Process Modeling Language (BPML) Example

The following example shows the corresponding business process solution by using BPML:

<process name="default">
  <sequence>
    <operation name="FTP Client Begin Session Service">
      <participant name="FTPClientBeginSession"/>
      <output message="FTPClientBeginSessionServiceTypeInputMessage">
        <assign to="CipherStrength">STRONG</assign>
        <assign to="ClearControlChannel">NO</assign>
        <assign to="ConnectionRetries">2</assign>
        <assign to="FTPClientAdapter">FTPClientAdapter</assign>
        <assign to="ProfileId">tradingpartner1</assign>
        <assign to="RemoteHost">000.00.000.00</assign>
        <assign to="RemotePasswd">uuuuuuuu</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="FTP Client CD Service">
      <participant name="FTPClientCd"/>
      <output message="FTPClientCdServiceTypeInputMessage">
        <assign to="CdUp">YES</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
<operation name="FTP Client LIST Service">
      <participant name="FTPClientList"/>
      <output message="FTPClientListServiceTypeInputMessage">
        <assign to="ConnectionType">ACTIVE</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="FTP Client PUT Service">
      <participant name="FTPClientPut"/>
      <output message="FTPClientPutServiceTypeInputMessage">
        <assign to="DocumentId">doc12345</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
<operation name="FTP Client End Session Service">
      <participant name="FTPClientEndSession"/>
      <output message="FTPClientEndSessionServiceTypeInputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
</sequence> 
</process>

Implementing the FTP Client adapter

To implement the FTP Client adapter, complete the following tasks:
  1. Create an FTP Client adapter configuration. For information, see Managing Services and Adapters.
  2. Configure the adapter. For information, see Configuring the FTP Client adapter.

Configuring the FTP Client adapter

To configure the FTP Client adapter, you must specify field settings in Sterling B2B Integrator.

Field Description
Name Unique and meaningful name for the adapter configuration. Required.
Description Meaningful description for the adapter configuration, for reference purposes. Required.
Select a group Group of services or adapters of the same type that can act as peers. A Service Group name is used in BPML in place of the Service Configuration name. Service Groups show up in the GPM as if they were Service Configurations. Select a Service Group to associate with this adapter. Valid values are:
  • None – You do not want to include this configuration in a group at this time (default)
  • Create New Group – You can enter a name for a new group in this field, which is then created along with this configuration.
  • Select Group – If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.
For more information about service groups, see Managing Services and Adapters.
Perimeter Server Select the Perimeter server to use with this adapter. Default is node1 & local. Required.
Note: You should use a specific external interface for communications with trading partners. Using a wildcard address can cause problems with FTP sessions. If some other process has bound the port used for the data channel on an interface, it may receive connections intended for the data channel. Using a specific TCP/IP address or DNS name prevents this from occurring.
Minimum Number of Threads A tuning parameter that indicates the range of threads available for handling events to improve performance. Must be less than or equal to Max Threads value. Valid value is any integer. Default is 3. Required.
Maximum Number of Threads A tuning parameter that indicates the range of threads available for handling events to improve performance. Must be greater than or equal to Min Threads value. Valid value is any integer. Default is 6. Required.
NAT Address Specification (V5.2.6.2_1 or later) For use with NAT (Network Address Translating) routers and firewalls in ACTIVE mode. This is the IP address where you want the NAT to forward all incoming requests. Default value is blank.

The NAT address can also be specified at the global level by updating the property file psftpclient.properties.in to include the value afterNATAddress = x.x.x.x. If this is not configured, the local address is used.

Local Control Port Range Any valid port numbers not being used by another application running on the system. A port in the specified range will be used to establish a control channel to the remote FTP server. Optional.
Local Data Port Range Any valid port numbers that are not being used by another application running on the system. Contact your network administrator if the port numbers are restricted in any way. A port in the specified range will be used to establish a data connection to the remote FTP server. Optional.
Use SOCKS5 Proxy Server Whether to use a SOCKS5 proxy server. Required. Valid values:
  • Yes – A SOCKS5 proxy server will be used
  • No – No proxy server will be used
Proxy hostname IP address or host name of the proxy server to use. Required if Use SOCKS5 proxy server is set to Yes.
Proxy port Port number of the proxy server. Required if Use SOCKS5 proxy server is set to Yes.
Proxy retries Number of times the FTP client adapter will try to connect to the proxy server. Valid values can be any integer between 0 and 50. Default is 3.
Use proxy basic authentication Whether the proxy server requires basic authentication. Valid values:
  • Yes – Proxy basic authentication will be used
  • No – Proxy basic authentication will not be used
Proxy username User name to use with the proxy server. Required if Use proxy basic authentication is set to Yes.
Proxy password Password for the Proxy username. Required if Use proxy basic authentication is set to Yes.