Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Processing Flat Files | Sending and Receiving Flat Files | Sample Flow Services for Working with XML Files | Creating a Service that Retrieves the XML File
 
Creating a Service that Retrieves the XML File
The following shows a sample flow service for retrieving data from an XML file.
Sample code for retrieving data from an XML file
Flow Operation
Description
1
Invoke the pub.file:getFile service to retrieve the XML file from the local file system. The XML data must conform to the following XML schema:
Integration Server_directory \instances\instance_name\packages\WmFlatFile\pub\FFGeneration.xsd
For more information about this service, see the webMethods Integration Server Built-In Services Reference.
2
Invoke the pub.string:bytesToString service to convert the file (in bytes format) to a String. For more information about this service, see the webMethods Integration Server Built-In Services Reference.
3
Invoke the appropriate service to make your changes to the Integration Server namespace. In this sample, the flow service invokes the pub.flatFile.generate:saveXMLAsFFSchema to save the XML data as a flat file schema in the Integration Server namespace.
With the INVOKE saveXMLAsFFSchema flow operation selected, in the pipeline, map the output from the pub.string:bytesToString service to the FFXML input of the pub.flatFile.generate:saveXMLAsFFSchema service.