Monday, January 18, 2016

[WSO2 ESB]Add new element to message body.


Sometime we need to add static content to the message response. Eg: privacy statement. So we can store the note in the registry and include to message body using the enrich mediator.

<property  expression="get-property('registry','gov:/note/PrivacyStatement_v1.0.0.xml')"
name="PrivacyStatement" scope="default" type="OM"/>

<enrich>
  <source xpath="$ctx:PrivacyStatement"/>
  <target action="sibling" type="body"/>
</enrich>