Hi EveryOne,
I am trying to get the value for ResponsePhrase of ServiceCallout policy for logging .
so I have configured the following code in Javascript which is populating a "Empty" value in trace.
context.setVariable("responsePhrase",context.getVariable("message.reason.phrase"));
can you tell me where I am doing wrong.
Hi
@VENKATA LAKSHMI KONDAPALLI - The Service Callout has its own request and response variables, which you define in the policy. The defaults are myrequest
and calloutResponse
. So instead of message.reason.phrase
, try calloutResponse.reason.phrase
.
It's covered here in the docs:
http://docs.apigee.com/api-services/reference/service-callout-policy#flowvariables
Hope that helps.