< prev index next >

jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -29,10 +29,11 @@
 import java.util.logging.Level;
 
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;

@@ -43,10 +44,14 @@
 
     protected HeaderImpl(SOAPDocumentImpl ownerDoc, NameImpl name) {
         super(ownerDoc, name);
     }
 
+    public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract SOAPHeaderElement createHeaderElement(Name name)
         throws SOAPException;
     protected abstract SOAPHeaderElement createHeaderElement(QName name)
         throws SOAPException;
     protected abstract NameImpl getNotUnderstoodName();

@@ -274,12 +279,13 @@
         }
         return upgradeHeaderElement;
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPHeaderElement) {
-            return (SOAPElement) element;
+        final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPHeaderElement) {
+            return (SOAPElement) soapNode;
         } else {
             SOAPHeaderElement headerElement;
             try {
                 headerElement =
                     createHeaderElement(NameImpl.copyElementName(element));
< prev index next >