-
Notifications
You must be signed in to change notification settings - Fork 268
Description
Description
When the Header Mediator is used with the expression attribute to dynamically construct and set a SOAP header containing XML, the Micro Integrator escapes the XML instead of inserting it as an XML node since the evaluating header expression as text in the SOAP header, which causes the XML to be escaped. The escaping happens only when setting SOAP headers using the Header Mediator.
Example:
Expected Behaviour
Setting the following WS-Addressing header:
<wsa:From>
<wsa:Address>http://localhost:3000/</wsa:Address>
</wsa:From>
The Header Mediator should insert the XML fragment as a proper OMElement.
Actual Behaviour
MI inserts the value as text, escaping XML:
<wsa:From>
<wsa:Address>http://localhost:3000/</wsa:Address>
</wsa:From>
This results in an invalid WS-A header.
Steps to Reproduce
This can be reproduced by adding the below artifacts into any API in-sequence and observing the outgoing message.
When invoking the API, you will clearly see that the WS-A header is escaped in the outgoing SOAP envelope, confirming the incorrect behavior of the Header Mediator.
<property name="TMP_HEADER"
expression="concat('<', 'wsa:Address', '>', 'http://localhost:3000/', '</wsa:Address>')"/>
<!-- Set header -->
<header name="wsa:From"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
action="set"
expression="$ctx:TMP_HEADER"/>
This will result the below format when checking through a log full.
<wsa:From>
<wsa:Address>http://localhost:3000/</wsa:Address>
</wsa:From>
Version
4.3.0
Environment Details (with versions)
No response