Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.2.12
-
None
-
None
Description
The issue can be reproduced with the following code that uses Axis2's BeanUtil class (which creates an OMElement from a custom XMLStreamReader implementation):
OMElement element = BeanUtil.getOMElement(new QName("urn:test", "test"), new Object[]
{ new DataHandler("test", "text/plain") }, null, false, null);
System.out.println(element);
System.out.println(element.getFirstElement().getAllDeclaredNamespaces().hasNext());
The output is:
<test xmlns="urn:test"><arg0 xmlns="">dGVzdA==</arg0></test>
false
This shows that xmlns="" is added by the serializer, but is not present in the object model. This is incorrect because the builder is also expected to perform namespace repairing, i.e. it should have added the corresponding namespace declaration when the object model was built.
This is likely to cause issues in Rampart, in particular if DOOM is enabled. The reason is that the object model is passed to WSS4J/Santuario which expects the namespace information to be complete. Missing namespace declarations are likely to cause incorrect signature calculations.