Forum Discussion

kagghu's avatar
kagghu
New Contributor
8 years ago

Error decoding raw response when CDATA contains XML?

I have to use a WS that gives me back a response with HTML encoded XML embedded in a CDATA. Don't ask why, that's how it is.

In the WSDL it is just:

<message name="getOrderResponse">
    <part name="getOrderReturn" type="xsd:string"/>
</message>

In the raw response I see this (abbreviated for clarity):

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getOrderResponse>
<getOrderReturn xsi:type="xsd:string">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;&#13; &lt;Orders&gt;&#13; &lt;Order&gt;&#13; &lt;Key&gt;47846-110480&lt;/Key&gt;&#13; &lt;Date&gt;2017.10.21 12:13:45&lt;/Date&gt;&#13; &lt;Customer&gt;&#13; &lt;Id&gt;7512944&lt;/Id&gt;&#13; &lt;Username&gt;something@gmail.com&lt;/Username&gt;&#13; &lt;Contact&gt;&#13; &lt;Name&gt;&lt;![CDATA[Somebody]]&gt;&lt;/Name&gt;&#13; &lt;Phone&gt;&lt;![CDATA[+aPhone]]&gt;&lt;/Phone&gt;&#13; &lt;Mobile&gt;&lt;![CDATA[]]&gt;&lt;/Mobile&gt;&#13; &lt;Lang&gt;en&lt;/Lang&gt;&#13; &lt;/Contact&gt;&#13; &lt;/Customer&gt;&#13; &lt;/Order&gt;&#13; &lt;/Orders&gt;&#13; </getOrderReturn>
</ns1:getOrderResponse>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

In the XML tab the same looks like:

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:getOrderResponse>
         <getOrderReturn xsi:type="xsd:string">
<![CDATA[<?xml version="1.0" encoding="UTF-8" ?> <Orders> <Order> <Key>47846-110480</Key> <Date>2017.10.21 12:13:45</Date> <Customer> <Id>7512944</Id> <Username>something@gmail.com</Username> <Contact> <Name><![CDATA[Somebody]]]]>><![CDATA[</Name> <Phone><![CDATA[+aPhone]]]]>><![CDATA[</Phone> <Mobile><![CDATA[]]]]>><![CDATA[</Mobile> <Lang>en</Lang> </Contact> </Order> </Orders>]]></getOrderReturn> </ns1:getOrderResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Note, that in some cases 

]]>><![CDATA[

appears instead of a single >.

 

I wonder if this is a SoapUI bug or I'm doing something wrong.