Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For this flow here https://community.talend.com/t5/Design-and-Development/No-response-is-coming-from-tRestResponse/m-p/...
I'm not able to get all the 100 rows that are coming from the database.
can you please help.
thanks!
Your XML structure is not configured to loop. You need a looping element in there. You simply have two elements sitting inside the Root element. That won't work.
You are not joining your input row to your lookup row either. This will mean you get the same result no matter what is sent to the service. That can't be correct, can it?
Add a looping element to your output XML and test it with a tLogRow. If you follow the guide after doing that, you will see 100 loops in a single XML file
Can anyone help with this issue?
Thank you!
A REST service works by receiving a call and returning a response for that call. You will only get 1 response for 1 call. What exactly are you looking to achieve here? If you are hoping to send back 100 messages, that won't be possible. If you are wanting to send back an XML file with 100 looping sections in it, that is possible.
Right, I'm trying to get a 100 rows from the database and send it back in one response, I tried tXMLMap but it didn't work.
Take a look at this page: https://help.talend.com/reader/ixBASPZJ7IvqUQVupZwWbg/EFuE5Nul595D24TRwbFnbw
Also, remove your service components and just try it as a job first. Output to a tLogRow. That makes it easy to see when you've got it right. Then attach the service components again.
I reviewed that, my case is different, I have connected my Teradata connection through a lookup to tXMLMap I would like to lookup a 100-1000 rows and map it in tXMLMap then send it to the response, but the problem is that I'm getting only one row back:
{
"root": {
"accountId": 999999999,
"rank": 1
}
}
is the problem with the lookup? or the mapping?
Your XML structure is not configured to loop. You need a looping element in there. You simply have two elements sitting inside the Root element. That won't work.
You are not joining your input row to your lookup row either. This will mean you get the same result no matter what is sent to the service. That can't be correct, can it?
Add a looping element to your output XML and test it with a tLogRow. If you follow the guide after doing that, you will see 100 loops in a single XML file
Great, I just added the looping element and it worked. My initial understanding is that the root loop can make it work without me adding a looping element. Make sense?
I'm not joining my input row to the lookup because I wanted to get the looping part done first then I'll connect it together.
Thank you for your help, my final question would be why I'm getting numbers in the JSON istead of String values, although I explicitly converted the rank using a toString() method?
I'm not sure about your data types to be honest. It is hard to figure out what is going wrong without having access (so I can see all inputs and outputs, etc). However, have you tried assigning your value like below (assuming your inputs are ints or other number types)....
row.columnValue + ""
That might solve your issue.
This solved the problem, thanks!
Now I got to the linking part, I've been googling around, and I couldn't find away to link a variable to a lookup table, I'm trying to link the variables coming from the service request:
Here is my query
"select acct_id, rank() over (order by acct_id desc) as myrank from xxxxxxxxxxxxxxxxxxx qualify myrank between " + Integer.parseInt(request.key) + " and " + request.customfield_10003
the error is "request cannot be resolved to a variable", is it allowed to to be used like this?
Your help is appreciated!