SAAJ Implementation - SOAPBodyImpl.toSAAJNode fails when source node has
unqualified attribute (at least, with Xerces parser)
-----------------------------------------------------------------------------------------------------------------------------
Key: AXIS2-3030
URL: https://issues.apache.org/jira/browse/AXIS2-3030
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.2
Environment: All
Reporter: Jeff Faath
Priority: Minor
The SOAPBodyImpl.toSAAJNode contains a bug at this block of code that converts
the source DOM node attributes to SAAJ element attributes:
NamedNodeMap domAttrs = domEle.getAttributes();
for (int i = 0; i < domAttrs.getLength(); i++) {
org.w3c.dom.Node attrNode = domAttrs.item(i);
saajEle.addAttribute(new PrefixedQName(attrNode.getNamespaceURI(),
attrNode.getLocalName(),
attrNode.getPrefix()),
attrNode.getNodeValue());
}
The problem is that when the current attrNode isn't qualified, the getLocalName
method returns null (using Xerces parser). Then, when trying to create the new
PrefixedQName, an exception is thrown for trying to create a QName with a null
LocalName.
The solution is to either just use attrNode.getName() (not sure if this is
thorough enough?) or to test if attrNode is of type AttrNSImpl or AttrImpl. If
AttrNSImpl, the current block works, otherwise, the getName() must be used
instead of getLocalName().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]