Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I want to post ZIP File with tRest but it is not working. I tried tFileFecth and it is working however i can't catch the output response to log the error code.
I used the same config parameters as the talend documentation but i still have the same error code 400.
Please find attached the parameters for my config ( i declared the import java.io.FileInputStream in tjava juste before the tRest Component). Any help plz.
Thanks in advance,*
Med
Hi,
You can do this with a little Java code in a tJava component at the beginning of your Job. Such as:
java.io.File outputFile = new java.io.File("e:/output.txt");
System.setOut(new java.io.PrintStream(new java.io.FileOutputStream(outputFile, true), true));
If you don't want pure java, here is a custom component tRedirectOutput which is used to redirect all the message printed on the console to a file.
Best regards
Sabrina
Hi,
Have you tried to use tRestClient component with MIME Multipart Form Data POST request for your job requirement?
Here is a tech article about:
http://talend.nl/talend-tech-tip-calling-a-rest-service-for-file-upload/
Best regards
Sabrina
I tried but it didn't work.
The only option i have now is to use tFileFetch but i still don't have any solution to catch the output response ?
Any idea ? i should handle the response to log the status of the output.
Thanks,
Med
Hi,
Here is an option "Print response to console" in advanced settings of tFileFetch component.
Best regards
Sabrina
Yes i print the response but in our company we have table of logs so i should log the response but i can't catch it.
In tRest for example you can handle the response using tMap but for the FileFetch i don't know how to do it
Thanks,
Med
Hello,
tFileFetch is generally used as a start component to feed the input flow of a Job and is often connected to the Job using an OnSubjobOk or OnComponentOk link, depending on the context.
Actually, you can collect console output data to a csv file by using a tJava component.
Best regards
Sabrina
I will try it.
Thanks,
Med
Hi,
Don't hesitate to post your issue here.
Best regards
Sabrina
So i tried to catch the ouput but i still have only null.
attached the screen of execution.
Any help.
Med,
Any feedback ?
Thank,
Med