One Star

Call WebService for each row in file and merge results

Hi,
I've searched the forum many times over and tried many combinations of components, including tFlowToIterate, iMap, tUnite, tForEach,...
I'm trying to loop through the rows in an Excel file and call a web service for each row (this part I've figured out). Then I need to take the return value from the web service and merge it's value with the columns from the Excel file row that I was processing at the time. I cannot figure out a way to perform the merge.
An example is shown:
Excel File Input
First Name Last Name
-----------------------------
John Smith
Joe Brown
James Miller
For each row, my web service will return a value. I want my final output to resemble:
Output File
First Name Last Name WSValue
------------------------------------------
John Smith 2343
Joe Brown 2347
James Miller 3432

All help and suggestions are appreciated!!!
BTW - I love Talend, thank you very much everyone who contributes to this awesome product!
Mick
2 REPLIES
Community Manager

Re: Call WebService for each row in file and merge results

Hello
Using the method: Numeric.sequence("s1",1,1) provided by Talend to generate a sequence number, for example:
ID First Name Last Name
-----------------------------
1 John Smith
2 Joe Brown
3 James Miller
The same way for WSValue
1 2243
2 2347
3 3432
Then, do a inner join on tMap.(see the screenshot)
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Call WebService for each row in file and merge results

Ah, excellent idea, Thank you shong!
I played around with this for many hours yesterday and did not think of that.
Mick