FTP Client MKD Service

The FTP Client MKD Service creates a directory on a trading partner's FTP server.

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

System name FTP Client MKD Service
Graphical Process Modeler (GPM) categories All Services, B2B Protocols > FTP Client
Description Used to create a directory on the trading partner's FTP server.
Business usage A business user would use this service to create directories and put the files into the respective directories on the server side when the FTP protocol is required as the transport mechanism.
Usage example Your company uses a business process that translates documents that must be sent to a trading partner daily. After the translation, the Sterling B2B Integrator uses the FTP Client MKD service, working through the FTP Client adapter, to create the directory with the current date so that the documents are placed in the specified directory on the trading partner system.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services The FTP Client MKD service must be placed between an FTP Begin Session service and an FTP End Session service in a business process. You can use the CD service to change to the directory created by this service. Documents can be put or retrieved from the newly created directory by using the PUT service and GET service. Related services are:
  • FTP Client adapter
  • 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 PWD service
  • FTP Client PUT service
  • FTP Client QUOTE service
  • FTP Client SITE service
  • FTP Client RMD service
  • FTP Client MODE service
Application requirements An FTP server at the external trading partner location.
Initiates business processes? No
Invocation This service is invoked from a business process.
Business process context considerations Business processes by using the FTP client services should not be marked as Auto Resume. The nature of these protocol services requires an established session, which no longer exists in a restart situation.
Returned status values Status values are:
  • 0 – Success
  • 1 – Error
Restrictions None
Persistence level Default
Testing considerations Debug 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 (4xx or 5xx) then the business process produces a fault. If the error code is expected, use a BPML activity 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.

Configuring the FTP Client MKD Service

To configure the FTP Client MKD service, you must specify settings for the following fields in the Admin console and in the GPM:

UI Field GPM Field Description
Name   Unique and meaningful name for the service configuration. Required.
Description   Meaningful description for the service configuration, for reference purposes. Required.
Select a group   Select one of the options:
  • None – Do not include the configuration in a service group at this time.
  • Create New Group – Enter a unique name for a new group, which will be created with this configuration. (You can then add other services to the group as well.)
  • Select Group – If service groups already exist for this service type, they are displayed in the list. Select a group from the list.
  Config Name of the service configuration.
  RemoteDirName The directory name to be created on the remote system. Required.
  ResponseTimeout The maximum number of seconds where no data transfer over the data channel is allowed before the service times out and raises a timeout exception. Optional. Valid value is any numeric value. If no value is specified or a timeout value of less than 30 is specified, Response Timeout is defaulted to 30 seconds.
  SaveTranscript Indicates how to handle the transcript. Optional. Valid values are:
  • Error only – Persists the transcript only when an error occurs.
  • On – Always persists the transcript. Default is on.
  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.

Parameters Passed from Business Process to Service

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

Parameter Description
RemoteDirName The directory name to be created on the remote system. Required.
ResponseTimeout The maximum number of seconds where no data transfer over the data channel is allowed before the service times out and raises a timeout exception. Optional. Valid value is any numeric value. If no value is specified or a timeout value of less than 30 is specified, Response Timeout is defaulted to 30 seconds.
SaveTranscript Indicates how to handle the transcript. Optional. Valid values are:
  • Error only – Persists the transcript only when an error occurs.
  • On – Always persists the transcript. Default is on.
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.

Parameters Passed from Service to Business Process

The following table contains the parameters passed from the FTP Client MKD 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.
TranscriptDocumentId Identifies the document that contains a transcript of the exact exchange with the FTP server.

Business Process Examples

Example 1

The following business process uses the FTP Client MKD service to create a directory on the remote FTP server.

<process name="FtpExample">
  <sequence> 
[[Insert Begin Session ]] 
<operation name="FTP Client MKD Service">
      <participant name="FTPClientMkd"/>
      <output message="FTPClientMkdServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="RemoteDirName">FTPTEST</assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
 [[Insert end session here]]
  </sequence> 
</process>

Example 2

The following business process uses the FTP Client MKD service to create a directory on the remote FTP server, change to the directory and put the primary document from Sterling B2B Integrator on the remote FTP server.

<process name="FtpExample">
  <sequence> 
[[Insert Begin Session ]] 
<operation name="FTP Client MKD Service">
      <participant name="FTPClientMkd"/>
      <output message=" MkdRequest ">
        <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
                 SessionToken/text()"></assign>
        <assign to="RemoteDirName">NEWFTP1 </assign>
      </output>
      <input message="FtpMkdResults ">
	<assign to="MkdResults" from="*"/>
           </input>
  </operation>          
<operation name="FTP Client CD Service">
      <participant name="FTPClientCd"/>
      <output message=" CdRequest ">
        <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
                  SessionToken/text()"></assign>
        <assign to="Directory">NEWFTP1</assign>
      </output>
      <input message=" FtpCdResults ">
        <assign to=" CdResults " from="*"></assign>
      </input>
    </operation> 
<operation name="FTP Client PUT Service">
      <participant name="FTPClientPut"/>
      <output message=" PutRequest">
        <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
                  SessionToken/text()"></assign>
        <assign to="RemoteFileName">TestDoc</assign>
        <assign to="ConnectionType">PASSIVE</assign>
        <assign to="RepresentationType">ASCII</assign></output>
      </output>
     <input message="FtpPutResults">
        <assign to="PutResults" from="*"></assign>
     </input>
        <assign to="." from="*"></assign>
      </input>
    </operation> 
[[Insert End Session]]
  </sequence> 
</process>