Tuesday, August 25, 2015

[WSO2 ESB] How to replace message body by a value of a property

Here is how to do it. This will replace message body by the value of "xmlfile" property.

<property name="xmlfile" expression="get-property('registry', 'gov:/xml/body.xml')" type="OM" />
<enrich>
<source clone="true" xpath="get-property('xmlfile')" />
<target type="body" />
</enrich>
view raw syn.xml hosted with ❤ by GitHub
Make sure you set type="OM" in property. Otherwise you will get below error.

"ERROR - EnrichMediator Invalid Object type to be inserted into message body"


No comments:

Post a Comment