users@jaxb.java.net

SAX2DOMEx problem when used with axis 1.4 SOAPHeader

From: Baggos Sketos <baggos123_at_hotmail.com>
Date: Thu, 21 Oct 2010 14:01:36 +0300

There is a problem when using the jaxb-impl 2.2 to marshall a SOAP Header element to the the header part of a soap message constructed using org.apache.axis.soap.MessageFactoryImpl as a message factory.

The problem appears when appending an element to an instance of org.apache.axis.message.SOAPHeader which implements org.w3c.dom.Node. The appendChild implementation, checks if the Node parameter is an instance of org.apache.axis.message.SOAPHeaderElement and if not it wraps it to one and returns the new element which also implements org.w3c.dom.Node.

SAX2DOMEx though, ignores the returned Node, and pushes the one passed as a parameter to the nodeStack. This now means that the stack has a different element than the one appended and any further appends will be appended to the element pushed in the stack which is by no means connected to the original node. Thus all subsequent appends are lost.

Does anyone feel that the implementation should be changed to maintain the stack with the returned element of the appendChild method and not the one created from the document or do you consider this a problem with the axis implementation of appendChild?