Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using Talend Open Studio for ESB - Version: 8.0.1. I have a job that loops thru data and creates a CSV for each data element, like this:
> ID DATA
> A QQQQ# $%$
> B WWWE^UTU
etc. The job creates FileA.csv, then FileB.csv etc. That all works, but the next step I need will take FileA.csv and POST that data to an API.
The URI for each file is different, so I'm using a context to create the link. The links look like this:
https://:@host/updatenodes?application_code=fileA
There is a different application code for each file. I've tested the link for these files in Postman, and they all work, here's the message:
"result": "success",
"message": "Update batch submitted with 0 items",
"threadId": []
So, the links are correct. In Talend ESB, I'm using a tFileFetch object with Post Method checked. The file image_Tal.png shows the settings
of the tFileFetch. When I use a context URL, I get this error:
> Exception in component tFileFetch_1 (Cognosos)
> java.lang.IllegalArgumentException: host parameter is null
I also tried hard-coding the full URL into the filefetch object, I get this error:
Sep 08, 2022 1:49:39 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: no further information
So, how do I post the data from the CSV to the API? I've tried tRest, but it wouldn't allow me to use a context variable as the URI.
Because each different file has a different ID/Password, I need to use a variable for each iteration in the loop. When I use a
context for the URI, it gives me the error "URI is not absolute". I had the same problem with RestRequest and RestClient.
Are there some settings I need to add to Talend ESB? I'm using the defaults now - I'm not sure what settings to change.
I've tried the tRest and tRestRequest objects, but I got and error using a context for the URI. I'm trying to get the CSV data to POST to the API.
Settings for the tFileFetch objects attached. It's cut off, but the Post Method checkbox is checked.
Can you show us your job and your tFileFetch advanced settings? Also, do you have the REST service specifications available? So far you've not quite given enough information. REST APIs are all very different and simple and very subtle variation from what the specification requires can cause issues.
Here are the advanced properties of the tFileFetch object. The data is saved in CSVs and then sent to the API. I'm not sure what service specs you mean? I've tried the https link in Postman and it worked. There is a header, but I've included that in the Talend object.
You said that the link looks like this.....
https://:@host/updatenodes?application_code=fileA
Yet in your advanced settings you have a parameter called "COG_CSV".
The API specification will tell you how to use the API and what parameters need to be set and how they should be set.
Yes like this:
https://<ID>:<Pass>@host/updatenodes?application_code=<Value for each file>
I'm building the link into a context because each file has a different link for the API.