Seven Stars

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. 

6 REPLIES
Five Stars

Re: tRestResponse Help

Hi,

 

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

Seven Stars

Re: tRestResponse Help

@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.
Seven Stars

Re: tRestResponse Help

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

Seven Stars

Re: tRestResponse Help

Shameless bump. Any help appreciated!
Moderator

Re: tRestResponse Help

Hello,

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

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seven Stars

Re: tRestResponse Help

@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