I need some help with the use of t_rest_client Compionent.
I have in my sub_job a restfull Call (GET) that extract some records from my oracle db and then these records are sent to another db. I'm receiving an error when the GET retrieve an empty data set.
How can I handle this issue?
I'm getting back a statusCode = 200, so it's like everything has gone well.
@TRF, the issue is that my data set from which I'm trying to get the data is empty at the moment.
If I execute the same SELECT in SQL i get back an empty dataset. But this is correct as the table from which I'm reading has no value.
I'm trying to figure it out how to manage the fact that the origin dataset is empty and that the reply that I receive from the REST call (i can see the message in the command line when I execute the job) is "Trying to write END_DOCUMENT when document has no root (ie. trying to output empty document)."
tRESTClient component, go the advanced settings of this component.
There you will see a checbox : Convert response to DOM Document.
The response you receive from your server is processed by the tRESTClient component as DOM (XML) . It expects a response which is correctly formatted XML.
The server however send malformed XML because there's no data to return.
Try it with a table with data and see if it works... to be 100% sure and to isolate the problem.
now I get it. I have already tried to call the tRestClient (GET) that extract from the same table wiht data inside and this works. The problem is that this table is going to stay empty for some time, but during this period I need the job to run correctly also if the source table is empty.
For now I solved partially the issue inserting a dummy record inside my table, but it would be nice to understand how to manage this call also with an empty source table....
Join us live for a sneak peek!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.