Reputation: 1281
WSO2 4.8.1 has a well-known problem with passing CDATA sections in XML messages. Such sections are always replaced with their contents in the form of XML-escaped string.
Any solution to this problem would be appreciated.
Meanwhile, I have found a page telling about some patch (patch0514) for this purpose:
http://www.yenlo.com/en/how-to-preserve-a-cdata-in-xml-that-is-circulating-in-a-wso2-enterprise-service-bus/
But I have no idea where can I get this patch. Any clue?
Upvotes: 2
Views: 971
Reputation: 1281
So, finally I found 2 issues there:
I had to change org.apache.axiom.om.OMXMLBuilderFactory
from Axiom package, to make it using StAXParserConfiguration.PRESERVE_CDATA_SECTIONS
instead of StAXParserConfiguration.SOAP
, as follows:
public static OMXMLParserWrapper createSOAPModelBuilder(InputStream in, String encoding){
InputSource is = new InputSource(in);
is.setEncoding(encoding);
return OMAbstractFactory.getMetaFactory().createSOAPModelBuilder(StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, is);
}
Upvotes: 1