Introduction
Policies in IBM ACE offer control over specific node properties and aspects of message flow behavior, such as connection credentials and flow rate. They serve as shared and reusable definitions. Developers leverage policies to manage runtime behavior and avoid redundancy by reusing configuration information. Administrators utilize policies to define environment-specific configuration data, override properties set by developers, and handle distinct connection details.
Let’s begin by create a policy project named DefaultPolicyProjects and under that create a policy named FTPPolicy.

Open FTPPolicy.
Select policy type FTP Server.
Specify the FTP server name (IP), in my case it is a Windows FTP server. for example, 192.168.0.106.
Provide Remote FTP server directory path where files should be placed. In my case it will be default value (Blank), which indicates the default directory after logon to FTP server. Make sure proper permissions are allowed for read and write.
Provide FTP Security Identity to locate the username and password in broker registry.
The security identity name authenticates connections to an FTP server. It helps find the username and password and follows the format ftp::FTPServerSecurityIdentity, where FTPServerSecurityIdentity is set as the Security identity property in the FileInput or FileOutput node.

Save and deploy the DefaultPolicyProjects on integration server

Now, let’s make a basic application called myApplication. In it, there’s a single message flow named Fileput_MessageFlow.msgflow, and we’ll be using five nodes as explained below.
HTTPInput Node: will accept the JSON message from client on path format http://serverIP:port/fileput, in my case it will be http://localhost:7803/fileput

Compute Node: will copy the entire message without header and send to File Output node. Just uncomment this line in compute node.
CALL CopyEntireMessage();
File Output Node: will write the data to FTP server
Compute Node: will send back a message to client that data has been placed on the server.
SET OutputRoot.JSON.Data.Message='Data has been successfully placed on FTP server';
HTTPReply Node: will reply back to client

Select the File Output node
in properties tab select Basic, set Directory D:/ACE (optional) and File name TestFile.txt

select FTP
set Transfer protocol as FTP
on Server and port, provide policy in format {PolicyProjectName}:PolicyName. in my case it will be {DefaultPolicyProjects}:FTPPolicy

If you attempt to deploy the application on the same integration server where DefaultPolicyProjects is deployed, you will encounter the following error.
BIP3386W File node 'File Output' in message flow 'Fileput_MessageFlow'. The remote user identifier supplied as 'FTPServerSecurityIdentity' is invalid.

To resolve this issue, execute the following command to configure the security identity. The security identity is used to retrieve the username and password from the broker registry. Use -n for the resource name, -u for the FTP server username, and -p for the password to access the FTP server.
mqsisetdbparms IIBNODE -n ftp::FTPServerSecurityIdentity -u ishfaq -p ibm@pass

After that restart the integration node and redeploy the application.


Open postman or any other HTTP client and send request to the message flow. You will receive a success response that the “Data has been successfully placed on FTP server”.

Access the FTP server using WinSCP or any other FTP client, and you will find the file there.

Summery
Data has been successfully written in a file on FTP server. If you have further questions or seek additional assistance, feel free to comment or explore the comprehensive resources available through IBM’s support docs. Happy integrating!
Leave a Reply