--- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java 2014-03-28 17:28:40.000000000 +0100 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java 2014-03-28 17:28:40.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -120,6 +120,7 @@ */ protected AbstractMessageImpl(AbstractMessageImpl that) { this.soapVersion = that.soapVersion; + this.copyFrom(that); } @Override @@ -150,11 +151,7 @@ hasAttachments()? new AttachmentUnmarshallerImpl(getAttachments()) : null ); } - /** - * Default implementation that relies on {@link #writePayloadTo(XMLStreamWriter)} - */ - @Override - public void writeTo(XMLStreamWriter w) throws XMLStreamException { + public void writeToBodyStart(XMLStreamWriter w) throws XMLStreamException { String soapNsUri = soapVersion.nsUri; w.writeStartDocument(); w.writeStartElement("S","Envelope",soapNsUri); @@ -169,7 +166,14 @@ } // write the body w.writeStartElement("S","Body",soapNsUri); + } + /** + * Default implementation that relies on {@link #writePayloadTo(XMLStreamWriter)} + */ + @Override + public void writeTo(XMLStreamWriter w) throws XMLStreamException { + writeToBodyStart(w); writePayloadTo(w); w.writeEndElement();