Hi Talend Community,
I have a rest service using tRESTClient that send parameters (header and body) via a REST GET call.
How can I see the URL being executed in its total string format.
tLogRow only shows the result set returned
Is your URL hard coded? If so, you should probably change that. Add it to a context variable. If you do that, you can change it without having to change the job and recompile it. You can also make use of the context variable in other areas quite easily.
The URL is not hardcoded, if I understand correctly - or is there something specific your are referring too?
Please see my config in the original post (screen captures).
You can use a tJava.....
System.out.println("My URL is: "+context.URL);
Or you can add it to a column in a tMap (for example) and use a tLogRow
I placed the tJava with code specified after my tRestClient and got :
Exception in thread "main" java.lang.Error: Unresolved compilation problem: URL cannot be resolved or is not a field
Ah I see. Replace the tJava with a tMap. Map the input columns to the output. Add an output column and put.....
.....in the new column. Keep the tLogRow connected (refresh the schema) and you will see the URL printed by the tLogRow
I don't have an example to hand, but I can talk you through exactly what you have to do...
1) Create a new context variable called "URL". Do this in the "Contexts" tab below your job.
2) Assign the URL context variable the url that you currently have in your tRestClient. Replace the URL there with the new context variable.
3) In your tMap click on the output table (on the right) so that it turns yellow. At the bottom of the screen you will see the schema. Click the green + (at the bottom of the page on the right) and add a String column called "URL" (or anything you think is appropriate).
4) You will see this new column appears in the output table (which turned yellow). Add.....
... to the column called URL. Do not use quotes.
Now when you run your job you should see the URL column appear in the tLogRow with the other output columns.
I explained how to do this in my other post. Follow the instructions step by step. Go to the section where I talk about creating a column in the yellow output table
Hard coded headers,
But I think I have a problem in translation:
I have a Authorization tag that needs to contain: Token token="729f70f8-67dd-86b9-0296-23d3a387a19e"
I have it configured as such:
I need to see the complete URI output to ensure Talend is parsing the parameters correctly and sending the correct URI
Your token is almost certainly formatted wrong and this is a different question. It is not a great idea to ask further questions on the same thread because it leads to useful answers being lost.
Raise another question about the headers and include the specification you are working from. We will need to see the requirements of the web service you are using. Trying to solve this question without seeing this will be like literally searching for a needle in a haystack..... in a collection of fields in a random country.