This article explains about setting up the SFTP connection and pulling and pushing the messages using Webmethods.io FlowService.
It is assumed that readers of this article know how to create integrations on Webmethods.io
- Navigate to FlowServices and click on +New FlowService.
- In our case, we have named as GetAccountData
- Set the input parameters for the FlowService integration
- InputFileLocation: Path from where the file needs to pick up
- OutputFileLocation: Path to where the file needs to be copied.
- Provide the hostname, username, key for connecting to the SFTP server
Create a SFTP Connection
- In this article connectivity is setup with SFTP server using ssh keys.
- Search for SFTP apps inside FlowService
- Select SFTP action.
- In this case ls option is selected.
- Click on create account and select configure Account
- Provide the name and other details to configure the account.
- In this hostname, public key, authentication Type, public certificate, username and password is configured.
- Click Save and account is configured.
- Files will be picked up from SFTP folder (folder Name: new)
- Same files will be copied to destination SFTP folder (folder Name: completed).
- Files will be deleted from source folder (folder Name: new)
- Attached the sample as attachment.
This FlowService is responsible for below actions
- ls: Get the list of all files present in SFTP server
- get: file downloaded from the SFTP server
- put: writing the files to the destination folder on SFTP server.
- rm: Deleting the files from the source folder on SFTP server.
Testing the Application:
- Connect to the SFTP server using any client e.g. FileZilla
- Put the sample files in the new folder (SFTP server)
- As of now there are no files available in processing folder (SFTP server)
- From Webmethods.io FlowServices invoke the integration GetAccountData
- Provide the source file location and destination location
- Click Run
- Verify the processing SFTP folder.
- Files will be available on processing folder
- Verify the new SFTP folder.
- Files get deleted from new folder