Requirement
We had a requirement in Oracle Integration Cloud (OIC) to maintain a centralized Holiday Lookup.
The source system exposed a Holiday API, but the response was returned in a binary / non-readable format instead of structured JSON/XML.
To process this data, we implemented a common utility flow:
API Response → Read as text line by line → Extract DTSTART dates → Write dates into file → Update OIC Lookup
Solution Overview
Step 1: Call Holiday API
Invoke the external API and receive the holiday calendar response.
The response was received as opaque/binary content, so direct mapping was not possible.
Step 2: Read Binary Response Using Stage File
Use Stage File → Read Entire File / Read in Segments.
Configure:
Read file as text
Read record line by line
This converts the binary payload into readable rows.
Example response:
Plain text
BEGIN:VEVENT
DTSTART:20260101
SUMMARY:New Year
END:VEVENT
BEGIN:VEVENT
DTSTART:20260126
SUMMARY:Republic Day
END:VEVENT
Step 3: Use following-sibling to Fetch DTSTART
While iterating through records, use XPath following-sibling to access the next node and extract only holiday dates.
Sample expression:
Xpath
normalize-space(
replace(
replace(
following-sibling::ns31:ReadRecord[1.0]/ns31:Data,
'"',
''
),
';',
''
)
)
Explanation
following-sibling::ReadRecord[1] → Reads the next line after current record
replace() → Removes unwanted characters
normalize-space() → Cleans spaces
This helps extract values after detecting DTSTART.
Output:
Plain text
20260101
20260126
Step 4: Write Dates into File
Use Stage File – Write File action.
Generated output:
Csv
HOLIDAY_DATE
20260101
20260126
Step 5: Update OIC Lookup
Read the generated file and update the centralized Holiday Lookup.
Lookup example:
HolidayDate
IsHoliday
20260101
Y
20260126
Y
Final Flow
Plain text
Scheduler
↓
Call Holiday API
↓
Read Opaque/Binary Response
↓
Read Records Line by Line
↓
Use following-sibling to Extract DTSTART
↓
Write Stage File
↓
Update Lookup
Benefits
Reusable common holiday service
Centralized holiday maintenance
Avoids duplicate holiday validation logic
Supports binary/non-readable API responses efficiently in OIC
This approach allowed us to convert an unreadable API response into usable holiday dates and maintain a common lookup for all downstream integrations.


No comments:
Post a Comment