Midhun Mathew
Midhun Mathew

Reputation: 319

Schema Mapping Single object schema with List of Object schema

I have an input schema which contains a single object in which it have a root node and a datanode and the elements. I have a WCF Method which accepts List of objects as input. I am trying to map these two schemas. But when i am sending the input file it only transforms the first set. enter image description here

Is there anything additional I have to do to map this? Input Schema

<ns0:Emp xmlns:ns0="http://SampleAppWithExcelToXmlWCF.InputSchema">
 <Add>
  <EmailId>EmailId_0</EmailId> 
  <Phone>Phone_0</Phone> 
  <EmpName>EmpName_0</EmpName> 
  <EmpNo>EmpNo_0</EmpNo> 
  <ActiveInd>ActiveInd_0</ActiveInd> 
  </Add>
  <Add>
  <EmailId>EmailId_1</EmailId> 
  <Phone>Phone_1</Phone> 
  <EmpName>EmpName_1</EmpName> 
  <EmpNo>EmpNo_1</EmpNo> 
  <ActiveInd>ActiveInd_1</ActiveInd> 
  </Add>
  <Add>
  <EmailId>EmailId_2</EmailId> 
  <Phone>Phone_2</Phone> 
  <EmpName>EmpName_2</EmpName> 
  <EmpNo>EmpNo_2</EmpNo> 
  <ActiveInd>ActiveInd_2</ActiveInd> 
  </Add>
  </ns0:Emp>

Above is the input schema sample

As output I want it to be multiple EmployeeDO's as in the schema

The input schema is generated by using a custom ExcelToXML Convertor Pipeline.

Upvotes: 0

Views: 80

Answers (1)

DTRT
DTRT

Reputation: 11040

  1. Connect Add and EmployeeDO with a Looping Functiod.
  2. You may have to adjust the min/max Occurs on both sides since that does have an effect, despite the Looping Functoid. Basically, both should be max=unbounded.

Upvotes: 3

Related Questions