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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

tRestResponse Help

Is there any way to capture the "response" which is generated from tRestResponse (after the response is sent)? I have a need to save the responses for audit purposes.

 

 

java.util.Map<String, Object> response = (java.util.Map<String, Object>) globalMap.get("restResponse");
System.out.println( "Res: " + response );

--> This gives:
{drop.json.root.element=true, STATUS=200, HEADERS={}, BODY=org.dom4j.tree.DefaultDocument@32f7902f [Document: name null]}

System.out.println( "ResStream: " + (String) globalMap.get("restResponseStream") );
--> This is null

I tried above globalMap values, but am unsuccessful. 

Labels (1)
  • Other

6 Replies
Anonymous
Not applicable

Hi,

 

tRestresponse has it own schema. Use that schema only to get output. Response comes under that schema only.

root
Creator II
Creator II
Author

@kate: I am not sure if I am following you. I need to capture the "response" generated by tRestResponse. Something to the effect of the headers and payload generated to be sent out. I do not see any OUT links coming from the tRestResponse component.
root
Creator II
Creator II
Author

Shameles bump. Is it even possible to capture the payload once its sent? the tRestResponse component does not seem to have any output links/ globalmap variables to use. Any help is appreciated. Thank you

root
Creator II
Creator II
Author

Shameless bump. Any help appreciated!
Anonymous
Not applicable

Hello,

Do you want to output the response on console to a specific file?

Best regards

Sabrina

 

root
Creator II
Creator II
Author

@xdshi: Well, I was thinking to save it in a DB table. but I can definitely live with the fact that a file can hold the response for each request.

I checked tesb.log and it contains lots of these request/ responses. But, going through multiple files is a very exhaustive process to find a particular request/ response