src/share/jaxws_classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java

Print this page
rev 472 : 8036030: Update JAX-WS RI integration to latest version

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, 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 --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 490,512 **** * The actual copy operation depends on the layout * of the data in memory, hence it's best to be done by * the {@link com.sun.xml.internal.ws.api.message.Message} implementation itself. */ public Message copy() { try { if (!parsedMessage) { ! return new SAAJMessage(readAsSOAPMessage()); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(newBody, bodyAttrs); ! return new SAAJMessage(getHeaders(), getAttachments(), msg, soapVersion); } } catch (SOAPException e) { throw new WebServiceException(e); } } private static final AttributesImpl EMPTY_ATTS = new AttributesImpl(); --- 490,515 ---- * The actual copy operation depends on the layout * of the data in memory, hence it's best to be done by * the {@link com.sun.xml.internal.ws.api.message.Message} implementation itself. */ public Message copy() { + Message result = null; try { + access(); if (!parsedMessage) { ! result = new SAAJMessage(readAsSOAPMessage()); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(newBody, bodyAttrs); ! result = new SAAJMessage(getHeaders(), getAttachments(), msg, soapVersion); } + return result.copyFrom(this); } catch (SOAPException e) { throw new WebServiceException(e); } } private static final AttributesImpl EMPTY_ATTS = new AttributesImpl();