webMethods.io B2B - Document exchange using SFTP

webMethods.io B2B Channels Introduction

Channels enable document exchange between trading partners in webMethods.io B2B. There are two types of channels - Inbound (used to receive the documents) and Outbound (used to transfer documents). The channels can be created during design-time and can be used during runtime to exchange the documents.

webMethods.io B2B supports multiple protocols over which these channels (Inbound and Outbound) can be created and used to exchange the business documents.
The Protocols supported in webMethods.io B2B till date are :

  • HTTP
  • AS2
  • RNIF
  • SFTP

What is SFTP ?

SFTP (Secure File Transfer Protocol, also known as SSH File Transfer Protocol) is a popular method for securely transferring files over remote systems. It runs over the SSH protocol. The documents transferred using SFTP are encrypted and transferred in specially formatted binary packets with a single, secured connection using SSH. SFTP also protects against password sniffing and man-in-the-middle attacks. It protects the integrity of the data using encryption and cryptographic hash functions, and authenticates both the server and the user.

SFTP Support for webMethods.io B2B Channels

Usecase & Assumption

  • Let us consider a use case in which an online e-commerce website, ABC Corp is using webMethods.io B2B to send/receive the business documents to/from its partners.
  • One of the partner Partner A , and another partner Partner B a popular shoe maker, uses SFTP protocol to exchange the business documents. For example: Purchase order, Invoice etc. between each other.
  • Assuming the enterprise ( ABC Corp ), partner profile ( Partner A , Partner B) and processing rule are already setup.
  • Assuming that while configuring the processing rule " Deliver through Preferred outbound channel " is selected.
  • SFTP communication channel needs to be configured during design-time configuration.

Points to Note

  1. SFTP channel works on the pull model in which documents are pulled from SFTP server and processed.
  2. A scheduler is created in the tenant’s webMethods.io B2B Server with the user selected running frequency. This scheduler polls the sender’s SFTP server source folder path to check if any new file is present.
  3. Tenant’s webMethods.io B2B scheduler running status changes depending upon the status of channel.
  4. Server and user details provided by the user while creating the channel are stored in tenant’s webMethods.io B2B Server.

Design time configuration

Creating a SFTP IN/OUT Channels

To create an SFTP-IN-CLIENT Channel

  1. Log in to webMethods.io B2B.
  2. Navigate to Communications –> Add Channel –> Inbound Channel
  3. Select the channel type as SFTP-IN-CLIENT from the drop-down of channel type.
  4. Specify a name and the description to the channel which you are about to create as shown:
  5. Then click on the Next button at the bottom right corner to go to next page.
  6. Fill in the channel details as per the description in the table:


    image

    image
  7. Once the SFTP-IN-CLIENT channel is created, then make the channel as “Active”.
    image

To create an SFTP-OUT-CLIENT Channel

  1. Log in to the webMethods.io B2B.
  2. Navigate to Communications –> Add Channel –> Outbound Channel
  3. Select the channel type as SFTP-OUT-CLIENT from the drop down of channel type.
  4. Give a name and the description to the channel which you about to create as shown:
  1. Then click Next given in bottom right corner to go to the next page.
  2. Fill in the below channel details as per the description given in the following table:
    image
    image
    image
    image

Run time Configuration

During runtime, the actual exchange of the business documents happens between partners:

Prerequisites:

  1. Enterprise should be setup in the tenant.
  2. Partners among which the file exchange has to happen should also be created.
  3. Partners should have configured a preferred outbound channel in partner profile.
  4. Processing rule should be created for the partners among which the exchange of documents has to happen.
  5. Select “Deliver document using receiver’s preferred outbound channel” option in the Action step of the processing rule.
    Image16
Points to be considered :
  1. The maximum file size which can be processed using SFTP channels is up to 1 MB .
  2. As zip is a packaging of files which can even have different type of formats, webmethods.io B2B does not support the zip files to be processed with SFTP based channels.
  3. The inbound channel need not to be associated with any partner as the user with which the operation needs to be performed may be different.

SFTP channel works on a pull model in which documents are pulled from SFTP server and processed. To pull the Business documents, Documents are polled after every equal internal of time by using a Integration Server scheduler explained below in details

Flow Diagram

The following flow diagram explains how the end-to-end flow of the documents happens from partner Partner A to the other partner Partner B .

  1. Partner Partner A wants to send a business document to Partner B using the SFTP.

  2. Partner A creates a SFTP-IN-CLIENT channel and uploads the documents into his SFTP server’s source folder.

  3. Tenant’s webmethods.io B2B server scheduler polling the SFTP server’s source folder pickup the files to download and process them further.

  4. After successful processing of files, outbound SFTP-OUT-CLIENT channel’s configurations are used to upload the files to Partner B’s SFTP server target folder.

File Polling

SFTP-IN-CLIENT channel uses webMethods.io B2B Server schedulers to poll sender’s external SFTP server to pull the files and process them.

File Exchange

Steps that happen to exchange files

  1. Scheduler which runs after every equal interval of time, calls webMethods.io B2B Server to check if any new business document has been uploaded into sender’s external SFTP server.
  2. webMethods.io B2B server connects to the SFTP server using credential provided during the creation of SFTP-IN-CLIENT channel.
  3. webMethods.io B2B server lists all the files present in the SFTP server which are more than size 1 MB.
  4. webMethods.io B2B server starts downloading the files one by one and starts processing it.
  5. webMethods.io B2B server renames/moves the processed files into other folder path or delete the processed files from the sender’s SFTP server.
  6. webMethods.io B2B server calls the preferred SFTP-OUT-CLIENT channel of the receiver. (Only if processing rule has “Deliver document” as Action)
  7. webMethods.io B2B server connects to Receiver’s external SFTP server.
  8. webMethods.io B2B server uploads the processed business document to the SFTP server.