diff --git a/modules/core/src/main/java/org/apache/synapse/mediators/elementary/EnrichMediator.java b/modules/core/src/main/java/org/apache/synapse/mediators/elementary/EnrichMediator.java index dbe2dd07b1..94e74ddc21 100644 --- a/modules/core/src/main/java/org/apache/synapse/mediators/elementary/EnrichMediator.java +++ b/modules/core/src/main/java/org/apache/synapse/mediators/elementary/EnrichMediator.java @@ -287,7 +287,10 @@ private boolean setDynamicValuesInNode(MessageContext messageContext, String inl try { // After the expressions in the inline text is replaced with the value, the string must be parsed // again to identify whether it has changed to a XML - source.setInlineOMNode(AXIOMUtil.stringToOM(inlineString)); + OMNode inlineOMNode = AXIOMUtil.stringToOM(inlineString); + // serialize inlineOMNode + inlineOMNode.buildWithAttachments(); + source.setInlineOMNode(inlineOMNode); isInlineTextXML = true; } catch (XMLStreamException | OMException e) { // The string is considered as a text / JSON