< prev index next >

jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.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

@@ -50,10 +50,11 @@
 import com.sun.xml.internal.messaging.saaj.util.stax.LazyEnvelopeStaxReader;
 import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
 
 import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader;
 import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
+import org.w3c.dom.Element;
 
 /**
  * Our implementation of the SOAP envelope.
  *
  * @author Anil Vijendran (anil@sun.com)

@@ -90,10 +91,14 @@
 
         if (createBody)
             addBody();
     }
 
+    public EnvelopeImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract NameImpl getHeaderName(String prefix);
     protected abstract NameImpl getBodyName(String prefix);
 
     public SOAPHeader addHeader() throws SOAPException {
         return addHeader(null);

@@ -120,11 +125,11 @@
                 throw new SOAPExceptionImpl("First child of Envelope must be either a Header or Body");
             }
         }
 
         header = (HeaderImpl) createElement(headerName);
-        insertBefore(header, firstChild);
+        insertBefore(header.getDomElement(), firstChild);
         header.ensureNamespaceIsDeclared(headerName.getPrefix(), headerName.getURI());
 
         return header;
     }
 

@@ -159,11 +164,11 @@
         }
 
         if (body == null) {
             NameImpl bodyName = getBodyName(prefix);
             body = (BodyImpl) createElement(bodyName);
-            insertBefore(body, null);
+            insertBefore(body.getDomElement(), null);
             body.ensureNamespaceIsDeclared(bodyName.getPrefix(), bodyName.getURI());
         } else {
             log.severe("SAAJ0122.impl.body.already.exists");
             throw new SOAPExceptionImpl("Can't add a body when one is already present.");
         }
< prev index next >