One Star

How to get multiple rows from webservice?

Hi!
I call a webservice that can return multiple objects.
How do I make tWebserviceInput component to output several rows?
I use tWebserviceInput in advanced mode. Standard example is to do this :
for(int i = 0; i < result.length; i++){
output_row.name = result;
output_row.address = result;
}
But, obviously, this will result in one one row being output.
This si what happens.
So is there a way to output several rows?
Thanks,
Marina
2 REPLIES
One Star

Re: How to get multiple rows from webservice?

I answer myself in case somebody wans to know if there is a solution.
I could not get it done with iWebserviceInput. I ended up creating tJavaFlex that calls webservice code and then iterates through the lines of the result. This component has output links "Main" and "Interate" so I can use a resulting lines normally
One Star

Re: How to get multiple rows from webservice?

To get the tWebserviceInput component to output multiple rows you need to use the Match Brackets drop down on the advanced settings of the tWebserviceInput component see post:
http://www.talendforge.org/forum/viewtopic.php?pid=32477
In your example you would put
for(int i = 0; i < result.length; i++){
output_row.name = result;
output_row.address = result;

missing out the final bracket
you then set the Match Brackets drop down to }
This works for me.