I am performing a ServiceCallout that executes successfully, the response is JSON and I can see the response in the Service Callout Response under "Body" as well as the ServiceCallout.response property. However I am assigning the response to a variable but that is not being set.
Under variables I see "baas.request" which is assigned in an earlier AssignMessage, that works fine, but I don't see "baas.response" anywhere. Here is my service callout:
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-BaaS"> <DisplayName>Service Callout BaaS</DisplayName> <Properties/> <Request clearPayload="false" variable="baas.request"/> <Response>baas.response</Response> <HTTPTargetConnection> <Properties/>... more stuff...
As you can see the Response should be assigned to "baas.response". This is not set, I can't see it anywhere in the trace steps. In addition, what is strange is that I am using this variable in an ExtractVariables policy with continueOnError set to "false" and i'm not getting an error, nor am I getting any values, nor am I seeing the variables populated.
<ExtractVariables async="false" continueOnError="false" enabled="true" name="Process-BaaS-response"> <DisplayName>Process BaaS response</DisplayName> <Properties/> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <JSONPayload> <Variable name="broker_name" type="string"> <JSONPath>$.entities[0].name</JSONPath> </Variable> </JSONPayload> <Source clearPayload="false">baas.response</Source>
In the above you can see the Source is set as "baas.response". If I change it to something else like "xyz" that does not exist I get an error saying "xyz does not exist" so it looks like the variable is somehow detected but it does not appear in trace nor does it work.
Ideas?
Solved! Go to Solution.
Hi @Kevin A,
The response value will be stored in the variable baas.response and can be accessed by querying for
baas.response.content
Refer to the following variable definition -
|
Read more - Service Callout Policy
You can set this to false if you want the service callout policy to throw an error when the referenced variable is unresolvable.
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
Set to true
to treat any unresolvable variable as an empty string (null). Set to false
if you want the policy to throw an error when any referenced variable is unresolvable.
Read more - IgnoreUnresolvedVariables element
Keep us posted, Thanks