SFTP Client GET Service (V5.2.0 - 5.2.1)

The SFTP Client GET service retrieves a document from a specified directory on the trading partner's SFTP server.

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

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

Field Description
RemoteFileName The name of the file to be retrieved from the remote trading partner. 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 the ResponseTimeout value specified in the 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 GET service to the business process:

Parameter Description
ServiceStartTime The date/time stamp for when the service started.
DocumentId Provides information about the file retrieved as a result of the GET service.
ServerResponse The SFTP server response, which may include a reply code and any text associated with the reply code. Valid values are:
  • OK - 0
  • End of File - 1
  • No Such File - 2
  • Permission Denied - 3
  • General Failure - 4
  • Bad Message - 5
  • No Connection - 6
  • Connection Lost - 7
  • Operation Unsupported - 8
ServiceEndTime The date/time stamp for when the service ended.
Primary Document The file retrieved as a result of the GET service. Note: The SFTP Get Service can generate multiple primary documents. When the SFTP Get service is retrieving multiple primary documents a primary document is created with the NodeUniqueId so the primary document elements will be unique. The appearance of the NodeUniqueId attribute is an example of a Business Process working as designed.

Business Process Example

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

[[Insert begin session here]]
 
<operation name="SFTP Client GET Service">
      <participant name="SFTPClientGet"/>
      <output message="SFTPClientGetServiceTypeInputMessage">
	<assign to="RemoteFileName" >FilenameToGet</assign>
       <assign to="SessionToken" 
               from="SFTPClientBeginSessionServiceResults/SessionToken/text()">
       </assign>
      </output>
      <input message="inmsg">
       <assign to="SFTPClientGetServiceResults" from="*"></assign>
     </input>
    </operation>
[[Insert end session here]]

Correlations and Document Tracking

The following table details the correlations available from the SFTP Client GET service for document tracking:

Key Values
ACTION Get, Put
Direction Inbound, Outbound
Protocol SFTP
RemoteHostAddress remoteAddress
RemoteHostName remoteHost
Username username
RemoteFile filename