SFTP Client LIST Service

The SFTP Client LIST service retrieves a list of files on a specified directory on the trading partner's SFTP server.

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

Category Description
System name SFTP Client LIST Service
Graphical Process Modeler (GPM) category All Services, B2B Protocols > SFTP Client
Description Retrieves a list of files on a specified directory on the trading partner's SFTP server.
Business usage Use this service to retrieve a list of files in a specified directory on the trading partner's system and return the list to Sterling B2B Integrator when the SFTP protocol is required as the transport mechanism.
Usage example A business process is executed to retrieve a list of files from the external trading partner. Sterling B2B Integrator uses the SFTP Client LIST service, working through the SFTP Client adapter, to retrieve the list of files from a specified directory on the trading partner system.
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 LIST service:

exactly
Field Description
ListNamesErrorSetSuccess Tells the SFTP server how to treat errors (if any). Valid values are:
  • Yes - Ignore any errors when creating a list. Allows the service to complete even if SFTP server errors are thrown.
  • No - Do not ignore SFTP server errors. If thrown, the SFTP List service errors out.
   
RemoteFileName File name or pattern to do the listing for. If not included, the listing is for a * pattern (depending on server configuration). Optional. Only one * is allowed. For example, the following are valid:
  • RemoteFileName=text* .
  • RemoteFileName=*text
The following is not valid:
  • RemoteFileName=*text*
The following returns all files, including parent directory and directory:
  • *
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 LIST 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
Files Provides information about the files included in the specified directory.
Name The name of the file or message.
Size The size of the file or message.
Type The type of the file or message. Most common values are:
  • Regular
  • Directory
Permissions A formatted permissions string. When getting a listing from a Sterling B2B Integrator SFTP server, messages have permissions equal to "-rw------", mailboxes have permissions equal to "-drwx-----".
ModificationTime The date/time the file was last modified.
Owner When getting a listing from a Sterling B2B Integrator SFTP server, messages have an owner identity equal to "200", mailboxes have an owner identity equal to "300".
Group When getting a listing from a Sterling B2B Integrator SFTP server, messages and mailboxes have a group identity equal to "100".

Business Process Example

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

[[Insert Begin Session]]
   <operation name="SFTP Client LIST Service">
     <participant name="SFTPClientList"/>
     <output message="SFTPClientListServiceTypeInputMessage">
       <assign to="SessionToken"
               from="/SFTPClientBeginSessionServiceResults/SessionToken/text()">
       </assign>
       <assign to="." from="*"></assign>
     </output>
      <input message="inmsg">
       <assign to="SFTPClientListServiceResults" from="*"></assign>
     </input>
    </operation>
[[Insert End Session]]