kagghu
8 years agoNew Contributor
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"><?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]]></Name> <Phone><![CDATA[+aPhone]]></Phone> <Mobile><![CDATA[]]></Mobile> <Lang>en</Lang> </Contact> </Customer> </Order> </Orders> </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.