Fri, 07 Aug 2009 11:27:00 -0700
6813167: 6u14 JAX-WS audit mutable static bugs
6803688: Integrate latest JAX-WS (2.1.6) in to JDK 6u14
Reviewed-by: darcy, ramap
1 /*
2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
28 /**
29 *
30 * @author SAAJ RI Development Team
31 */
32 package com.sun.xml.internal.messaging.saaj.soap.ver1_2;
34 import java.util.logging.Level;
35 import java.util.logging.Logger;
37 import javax.xml.soap.SOAPConstants;
38 import javax.xml.soap.SOAPException;
39 import javax.xml.transform.Source;
41 import com.sun.xml.internal.messaging.saaj.soap.*;
42 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
43 import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser;
45 public class SOAPPart1_2Impl extends SOAPPartImpl implements SOAPConstants{
47 protected static final Logger log =
48 Logger.getLogger(SOAPPart1_2Impl.class.getName(),
49 "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
51 public SOAPPart1_2Impl() {
52 super();
53 }
55 public SOAPPart1_2Impl(MessageImpl message) {
56 super(message);
57 }
59 protected String getContentType() {
60 return "application/soap+xml";
61 }
63 protected Envelope createEmptyEnvelope(String prefix) throws SOAPException {
64 return new Envelope1_2Impl(getDocument(), prefix, true, true);
65 }
67 protected Envelope createEnvelopeFromSource() throws SOAPException {
68 XMLDeclarationParser parser = lookForXmlDecl();
69 Source tmp = source;
70 source = null;
71 EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
72 if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
73 log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
74 throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
75 }
77 if (!omitXmlDecl) {
78 envelope.setOmitXmlDecl("no");
79 envelope.setXmlDecl(parser.getXmlDeclaration());
80 envelope.setCharsetEncoding(parser.getEncoding());
81 }
82 return envelope;
84 }
86 protected SOAPPartImpl duplicateType() {
87 return new SOAPPart1_2Impl();
88 }
90 }