Hi,
There is a bug in the method toStaxType() of W3CDOMStreamReader class in
package org.codehaus.xfire.util.stax Which causes null pointer exception if
there are attributes in returned SOAP body content (only if we are using
DOMInHandler)
This method returns null in all conditions. This is causing Null pointer
exception when you try to get the type of attribute.
If the soap document returned from the Webservices provider has an element
with an attribute, and if we use DOMInHandler (for WS-Security), this causes a
NPE. This should be changed from
public static String toStaxType(short jdom)
{
switch(jdom)
{
default: return null;
}
}
to
public static String toStaxType(short jdom)
{
switch(jdom)
{
case Attribute.CDATA_TYPE: return "CDATA";
case Attribute.ID_TYPE: return "ID";
case Attribute.IDREF_TYPE: return "IDREF";
case Attribute.IDREFS_TYPE: return "IDREFS";
case Attribute.ENTITY_TYPE: return "ENTITY";
case Attribute.ENTITIES_TYPE: return "ENTITIES";
case Attribute.ENUMERATED_TYPE: return "ENUMERATED";
case Attribute.NMTOKEN_TYPE: return "NMTOKEN";
case Attribute.NMTOKENS_TYPE: return "NMTOKENS";
case Attribute.NOTATION_TYPE: return "NOTATION";
default: return null;
}
}
as done in JDOMStreamReader.
Regards,
Chaitanya
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.