FTP Client CD Service

The FTP Client CD service changes directories on the trading partner FTP server system.

The following table provides an overview of the FTP Client CD service:

System name FTP Client CD Service
Graphical Process Modeler (GPM) categories All Services, B2B Protocols > FTP Client
Description This service is used to change directories on the trading partner's FTP server.
Business usage Use this service to change directories on the trading partner FTP server system.
Usage example A Sterling B2B Integrator business process is executed that requires retrieving a document from the trading partner's system. The document is located in a directory other than the home directory. Sterling B2B Integrator uses the FTP Client CD service, working through the FTP Client adapter, to change directories to the one where the document is located. Sterling B2B Integrator can then use the FTP Client GET service to retrieve the document.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services
Related services:
  • FTP Client adapter
  • FTP Client Begin Session service
  • FTP Client DELETE service
  • FTP Client End Session service
  • FTP Client LIST service
  • FTP Client GET service
  • FTP Client MOVE service
  • FTP Client PUT service
  • FTP Client PWD service
  • FTP Client SITE service
  • FTP Client QUOTE service
Application requirements An FTP server at the external trading partner location.
Initiates business processes? This service does not initiate business processes.
Invocation This service is initiated from a business process.
Business process context considerations None
Returned status values
Returned status values:
  • 0 –Success
  • 1 –Error
Restrictions None
Persistence level Default
Testing considerations Test this service 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 this service, 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 successfullyDebug information for this service 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.

Implementing the FTP Client CD Service

To implement the FTP Client CD service, complete the following tasks:
  1. Create an FTP Client CD service configuration (or enable the configuration installed with Sterling B2B Integrator and edit parameters as needed). For information, see Managing Services and Adapters.
  2. Configure the FTP Client CD service. For information, see Configuring the FTP Client CD Service.
  3. Use the FTP Client CD service in a business process.

Configuring the FTP Client CD Service

To configure the FTP Client CD service, you must specify settings for the following fields in the GPM:

Field Description
Config Name of the service configuration.
CdUp
  • YES-Causes the FTP protocol command CDUP to be sent to the server, which results in the current directory moving one level up.
  • NO-Causes the FTP protocol command CWD + Directory to be sent to the server. Default is NO.
Directory The directory to change to. Can also be a relative directory depending on server capabilities. Required if CdUp is No.
Note: If CdUp=YES, this parameter is ignored.
ResponseTimeout Maximum number of seconds the FTP client waits for the server to respond before the session times out and terminates. Optional. Valid value is any numeric value. The default is the value from the FTP Client Begin Session service ResponseTimeout parameter. Minimum value you can specify is 1 second. If the value you specify is less than 1 second, the FTP Client CD service resets the value to 1 second.
SessionToken Specifies the identifier for the session established between the FTP Client adapter and an FTP server. Required.
Note: The session token is returned from the FTP Client Begin Session service.
SaveTranscript Indicates how to handle the transcript. Valid values are:
  • erroronly – persists the transcript only when an error occurs
  • on – always persists the transcript
Default is on. Optional.

Output from Service to Business Process

The following table contains the parameters passed from the FTP Client CD service to the business process:

Parameter Description
ServerResponse Indicates the FTP server response, which may include a reply code and any text associated with the reply code. Required.
TranscriptDocumentId Identifies the document that contains a transcript of the exact exchange with the FTP server. Required

Output from Business Process to Service

The following table contains the parameters passed from the business process to the FTP Client CD service:

Parameter Description
CdUp Valid values are:
  • YES-Causes the FTP protocol command CDUP to be sent to the server, which results in the current directory moving one level up.
  • NO-Causes the FTP protocol command CWD + Directory to be sent to the server.
Directory The directory to change to. Can also be a relative directory depending on server capabilities. Required if CdUp is NO.
Note: If CdUp=YES, Directory will be ignored.
ResponseTimeout Maximum number of seconds the FTP client waits for the server to respond before the session times out and terminates. Optional. Valid value is any numeric value. The default is the value from the FTP Client Begin Session service ResponseTimeout parameter. Minimum value you can specify is 1 second. If the value you specify is less than 1 second, the FTP Client CD service resets the value to 1 second.
SessionToken Specifies the identifier for the session established between the FTP Client adapter and an FTP server. Required.
Note: The session token is returned from the FTP Client Begin Session service.
SaveTranscript Indicates how to handle the transcript. Valid values are:
  • erroronly – persists the transcript only when an error occurs
  • on – always persists the transcript
Default is on. Optional.

Business Process Example

The following example business process illustrates using the FTP Client CD service:

 <sequence>
  [[Insert FTP Client Begin Session]] 
  <operation name="FTP CD SERVICE"> 
    <participant name="FTPClientCd"/> 
    <output message="CdRequest"> 
      <assign to="SessionToken" from="/ProcessData/FtpBeginSessionServiceResults/SessionToken/text()">
      </assign> 
      <assign to="Directory">home/username/documents</assign> 
    </output> 
    <input message="inmsg"> 
      <assign to="FTPClientCdResults" from="*"></assign> 
    </input> 
  </operation> 
  [[ Insert FTP Client End Session ]] 
</sequence>