HI,
I am using Extract policy to extract the json request and need to assign using Assign message policy , but getting blank json o/p as below :
{ "comment" :"", "jokeid" : "", "commentor" : "" }
My Extract policy o/p is displaying correct as below :
{ "comment" :"XXXX", "jokeid" :3112, "commentor":"YYYYY" }
I need to assign this o/p using Assign Message Policy but getting blank values as shown above.
Extract Policy Code :
<ExtractVariables name="Extract-Comments"> <DisplayName>Extract Comments Post</DisplayName> <Properties/> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <JSONPayload> <Variable name="comment"> <JSONPath>$.comment</JSONPath> </Variable> <Variable name="commentor"> <JSONPath>$.commentor</JSONPath> </Variable> <Variable name="jokeid"> <JSONPath>$.jokeid</JSONPath> </Variable> </JSONPayload> <Source clearPayload="false">request</Source> </ExtractVariables>
Assign Message policy code :
<AssignMessage name="Assign-Comments"> <DisplayName>Assign Comments</DisplayName> <Set> <Payload contentType="application/json">{ "comment" :"{comment}", "jokeid" : "{jokeid}", "commentor" : "{commentor}" } </Payload> </Set> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/> </AssignMessage>
Please suggest.
============================================================================