axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Sun (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-3030) SAAJ Implementation - SOAPBodyImpl.toSAAJNode fails when source node has unqualified attribute (at least, with Xerces parser)
Date Sun, 29 Jul 2007 03:59:52 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-3030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516199
] 

Lin Sun commented on AXIS2-3030:
--------------------------------

Hi, this might have been fixed in Axis2 1.3 saaj.  I know fixes in this area have been committed
in the past few weeks.

> 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
>            Assignee: sumedha rubasinghe
>            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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message