Use case :
Lets see the development steps in detail :
STEP 1: In the Designer window click Integration and then click Create
In this blog we will see how to perform Write operation using FTP adapter in OIC. In this POC we will develop an integration which will take some Inputs and that inputs will get saved as .csv file in remote FTP location.
Knowledge : 👀 Click to know about basics of FTP
Lets see the development steps in detail :
STEP 1: In the Designer window click Integration and then click Create
- Select App Driven Orchestration
- Enter the below details and then click Create :
*What do you want to call your Integration? - write some meaningful name
*What can this Integration do? - write some meaningful description
Knowledge : 👀
Packages ? : You can group one or more integrations into a single structure called a package to easily import and export them to and from OIC service. Packages being optional, integration do not be a part of them. At least one integration is needed for a package to exist.
STEP 2 : Search for the REST connection name ' RESTConnection ' and Select it.
( You can access this blog to configure this REST connection )
- Enter the below details and click Next - [as shown in below image ]
*What is the endpoint's relative resource URI ? :You can give any meaningful word with "/" Example : /employeeDetails
*What action do you want to perform on the endpoint ? : Select POST
&
Select Configure a request payload for this endpoint
Select Configure a response payload for this endpoint
- Choose the above saved schema "EmployeeDetails.xsd" in next window and then click NEXT.
- Select JSON Sample and then click inline to add response payload
- Enter sample JSON → {"Response" : "" } and click OK
- Click NEXT
- Click DONE
STEP 3 : Search for the FTP connection name → " FTP_Test " which we have created in the previous blog.
- Enter below details and then click NEXT :
*What do you want to call this endpoint : write any meaningful name
*What does this endpoint do : write meaningful description
- Enter the below details and then click NEXT :
*Select Operation : select Write File
*Select a Transfer Mode : select ASCII
*Output Directory : write / (as shown in below image )
(here you can provide your directory path where you want to generate the file)
*File Name Pattern : write EMP_%SEQ%.csv
(here you can provide any meaningful file name)
Emp_Id,Emp_FirstName,Emp_LastName,Emp_Designation,Emp_DC_Location
*Enter the Record Name: Employee (you can write any meaningful name)
*Output Directory : write / (as shown in below image )
(here you can provide your directory path where you want to generate the file)
*File Name Pattern : write EMP_%SEQ%.csv
(here you can provide any meaningful file name)
- Select Sample delimited document (e.g CSV ) and click Next
- Paste the below text in notepad or any text editor tool and save it as Employee.csv
Emp_Id,Emp_FirstName,Emp_LastName,Emp_Designation,Emp_DC_Location
- Configure the below details and then click NEXT :
*Enter the Record Name: Employee (you can write any meaningful name)
*Enter the Recordset Name : EmployeeDetails
(you can write any meaningful name)
(you can write any meaningful name)
**Make sure to change the datatype of Emp_Id to Integer (as shown in below image)
- Click Done
STEP 4 : Open the FTP adapter mapper and map the columns accordingly
**Make sure to map the Employee node also to configure for each
- you can see the foreach function by clicking on Advance tab
- click Validate and close the mapper.
STEP 5 : Now open the response mapper
- Right click on Response and then select Create Target Node
- Write "Success" in editor window and click Validate and Close the mapper.
STEP 6 : Add the Tracker for your Integration :
Right click on Hamburger sign and then click on Tracking
- Map Emp_Id as tracking variable and then click Save
Knowledge : 👀
Assigning Business Identifiers for Tracking Fields ? : Business identifiers enable you to track payload fields in messages during runtime.You must assign business identifiers before you can activate an integration.STEP 7 : Click Save and then Close the integration. Your Integration is ready to test.
TESTING STEPS :
- Activate the Integration and copy the Endpoint URL
- Click on Endpoint URL (as shown in below image )
- Copy the Endpoint URL
- Open SoapUI tool (5.5.0):
- Click on REST
- Then Paste the above copied endpoint URL and then click OK
- Configure the REQUEST PAYLOAD ( as shown in below image):
- Method : POST
- Media Type : application/xml(download the xml file & paste the same in SoapUI)
Now click on RUN and if everything works fine you will see RESPONSE message in RESPONSE Payload of SoapUI as shown in below image
OR You can test using Postman Tool :
Open FileZilla Tool :
Enter the FTP Connection details (you can see the previous blog for FTP Credentials)
Click OK
file got generated in "/" directory of FTP
Download the file to you local system and opened it. You will see the below data
Thanking You !
Can you please share an example of how zip multiple files using ftp adapter and send the zip file to another sftp server
ReplyDeleteHi Kabir,
ReplyDeleteIt is nice..
Please explain the process how we will generate EmployeeDetails.xsd file
create XML file according to you requirement and then You can easily generate XSD file from the XML file on google. Just search 'generate XSD from XML".
DeleteHow can I add headers?
ReplyDeletein mapper image (just above step 5) repeat the 'Employee' node by right clicking it and select 'Repeat Node'.
DeleteAnd after that just hardcode your Header Name in it. I hope this will resolve your issue :)