Description
If we try to enrich the a body with a property (where property type is set to 'OM') while setting clone to false, messages is not enriched.
To illustrate this, consider the following synapse configuration.
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="SYNAPSE1007" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <log level="custom"> <property name="SYNAPSE-1007" value="Bond, James Bond" /> </log> <property name="PAYLOAD" expression="//payload/content" type="OM" /> <enrich> <source type="property" clone="false" property="PAYLOAD" /> <target type="body" /> </enrich> <header name="To" action="remove" /> <property name="RESPONSE" value="true" scope="default" type="STRING" /> <property name="NO_ENTITY_BODY" scope="axis2" action="remove" /> <send /> </inSequence> </target> <description /> </proxy> </definitions>
Sending the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<payload>
<content>
<abc>
<def>ABC</def>
</abc>
</content>
</payload>
</soapenv:Body>
</soapenv:Envelope>
Yields:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<payload>
<content>
<abc>
<def>ABC</def>
</abc>
</content>
</payload>
</soapenv:Body>
</soapenv:Envelope>
But the expected response should be
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<content>
<abc>
<def>ABC</def>
</abc>
</content>
</soapenv:Body>
</soapenv:Envelope>
I've attached a fix for this issue (built against 2.1 branch) for you consideration.