Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Assign Message - AssignVariable JSON content

VAP
Bronze 4
Bronze 4

Hi,

I want to save the request body sent to the target server, for latter log. For that I used a AM policy in the postflow of the target 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SetVarsToTarget">
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <DisplayName>AM-SetVarsToTarget</DisplayName>
    <AssignVariable>
        <Name>target.request.body</Name>
         <Value>DefaultReq</Value>
        <Ref>message.content</Ref>
    </AssignVariable>
    <AssignVariable>
        <Name>target.request.querystring</Name>
        <Ref>message.querystring</Ref>
    </AssignVariable>
</AssignMessage>

But when I try to use the target.request.body variable in the PostClientFlow, for logging purposes the variable is empty. When using the debug view I see a unequal sign next to the variable

VAP_0-1651865328103.png

Any clues of what I'm doing wrong here?

Thanks!

Solved Solved
0 3 1,878
1 ACCEPTED SOLUTION

YES

The ''unequal" sign means you cannot assign to that variable. (More precisely, it means the assign failed). I believe you want target.request.content.

Can you try assigning to that?

View solution in original post

3 REPLIES 3