
Pre-requisite:
Steps:
1. Go to https://sftpcloud.io/tools/free-sftp-server website and create a free SFTP server for learning. It will valid for 1 hour only.
2. Check your server in FileZilla.
3. Now we need to add the connection in our CPI Tenant.
4. Open Tenant. Go to connection tests in monitor section to get the host key.
5. Copy the host key and paste in notepad file and save it with the name known.hosts.
6. Upload the known.hosts file in security material known hosts and deploy it.
7. Add the user credentials of your SFTP server.
8. Create Artifact in which we need to pull the file from SFTP server and log the data in CPI using groovy and send to the SFTP server appending timestamp.
9. Configure SFTP.
10. Add logging groovy.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
messageLog.setStringProperty("Logging#1", "Printing Payload As Attachment")
messageLog.addAttachmentAsString("ResponsePayload:", body, "text/plain");
}
return message;
}
11. Configure Receiver SFTP.
12. Before deploying add a test file in SFTP server using filezilla.
13. Deploy the Artifact and check your SFTP server does the file exist with timestamp.
Thankyou
Dushyant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
19 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |