Author: jim.ma
Date: 2011-03-28 22:37:53 -0400 (Mon, 28 Mar 2011)
New Revision: 13952
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
Log:
JBWS-3251:Add check owner document in addChild(SOAPElement child)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2011-03-28
21:46:51 UTC (rev 13951)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2011-03-29
02:37:53 UTC (rev 13952)
@@ -274,8 +274,17 @@
*/
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
- SOAPElementImpl soapElement = (SOAPElementImpl)child;
- soapElement = (SOAPElementImpl)appendChild(soapElement);
+ SOAPElementImpl soapElement = (SOAPElementImpl) child;
+
+ if (soapElement.domNode.getOwnerDocument() != element.getOwnerDocument())
+ {
+ Document oldDoc = DOMUtils.peekOwnerDocument();
+ DOMUtils.setOwnerDocument(element.getOwnerDocument());
+ soapElement = (SOAPElementImpl)
SOAPFactoryImpl.newInstance().createElement((Element) (soapElement.domNode));
+ DOMUtils.setOwnerDocument(oldDoc);
+
+ }
+ soapElement = (SOAPElementImpl) appendChild(soapElement);
return soapElement.completeNamespaceDeclaration();
}
Show replies by date