You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Bill Mitchell (JIRA)" <ji...@apache.org> on 2008/02/16 03:54:08 UTC

[jira] Reopened: (AXIS2C-675) Detach node does not handle namespaces

     [ https://issues.apache.org/jira/browse/AXIS2C-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Mitchell reopened AXIS2C-675:
----------------------------------


This problem has been encountered again recently, and it appears to me there is a real issue in axiom_node_detach and how it is used.  Consider the case of a SOAP response message in which the server declared the namespaces at one of the outer elements.  Where a wsdl declares an element of type any, not knowing the underlying structure, the generated adb classes detach the node and its subtree and makes the tree available to the client app.  The client app may choose to retain the response structure and the returned object tree for later use.  Yet the upper levels of the om will be discarded when the SOAP response message is discarded upon the next request through the service client. And, thus, Axis will free the namespaces underneath the adb objects.  

It hardly seems fair to place the responsibility on the creator of the tree not to release the namespaces underneath the detached node, when the tree is created as the SOAP message is parsed, and the location of the xml namespace declaration in the message is determined by the other side of the exchange.  

An alternative fix is to re-declare the namespaces on the node being detached, to ensure that it and its children remain valid regardless of what happens to its former parent tree.  Re-declaring the namespaces will cause the ref counts in the namespaces to be incremented, and thus the namespace structures will be retained until both the former parent tree and the detached node tree are released.  

> Detach node does not handle namespaces
> --------------------------------------
>
>                 Key: AXIS2C-675
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-675
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>            Reporter: Jamie Lyon
>
> When detaching a node from a parent, if the current node or any of it's children have any namespaces declared in it's parent or above, when the node is detached, and the parent freed, any namespace references are lost.

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