Support Article

CDATA Tag characters "<" and ">" are transformed to &lt; and&gt;

SA-24043

Summary



The CDATA angle brace tag characters ("&lt;" and "&gt;") are unexpectedly converted to substitution characters (&lt; and &gt;)

&lt;ns1:ReturnFormResponsexmlns:ns1="urn:PegaRULES:SOAP:SendPartsReturnFormToiClaim:Services"&gt; &lt;PDFImage&gt;&lt;![CDATA[%PDF-1.4 %����� 1 0
%%EOF ]]&gt;&lt;/PDFImage&gt; &lt;StatusCode&gt;&lt;/StatusCode&gt; &lt;StatusMessage&gt;&lt;/StatusMessage&gt; &lt;/ns1:ReturnFormResponse&gt;


Error Messages



Not Applicable.


Steps to Reproduce



Try to send a large data in CDATA tag (in an xml literal) and notice that Pega 7 is transforming the characters &lt;&gt; to &lt; and &gt;
 
  1. Create a SOAP Service with one XML literal in SOAP response.
  2. Set the large data between CDATA tags for a Response Data Element.
  3. Unit test by running the SOAP service and notice the transformed CDATA tags of Response SOAP response elements.


Root Cause



Default behavior is that Pega will encode the values.

Resolution



Perform the following local-change: 
  1. Change SOAP service response as single value property to store the xml data.
  2. Create a XML stream rule to read the read clipboard content. Reference pega tag:
    1. &lt;pega:reference name="INFO" mode="text"/&gt;
    2. For example &lt;input&gt; &lt;pega:reference name="INFO" mode="text"/&gt; &lt;/input&gt;
  3. Use property-set-xml to call XML stream rule and store the value in single value property that is set in SOAP service response mapping.

 

Published June 7, 2016 - Updated October 8, 2020

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.