CAP from file drop to API in a few simple steps
Keywords:
File drop, sun-setting, transformation, XML
The context:
A company has had a long time solution where customers provide a file with XML based information, which in turn is processed via a batch call to a Version 1 API and a return file with responses is provided. The company wishes to transform this process into a direct version 2 API SOAP call against a new system, without the need to continue to maintain two systems. The problem is that not all customers are prepared to migrate to the new version 2 API for cost reasons.
The solution:
Using CAP, the dropped files where picked up and the XML data within them were transformed into a format suitable for the version 2 API call. The call was then performed and the API response in turn converted back to the version 1 data format and collated into a file.
Deployment diagram:

Why CAP:
CAP is capable of interacting with a vast array of data sources, protocols and APIs out of the box. In this case, the built in file drop monitoring, XML transformation capabilities and abilities to call the version 2 API directly all counted towards the decision.
The story:
Upon discovering through their sales representative that a substantial number of customers were unwilling to modify their old legacy systems to conform to the new API, the company was faced with a choice of either maintaining 2 almost identical systems or somehow connect the old file drop method with the old file format into the new version.
Maintaining two systems was deemed impractical and risky, so CAP was brought in to solve the problem.
Using the CAP Feed Server, the initial files were picked up. To guard against record duplication, CAP performs duplication checks first and drops duplicate records before further checks.
Secondly it pre-validates some fields using local validation rules (for example company number), as the new version 2 API were missing these features.
Finally, the supplied version 1 XML was transformed into version 2 and transmitted to the version 2 API using HTTP and SOAP.
This approach ensured that not only did the customers maintain the capability to perform file drops, but they also retained the local validation rules of the previous version.
It is worth mentioning here that this solution has proven a stand-out success with CAP not being rebooted or offline for years.
Rules blocks and components used:
XLS transformation
String manipulation
ID Check Rules
HTTP Rules
XML File Input Adapter
Last updated

