Pass Data Between Internal Systems
Many companies face the problem of how to integrate data from disparate systems. They might be running Oracle financials on a Windows server, and have a home grown RPG or LANSA system running on an IBM i server, and need to move data between the two systems. JSON is becoming the preferred approach for the movement of such data.
To receive an order in JSON format and send a reply
You may be receiving orders from a distributor in JSON format, so you need a way to transform the data held within the document to information that is useful to your application - specifically, fields and lists (in the case of LANSA applications), and subfiles (in the case of RPG, for example). As a first step in the exercise you would use the JSON Binding Wizard, in LANSA Integrator Studio, to bind the JSON elements to field names that are used in your application. Once you have done this you would use the JSONBindFileService in your application to read the data into application fields and lists (using the READ and GET commands). After that has been completed, your application can then do what it needs to in order to process the order into your system.
In many cases, you will need to send some form of acknowledgement back to the sender. This time, the JSONBindFileService can be used to create a file as a response, specifically using the WRITE and SET commands that come with this service.
How would you handle a situation where you have received many JSON documents into a directory? You could use the LIST command that comes with the JSONBindFileService. This will supply you with a list of all the files that are in the directory, and you can then use that list to process the files that you want to process.