Method findAllElementsByTagNameNS in cxf/trunk/api/src/main/java/org/apache/cxf/helpers/DOMUtils.java attempts to perform elementList.add(el) when el.getNamespaceURI() == null. This means that when ReadHeaderInterceptor processes an inbound SOAP message with a null namespace Header element, the user encounters a NullPointerException.
Method findAllElementsByTagNameNS now additionally checks that el.getNamespaceURI() != null before proceeding to perform elementList.add(el). ReadHeaderInterceptor can now process an inbound SOAP message with a null namespace Header element and the user no longer encounters the Exception.
Created attachment 596970[details]
cxf-4408 patch
When ReadHeaderInterceptor processes the following inbound SOAP message, DOMUtils throws a NullPointerException for the null namespace Header element:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:foo="http://cxf.apache.org/foo" xmlns:bar="http://cxf.apache.org/bar">
<soapenv:Header>
<foo:myheader>
<Header>
<bar:type>mytype</head:type>
</Header>
</foo:myheader>
</soapenv:Header>
...
A NPE guard is needed.