• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How to get multiple rows from webservice?

#1 2008-11-11 17:16:18

mmechtch
New member
Registered: 2008-10-10
Posts: 4

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[i][0];
     output_row.address = result[i][1];
}

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

Offline

#2 2008-11-17 17:52:35

mmechtch
New member
Registered: 2008-10-10
Posts: 4

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

Offline

#3 2010-07-16 10:29:16

silkio
Guest

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[i][0];
     output_row.address = result[i][1];


missing out the final bracket

you then set the Match Brackets drop down to }

This works for me.

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How to get multiple rows from webservice?

Board footer

Powered by FluxBB