SFTP Client CD Service

The SFTP Client CD service changes directories on the trading partner's SFTP server.

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

Category Description
System name SFTP Client CD Service
Graphical Process Modeler (GPM) category All Services, B2B Protocols > SFTP Client
Description Changes directories on the trading partner's SFTP server.
Business usage Use this service to change directories on the trading partner SFTP 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. The SFTP Client CD service, working through the SFTP Client adapter, changes to the directory where the document is located. Then the SFTP Client GET service retrieves the document.
Preconfigured? Yes. Uses the preconfigured service in a business process.
Requires third-party files? No
Platform availability All Sterling B2B Integrator supported platforms
Related services The following services are related. Configured in a business process, they initiate the SFTP Client adapter to perform their operations:
  • SFTP Client Begin Session service
  • SFTP Client CD service
  • SFTP Client DELETE service
  • SFTP Client End Session service
  • SFTP Client GET service
  • SFTP Client LIST service
  • SFTP Client MKDIR service
  • SFTP Client MOVE service
  • SFTP Client PUT service
  • SFTP Client PWD service
  • SFTP Client RMDIR service
Application requirements An SFTP Server at the external trading partner location.
Initiates business processes? No
Invocation This service is invoked from a business process.
Business process context considerations None
Returned status values
Returned status values:
  • 0 –Success
  • 1 – Error
Restrictions N/A
Persistence level System Default
Testing considerations To test this service, run the SFTPClientDemoAllServices business process and verify that it completes successfully. For more information about the SFTPClientDemoAllServices business process, see SFTP Client adapter. Debug information for this service is located at:Operations > System > Logs > SFTP Client Adapter and Services.

Input from Business Process to Service

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

Field Description
CdUp Do not use.
Note: The CdUp parameter has no effect on this service and is unsupported. To change directories to a higher-level directory, use the Directory parameter for this service, and provide a value of “..”.
Directory The directory to change to. Can also be a relative directory depending on server capabilities. Required.
ResponseTimeout The maximum number of seconds it can take for the trading partner system to respond before the session times out and terminates. If a number less than 30 is specified, 30 seconds will be used. Optional. Default is ResponseTimeout specified in SFTP Client Begin Session service.
SessionToken The returned SessionToken from the Begin Session service. Required.

Output from Service to Business Process

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

Parameter Description
ServerResponse The SFTP server response, which may include a reply code and any text associated with the reply code. Valid values are:
  • OK - 0
  • No Such File - 2
  • Permission Denied - 3
  • General Failure - 4
  • Bad Message - 5
  • No Connection - 6
  • Connection Lost - 7
  • Operation Unsupported - 8
ServiceStartTime The date/time stamp for when the service started.
ServiceEndTime The date/time stamp for when the service ended.
PwdDirectory Specifies the current directory.

Business Process Example

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

[[Insert SFTP Client Begin Session]]
<operation name="SFTP Client SFTP CD SERVICE">
     <participant name="SFTPClientCd"/>
     <output message="CdRequest1">
       <assign to="SessionToken" 
             from="SFTPClientBeginSessionServiceResults/SessionToken/text()">
       </assign>
     		<assign to="Directory">My Directory</assign>
     </output>
      <input message="inmsg">
       <assign to="SFTPClientCdServiceResults" from="*"></assign>
     </input>
    </operation>
[[Insert SFTP Client End Session]]