Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, all!
I have a web service that accepts XML data consisting of the TransactionHeader and EmployeeGet sections. TransactionHeader is cut out by tXMLMap1 and goes unchanged into the result, and the EmployeeGet is passed as a parameter for querying the databases. The databases return the employee tables and their roles, which are linked by the tMap. One employee may have multiple roles.
Before tXMLMap3 i have TrasactionHeader rows and Employee data rows (Name, SecondName, RoleNumber) for example:
Adam, Smith, 2
John, Bolton, 3
Mary, Stark, 3
Mary, Stark, 2
Result must be:
<TransactionHeader xmlns="http://wa.dms.webservice/EmployeeGetRequest">
SomeHeaderData
</TransactionHeader>
<Employees xmlns="http://wa.dms.webservice/EmployeeGetRequest">
<Employee>
<LastName>Smith</LastName>
<FirstName>Adam</FirstName>
<Roles>
<Role>
<RoleName>2</RoleName>
</Role>
</Roles>
</Employee>
<Employee>
<LastName>Bolton</LastName>
<FirstName>John</FirstName>
<Roles>
<Role>
<RoleName>3</RoleName>
</Role>
</Roles>
</Employee>
<Employee>
<LastName>Stark</LastName>
<FirstName>Mary</FirstName>
<Roles>
<Role>
<RoleName>3</RoleName>
</Role>
<Role>
<RoleName>2</RoleName>
</Role>
</Roles>
</Employee>
</Employees>
How do I configure the tXMLMmap3 to get this result? Where to put loop?
When i set loop to <Employee> i got duplicate records for Mary Stark.
When i set loop to <Role> i got just one record <Employee> and many roles such as
<Employees xmlns="http://wa.dms.webservice/EmployeeGetRequest">
<Employee>
<LastName>Smith</LastName>
<FirstName>Adam</FirstName>
<Roles>
<Role>
<RoleName>2</RoleName>
</Role>
<Role>
<RoleName>3</RoleName>
</Role>
<Role>
<RoleName>3</RoleName>
</Role>
<Role>
<RoleName>2</RoleName>
</Role>
</Roles>
</Employee>
</Employees>