Hello,
I use SAXBuilder to parse and add an extra element to an existing WSDL file. I am facing problem for WSDLs which have & in their namespace declaration. When I use XMLOutputter to write back the changed WSDL “&” gets replaced with “&”.
This happens only with extra namespaces. That is “&” in targetNameSpace and in rest of the WSDL document remain same, however “&” in other namespace declarations change.
Here is a simple code snippet that I use:
SAXBuilder builder = new SAX…;
Document doc = Builder.build(InputStream);
// Add some elements to doc
XMLOutputter out = new XMLOut…
Out.output(doc, OutputStream);
“tns” namespce in <wsdl:definitions> has value http://abc.com?a=b&c=d which gets converted to http://abc.com?a=b&c=d. This results in invalid WSDL document as “&” is a preserved entity.
With Regards,
Aniruddha Deshpande