Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
med1
Creator
Creator

Issue with tRest

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

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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.

https://exchange.talend.com/#marketplaceproductoverview:marketplace=marketplace%252F1&p=marketplace%...

Best regards

Sabrina

 

 

View solution in original post

16 Replies
Anonymous
Not applicable

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

med1
Creator
Creator
Author

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

Anonymous
Not applicable

Hi,

Here is an option "Print response to console" in advanced settings of tFileFetch component.

Best regards

Sabrina

med1
Creator
Creator
Author

 

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

Anonymous
Not applicable

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

 

 

 
med1
Creator
Creator
Author

 

I will try it.

 

Thanks,

Med

Anonymous
Not applicable

Hi,

Don't hesitate to post your issue here.

Best regards

Sabrina

med1
Creator
Creator
Author

 

 

So i tried to catch the ouput but i still have only null.

 

attached the screen of execution.

 

Any help.

 

Med,


tFileFetch.PNG
med1
Creator
Creator
Author

 

Any feedback ?

 

Thank,

Med