Suppose we want to call a Web Service for each Source record. In other words, generate and send a Request XML message to a Web Service for each source record and then save the Response XML locally in a folder with date/timestamp. Please check the information below on how to implement this solution in Adeptia.
Here are the steps:
1. Create the Web Service Consumer, and also create a XML schema for both Request and Response.
2. Create Source schema
3. Create Mapping between source and request XML.
A. Select the root of the Target node and then create three local variables.
varRecordCount > count($Input_TextSchema_sourceData/Root/Record)
varSetCount > set-context(totalCount , $varRecordCount)
B. In the target root node properties panel, put this in the For Each field:
$Input_TextSchema_sourceData/Root/Record[position() = $varGetCurrentCount]
C. For the target root node, create a global variable
varGetCurrentCount > get-context(currentCount , 1)
4. In the process flow put the Mapping after a decision node.
For the sub-flow that will contain the mapping and the Web Service call, put this java rule as shown in the image below.