Configuring `error templates` to return XML with CDATA

I am proxying requests to a SOAP API that expects the request data to be passed inside a CDATA tag. I would like to have errors raised in tyk returned in the same format. Problem is, when I set up an error template, the < of the CDATA tag is escaped, making the response invalid. So instead of:

     ...
	<req:ResponseMsg>
		 <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
		<response xmlns="http://schemas.xmlsoap.org/soap/envelope/response">
		        <ResponseCode>20000003</ResponseCode>
			<ResponseDesc>Internal Server Error</ResponseDesc>
			</response>]]>
	</req:ResponseMsg>
    ...

I get:

    ...
        <req:ResponseMsg>
		 &lt;![CDATA[&lt;?xml version="1.0" encoding="UTF-8"?>
		<response xmlns="http://schemas.xmlsoap.org/soap/envelope/esponse">
		        <ResponseCode>20000003</ResponseCode>
			<ResponseDesc>Internal Server Error</ResponseDesc>
			</response>]]>
	</req:ResponseMsg>
    ...

Is there a way I can skip the escaping?

1 Like

Any help here. Facing same issue here.