Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Json to XML Array within Array with Different Parent Names

Not applicable

I am trying to build an XML structure for a WSDL call, since there isn't a real proper way to send an arbitary size list of complex objects using the parameter passing method, I decided to use Json to XML. Here is my basic Json

school:{
    teachers : [

        {students :[{name: student1}, {name: student2}], name : teacher1},
        {students :[{name: student3}, {name: student4}], name : teacher2}
    ]
}

and what I want to see as an end result is

<school>
  <teachers>
    <name>teacher1</name>
    <students>
      <name>student1</name>
      <name>student2</name>
    </students>
  </teachers>
  <teachers>
    <name>teacher1</name>
    <students>
      <name>student1</name>
      <name>student2</name>
    </students>
  </teachers>
</school>

Using what Apigee Documentation

<ArrayRootElementName>Teachers</ArrayRootElementName>

It still would handle the Students properly, in fact it changes my Students to Teachers. Can someone help please.

Solved Solved
2 5 807
1 ACCEPTED SOLUTION

Not applicable

Hello Churk,

We also got your message on the Support Portal and we're under the impression that you will be sending us some of your files so that we can try them out here ourselves.

According to Alex Toombs of our Customer Suppport department "This could be a limitation in our conversion, and custom scripting may be required. It might also be a bug. From what I can tell, he's set it all up correctly.

If we can't find the answer (and I haven't yet), we may also need to solicit some input from Customer Success Team as this is their area of expertise."

We'll actively work with you to find a solution to your problem.

View solution in original post

5 REPLIES 5