File upload is a very common aspect of each and every technology we used in our day to day projects as part of the REST service. This is very common requirement to upload a file that resides in the local computer and send it to the remote computer.
Sometimes we need to expose a REST service which should allow to upload files, process the data and store it some repository like a database, FTP etc..
In this blog, we are going to show how to use ICS REST adapter feature to upload a file and save the file as it is on some FTP location.
Below are the steps to achieve the use case:
There is one dedicated blog that explains, how to configure REST Adapter in Oracle ICS. Please have a look at the blog
Create FTP Adapter as Invoke
This has also been explained in another blog that shows, how to configure FTP Adapter in Oracle ICS. Please have a look at the blog
Create an Orchestration Integration
Create an Orchestrated Integration using steps:
Sometimes we need to expose a REST service which should allow to upload files, process the data and store it some repository like a database, FTP etc..
In this blog, we are going to show how to use ICS REST adapter feature to upload a file and save the file as it is on some FTP location.
Below are the steps to achieve the use case:
- Create REST Adapter as Trigger
- Create FTP Adapter as Invoke
- Create Orchestration Integration
- TEST the Integration
There is one dedicated blog that explains, how to configure REST Adapter in Oracle ICS. Please have a look at the blog
Create FTP Adapter as Invoke
This has also been explained in another blog that shows, how to configure FTP Adapter in Oracle ICS. Please have a look at the blog
Create an Orchestration Integration
Create an Orchestrated Integration using steps:
- Login into ICS console
- Click on the Integration tile from ICS home page
- Click on Create button from upper right corner
- Select Orchestration pattern from the dialog box
- Enter Below information and click on Create button
- Select Application event or business object radio button
- Enter Integration Name in What do you want to call your integration text box
- An Identifier would be picked up automatically from Integration name, however, we can edit it
- Let the Version as it is
- Enter the description in What does this integration do input box
- Leave the package input box as it is
- Drag the TEST_REST_Conn Connection on the canvas from REST connection
- Enter below information and Click Next
- Name of the endpoint
- Relative URI(must start with /)
- Select HTTP verb as POST
- Select Configure a request payload for this endpoint checkbox- This option allows us to assign payload in the next step
- Select Accept attachments from request and Request in HTML form checkboxes then click Next and Done button
- Drag & Drop the FTP connection on the canvas
- Enter the Name in What do you want to call the endpoint input box and click Next button
- Enter below information and click Next button
- Select Operation: Select Write File
- Select a Transfer Mode: Choose ASCII
- Specify an Output directory: Enter the directory where you want to save the uploaded file
- Specify a File Name Pattern: Enter the file name
- Choose No under the Do you want to define a schema for this endpoint and click Next -> Done button
- Edit the mapper and map the below
- execute -> attachments -> attachment -> attachmentReference to ICSfile -> FileReference
- partName -> fileName
partName element would contain the file name that will be uploaded
That configuration completes the integration.
Let's test the integration using POSTMAN tool:
Check the FTP location output directory that has been given during configuring FTP adapter.
Tidak ada komentar:
Posting Komentar