ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasun Gajasinghe <>
Subject Axiom looses information when a child element is re-added to its parent using #addChild
Date Thu, 23 Feb 2012 14:26:44 GMT

I've using Axiom for some work, and I've faced this issue that I think is a
bug in Axiom. The issue occurs when a given OMElement is re-added to its
parent using parentOMElement#addChild method. In that case, the said parent
loses references to all the children after the child OMElement.

To make it clear consider the sample xml doc [1]. Now, say you retrieved
the operation named "Sandesha2OperationInOnly", by xpath or any other
means. Then, you re add it to the parent <service>. After that, service
loose references to siblings after the said retrieved element (ie.
<binding> and <parameter>). I've provided a sample code for this which I've
simplified to not use xpath for better understanding. [2]

Yes, I can do a validation on whether I'm adding a child to the same
parent, but why? This should be handled at Axiom level. The example was a
much simplified version; I've spent hours wondering how I lost all those
information, and found that a seemingly innocent method invocation was the
cause! :) Can anyone reproduce this? I'd like to provide a patch for this.

<service name="HelloService">
    <operation name="Sandesha2OperationOutIn"/>
    <operation name="Sandesha2OperationInOnly"/>
    <binding name="HelloServiceSoap12Binding">
        <operation name="greet"/>
    <parameter name="name1">val1</parameter>

OMElement documentEle = new

// Now retrieve <operation name="Sandesha2OperationInOnly" />
OMElement opElement2 = (OMElement)
//OMElement opElement2 = new


*Kasun Gajasinghe*
Software Engineer; WSO2 Inc.;,
*linked-in: **
*blog: *** <>

twitter: *** <>

View raw message