Hi guys,
I want to call an external logging service to log the response from a target endpoint. Therefore the payload of this logging service includes the xml from the endpoint. However, I’m not able to escape the returned XML with CDATA - it simply disappears from the final message. Am I missing something here?
Thanks.
My AssignMessage policy (note the CDATA):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="true" enabled="true" name="AM-LogMessage">
<DisplayName>AM-LogMessage</DisplayName>
<Properties/>
<AssignTo createNew="true" transport="http" type="request">logoutput</AssignTo>
<Set>
<Payload contentType="application/xml">
<log>
<messageId>{messageid}</messageId>
<environmentName>{environment.name}</environmentName>
<request>
<verb>{log.request.verb}</verb>
<scheme>{log.client.scheme}</scheme>
<host>{log.request.header.host}</host>
<uri>{log.request.uri}</uri>
<url>{log.client.scheme}://{log.request.header.host}/{log.request.uri}</url>
<receivedStartTimestamp>{converted.client.received.start.timestamp}</receivedStartTimestamp>
<receivedEndTimestamp>{converted.client.received.end.timestamp}</receivedEndTimestamp>
<content><![CDATA[{log.request.content}]]></content>
</request>
<response>
<content>{log.response.content}</content>
</response>
<target>
<sentStartTimestamp>{converted.target.sent.start.timestamp}</sentStartTimestamp>
<sentEndTimestamp>{converted.target.sent.end.timestamp}</sentEndTimestamp>
<receivedStartTimestamp>{converted.target.received.start.timestamp}</receivedStartTimestamp>
<receivedEndTimestamp>{converted.target.received.end.timestamp}</receivedEndTimestamp>
<requestContent>{log.target.request.content}</requestContent>
<responseContent><![CDATA[{log.target.response.content}]]></responseContent>
</target>
</log>
</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</AssignMessage>
Result of trace (edited for clarity - no CDATA):
<log>
<messageId>rrt-04f86cf07fc1285a3-b-de-18184-27376007-1</messageId>
...
<content>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:IDSReservationRequest>
...
</ns2:IDSReservationRequest>
</content>
</request>
<response>
<content>
<RESPONSE>
...
</RESPONSE>
</content>
</response>
...
</log>

