Six Stars

Loop not working on REST service output

Hi -

 

I am trying to execute a REST client that returns looped row data. I want to input this data to a database.

However it seems that the tXML item is not looping the data element

job.pngtmxl.png

 

  • Big Data
  • Data Integration
  • ESB
Tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Six Stars

Re: Loop not working on REST service output

That is not the default, I had to configure it to get the body message.

How would a loop example look, as my main states loop for the root element?

Ten Stars

Re: Loop not working on REST service output

What I meant was this (circled) is a default Talend config......

tmxl.png

 

In order to return multple rows you will need to put that "loop" config on an element which is the parent of a looping section.

 

However, it doesn't look like your XML is looping. I would expect something like below from a looping xml....

<root>
<cmdb_id></cmdb_id>
<status></status>
<datas>
<data>
<bytes_in></bytes_in>
<bytes_out></bytes_out>
<bytes_total></bytes_total>
<ip></ip>
</data>
</datas>
</root>

Look at the "datas" (sorry, a bad plural for data) element. It contains a complex type that is looping. A loop needs a container in good XML.

Rilhia Solutions
5 REPLIES
Ten Stars

Re: Loop not working on REST service output

Your XML structure does not look like it has any legitimate XML loops

Rilhia Solutions
Six Stars

Re: Loop not working on REST service output

There is a loop on the main. should I do the same for the output?


Ten Stars

Re: Loop not working on REST service output

That is not a loop. That is a default configuration that Talend uses. The XML structure does not look like it supports loops properly.

Rilhia Solutions
Six Stars

Re: Loop not working on REST service output

That is not the default, I had to configure it to get the body message.

How would a loop example look, as my main states loop for the root element?

Ten Stars

Re: Loop not working on REST service output

What I meant was this (circled) is a default Talend config......

tmxl.png

 

In order to return multple rows you will need to put that "loop" config on an element which is the parent of a looping section.

 

However, it doesn't look like your XML is looping. I would expect something like below from a looping xml....

<root>
<cmdb_id></cmdb_id>
<status></status>
<datas>
<data>
<bytes_in></bytes_in>
<bytes_out></bytes_out>
<bytes_total></bytes_total>
<ip></ip>
</data>
</datas>
</root>

Look at the "datas" (sorry, a bad plural for data) element. It contains a complex type that is looping. A loop needs a container in good XML.

Rilhia Solutions