AnsweredAssumed Answered

How to loop each element in XML Profile and call another webservice/process ?

Question asked by phani.kumar@enjoy.com on Aug 29, 2017
Latest reply on Aug 29, 2017 by Lee Sobotkin

Experts,  How to loop each element in XML Profile and call another webservice/process ?  

 

Example : My Input XMLProfile <customers>  holds 10 <customer> elements.  I would like to loop each <customer> element and call a credit-check webservice/process. How can we implement this use case in boomi ?

 

I cannot find any looping shape to loop each element in the xml profile, could some one guide me here?

 

Input XML Profile:

=============

<customers>

  <customer>

      <name>name1</name>

      <ssn>ssn1</ssn>

      <city>city1</city>

  </customer>

  <customer>

  <name>name1</name>

      <ssn>ssn1</ssn>

      <city>city1</city>

  </customer>

  <customer>

      <name>name1</name>

      <ssn>ssn1</ssn>

      <city>city1</city>

  </customer>

</customers>

 

Expected flow:

============

1)- Implement do-while (or any conditional looping) to get each <customer> element

2)- For each <customer> element call a webservice (third party)

3)- Get the webservice response and append it to response XML Profile

 

Expected Result

=============

<customers>

   <customer>

        <ssn>ssn1</ssn>

         <result>Credit score : xxxx</result>

   </customer>

   <customer>

        <ssn>ssn2</ssn>

         <result>Credit score : xxxx</result>

   </customer>

   <customer>

        <ssn>ssn3</ssn>

         <result>Credit score : xxxx</result>

   </customer>

</customers>

Outcomes