5.17.1 What can I use the XMLBindFileService for?
To receive an order in XML format and send a reply
You may be receiving orders from a distributor in XML document 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 XML Binding Wizard, in LANSA Integrator Studio, to bind the XML elements to field names that are used in your application. Once you have done this you would use the XMLBindFileService 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 XMLBindFileService can be used to create an XML document 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 XML documents into a directory? You could use the LIST command that comes with the XMLBindFileService. 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.
Passing 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. XML is becoming the preferred approach for the movement of such data. Since this is within your organisation, the job is easier for you, as you control both sides of the equation. Oracle might have its own way of generating the XML data that you are after, and if it does not, you could use the XMLBindFileService to transform the data you need moved into an XML document using the SET and WRITE commands and place it on the network drive. Once created, an application on the IBM i could be kicked into action to READ the generated XML documents so that the data can be made available to the IBM i.