我有一个包含 CDATA 的肥皂响应,但我在 java 中处理响应,所有开头引号 (<) 都替换为 (<)。
这是响应的样子
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:Response xmlns:ns="http://pipeline_ws">
<ns:return>
<![CDATA[<fr><Result>
<ListPartner>
<operator>
<country_code></country_code>
<currency_code></currency_code>
<operator_code></operator_code>
</operator>
</ListPartner>
</Result></fr>]]></ns:return>
</ns:Response>
</soapenv:Body>
</soapenv:Envelope>
但相反,这是我得到的回应
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:Response xmlns:ns="http://pipeline_ws">
<ns:return>
<fr>
<Result>
<ListPartner>
<operator>
<country_code></country_code>
<currency_code></currency_code>
<operator_code></operator_code>
</operator>
</ListPartner>
</Result>
</fr>
</ns:return>
</ns:Response>
</soapenv:Body>
</soapenv:Envelope>
请帮助提供删除/替换不需要的字符(<)的解决方案,以便我可以解析响应。我正在使用 SAAJ 处理响应
// Process the SOAP Response
SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(), url);
soapResponse.writeTo(System.out);