May be because of the type of the 'Response' Clovis.
I'm using this and found no problem.
<property description="requestBk" expression="json-eval($.)" name="requestBk" scope="default" type="STRING"/>
<payloadFactory media-type="json">
<format>$1</format>
<args>
<arg evaluator="xml" expression="$ctx:requestBk"/>
</args>
</payloadFactory>
One other tip. Use $ctx:
instead of get-property
method for a better performance. Because get-property
looks in the registry
also.
And yes! as Bhathiya and Maria suggested you can use the Enrich mediator
also as mentioned below.
Copy the original payload to a property using the Enrich mediator
.
<enrich>
<source clone="false" type="body"/>
<target action="replace" type="property" property="ORGINAL_PAYLOAD"/>
</enrich>
Then whenever you need the original payload, you replace the message body with this property value using the Enrich mediator
as follows:
<enrich>
<source clone="false" type="property" property="ORIGINAL_PAYLOAD"/>
<target action="replace" type="body"/>
</enrich>