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
Hello,
It's not working well when you check out "Print response to console" option in tfilefetch component?
Can you use tfilefetch component to upload .zip file? No response?
Best regards
Sabrina
Hello,
My job is working well i can transfer the ZIP file and i print the result in the console.
My problem is that i want to catch the body response and log it in the DB.
Thanks,
Med
Hi,
Are you using tJava component to catch the body response and log it in the DB? If so, what does your java code look like?
Best regards
Sabrina
I used tjavarow to catch the schema but i had just null in Body column.
I read in talend doc that i should use the input_stream file but i don't know how to do it.
You have any idea or example which handle this kind of cases.
Thanks,
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
Thank you, that what i want.
BR,
Med
Hi,
Great it helps.
Feel free to let us know if there is any further help we can give.
Best regards
Sabrina