jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
author tbell
Mon, 04 May 2009 21:10:41 -0700
changeset 2719 99d59312294b
parent 2678 57cf2a1c1a05
child 3530 18fb7507984b
permissions -rw-r--r--
6658158: Mutable statics in SAAJ (findbugs) 6658163: txw2.DatatypeWriter.BUILDIN is a mutable static (findbugs) Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
474761f14bca Initial load
duke
parents:
diff changeset
     1
/*
2678
57cf2a1c1a05 6831313: update jaxws in OpenJDK7 to 2.1 plus bug fixes from OpenJDK 6
tbell
parents: 8
diff changeset
     2
 * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
8
474761f14bca Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
474761f14bca Initial load
duke
parents:
diff changeset
     4
 *
474761f14bca Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
474761f14bca Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
474761f14bca Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
474761f14bca Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
474761f14bca Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
474761f14bca Initial load
duke
parents:
diff changeset
    10
 *
474761f14bca Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
474761f14bca Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
474761f14bca Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
474761f14bca Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
474761f14bca Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
474761f14bca Initial load
duke
parents:
diff changeset
    16
 *
474761f14bca Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
474761f14bca Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
474761f14bca Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
474761f14bca Initial load
duke
parents:
diff changeset
    20
 *
474761f14bca Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
474761f14bca Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
474761f14bca Initial load
duke
parents:
diff changeset
    23
 * have any questions.
474761f14bca Initial load
duke
parents:
diff changeset
    24
 */
2678
57cf2a1c1a05 6831313: update jaxws in OpenJDK7 to 2.1 plus bug fixes from OpenJDK 6
tbell
parents: 8
diff changeset
    25
/*
2719
99d59312294b 6658158: Mutable statics in SAAJ (findbugs)
tbell
parents: 2678
diff changeset
    26
 *
99d59312294b 6658158: Mutable statics in SAAJ (findbugs)
tbell
parents: 2678
diff changeset
    27
 *
99d59312294b 6658158: Mutable statics in SAAJ (findbugs)
tbell
parents: 2678
diff changeset
    28
 *
2678
57cf2a1c1a05 6831313: update jaxws in OpenJDK7 to 2.1 plus bug fixes from OpenJDK 6
tbell
parents: 8
diff changeset
    29
 */
57cf2a1c1a05 6831313: update jaxws in OpenJDK7 to 2.1 plus bug fixes from OpenJDK 6
tbell
parents: 8
diff changeset
    30
57cf2a1c1a05 6831313: update jaxws in OpenJDK7 to 2.1 plus bug fixes from OpenJDK 6
tbell
parents: 8
diff changeset
    31
8
474761f14bca Initial load
duke
parents:
diff changeset
    32
package com.sun.xml.internal.messaging.saaj.soap;
474761f14bca Initial load
duke
parents:
diff changeset
    33
474761f14bca Initial load
duke
parents:
diff changeset
    34
import java.io.*;
474761f14bca Initial load
duke
parents:
diff changeset
    35
import java.util.Iterator;
474761f14bca Initial load
duke
parents:
diff changeset
    36
import java.util.logging.Logger;
474761f14bca Initial load
duke
parents:
diff changeset
    37
import java.util.logging.Level;
474761f14bca Initial load
duke
parents:
diff changeset
    38
474761f14bca Initial load
duke
parents:
diff changeset
    39
import javax.activation.DataHandler;
474761f14bca Initial load
duke
parents:
diff changeset
    40
import javax.activation.DataSource;
474761f14bca Initial load
duke
parents:
diff changeset
    41
import javax.xml.soap.*;
474761f14bca Initial load
duke
parents:
diff changeset
    42
import javax.xml.transform.Source;
474761f14bca Initial load
duke
parents:
diff changeset
    43
import javax.xml.transform.stream.StreamSource;
474761f14bca Initial load
duke
parents:
diff changeset
    44
474761f14bca Initial load
duke
parents:
diff changeset
    45
import org.w3c.dom.*;
474761f14bca Initial load
duke
parents:
diff changeset
    46
474761f14bca Initial load
duke
parents:
diff changeset
    47
import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
474761f14bca Initial load
duke
parents:
diff changeset
    48
474761f14bca Initial load
duke
parents:
diff changeset
    49
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
474761f14bca Initial load
duke
parents:
diff changeset
    50
import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
474761f14bca Initial load
duke
parents:
diff changeset
    51
import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
474761f14bca Initial load
duke
parents:
diff changeset
    52
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
474761f14bca Initial load
duke
parents:
diff changeset
    53
import com.sun.xml.internal.messaging.saaj.util.*;
474761f14bca Initial load
duke
parents:
diff changeset
    54
import javax.xml.transform.sax.SAXSource;
474761f14bca Initial load
duke
parents:
diff changeset
    55
474761f14bca Initial load
duke
parents:
diff changeset
    56
/**
474761f14bca Initial load
duke
parents:
diff changeset
    57
 * SOAPPartImpl is the first attachment. This contains the XML/SOAP document.
474761f14bca Initial load
duke
parents:
diff changeset
    58
 *
474761f14bca Initial load
duke
parents:
diff changeset
    59
 * @author Anil Vijendran (anil@sun.com)
474761f14bca Initial load
duke
parents:
diff changeset
    60
 */
474761f14bca Initial load
duke
parents:
diff changeset
    61
public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument {
2719
99d59312294b 6658158: Mutable statics in SAAJ (findbugs)
tbell
parents: 2678
diff changeset
    62
    protected static final Logger log =
8
474761f14bca Initial load
duke
parents:
diff changeset
    63
        Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
474761f14bca Initial load
duke
parents:
diff changeset
    64
                         "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
474761f14bca Initial load
duke
parents:
diff changeset
    65
474761f14bca Initial load
duke
parents:
diff changeset
    66
    protected MimeHeaders headers;
474761f14bca Initial load
duke
parents:
diff changeset
    67
    protected Envelope envelope;
474761f14bca Initial load
duke
parents:
diff changeset
    68
    protected Source source;
474761f14bca Initial load
duke
parents:
diff changeset
    69
    protected SOAPDocumentImpl document;
474761f14bca Initial load
duke
parents:
diff changeset
    70
474761f14bca Initial load
duke
parents:
diff changeset
    71
    //flag to indicate if a setContent happened.
474761f14bca Initial load
duke
parents:
diff changeset
    72
    private boolean sourceWasSet = false;
474761f14bca Initial load
duke
parents:
diff changeset
    73
474761f14bca Initial load
duke
parents:
diff changeset
    74
    // Records whether the input source had an xml decl or not.
474761f14bca Initial load
duke
parents:
diff changeset
    75
    protected boolean omitXmlDecl = true;
474761f14bca Initial load
duke
parents:
diff changeset
    76
474761f14bca Initial load
duke
parents:
diff changeset
    77
    // Records the charset encoding of the input stream source if provided.
474761f14bca Initial load
duke
parents:
diff changeset
    78
    protected String sourceCharsetEncoding = null;
474761f14bca Initial load
duke
parents:
diff changeset
    79
474761f14bca Initial load
duke
parents:
diff changeset
    80
    /**
474761f14bca Initial load
duke
parents:
diff changeset
    81
     * Reference to containing message (may be null)
474761f14bca Initial load
duke
parents:
diff changeset
    82
     */
474761f14bca Initial load
duke
parents:
diff changeset
    83
    protected MessageImpl message;
474761f14bca Initial load
duke
parents:
diff changeset
    84
474761f14bca Initial load
duke
parents:
diff changeset
    85
    protected SOAPPartImpl() {
474761f14bca Initial load
duke
parents:
diff changeset
    86
        this(null);
474761f14bca Initial load
duke
parents:
diff changeset
    87
    }
474761f14bca Initial load
duke
parents:
diff changeset
    88
474761f14bca Initial load
duke
parents:
diff changeset
    89
    protected SOAPPartImpl(MessageImpl message) {
474761f14bca Initial load
duke
parents:
diff changeset
    90
        document = new SOAPDocumentImpl(this);
474761f14bca Initial load
duke
parents:
diff changeset
    91
        headers = new MimeHeaders();
474761f14bca Initial load
duke
parents:
diff changeset
    92
        this.message = message;
474761f14bca Initial load
duke
parents:
diff changeset
    93
        headers.setHeader("Content-Type", getContentType());
474761f14bca Initial load
duke
parents:
diff changeset
    94
    }
474761f14bca Initial load
duke
parents:
diff changeset
    95
474761f14bca Initial load
duke
parents:
diff changeset
    96
    protected abstract String getContentType();
474761f14bca Initial load
duke
parents:
diff changeset
    97
    protected abstract Envelope createEnvelopeFromSource()
474761f14bca Initial load
duke
parents:
diff changeset
    98
    throws SOAPException;
474761f14bca Initial load
duke
parents:
diff changeset
    99
    protected abstract Envelope createEmptyEnvelope(String prefix)
474761f14bca Initial load
duke
parents:
diff changeset
   100
    throws SOAPException;
474761f14bca Initial load
duke
parents:
diff changeset
   101
    protected abstract SOAPPartImpl duplicateType();
474761f14bca Initial load
duke
parents:
diff changeset
   102
474761f14bca Initial load
duke
parents:
diff changeset
   103
    protected String getContentTypeString() {
474761f14bca Initial load
duke
parents:
diff changeset
   104
        return getContentType();
474761f14bca Initial load
duke
parents:
diff changeset
   105
    }
474761f14bca Initial load
duke
parents:
diff changeset
   106
474761f14bca Initial load
duke
parents:
diff changeset
   107
    public boolean isFastInfoset() {
474761f14bca Initial load
duke
parents:
diff changeset
   108
        return (message != null) ? message.isFastInfoset() : false;
474761f14bca Initial load
duke
parents:
diff changeset
   109
    }
474761f14bca Initial load
duke
parents:
diff changeset
   110
474761f14bca Initial load
duke
parents:
diff changeset
   111
    public SOAPEnvelope getEnvelope() throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   112
474761f14bca Initial load
duke
parents:
diff changeset
   113
        // If there is no SOAP envelope already created, then create
474761f14bca Initial load
duke
parents:
diff changeset
   114
        // one from a source if one exists. If there is a newer source
474761f14bca Initial load
duke
parents:
diff changeset
   115
        // then use that source.
474761f14bca Initial load
duke
parents:
diff changeset
   116
474761f14bca Initial load
duke
parents:
diff changeset
   117
        if (sourceWasSet)
474761f14bca Initial load
duke
parents:
diff changeset
   118
              sourceWasSet = false;
474761f14bca Initial load
duke
parents:
diff changeset
   119
474761f14bca Initial load
duke
parents:
diff changeset
   120
        lookForEnvelope();
474761f14bca Initial load
duke
parents:
diff changeset
   121
        if (envelope != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   122
            if (source != null) { // there's a newer source, use it
474761f14bca Initial load
duke
parents:
diff changeset
   123
                document.removeChild(envelope);
474761f14bca Initial load
duke
parents:
diff changeset
   124
                envelope = createEnvelopeFromSource();
474761f14bca Initial load
duke
parents:
diff changeset
   125
            }
474761f14bca Initial load
duke
parents:
diff changeset
   126
        } else if (source != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   127
            envelope = createEnvelopeFromSource();
474761f14bca Initial load
duke
parents:
diff changeset
   128
        } else {
474761f14bca Initial load
duke
parents:
diff changeset
   129
            envelope = createEmptyEnvelope(null);
474761f14bca Initial load
duke
parents:
diff changeset
   130
            document.insertBefore(envelope, null);
474761f14bca Initial load
duke
parents:
diff changeset
   131
        }
474761f14bca Initial load
duke
parents:
diff changeset
   132
        return envelope;
474761f14bca Initial load
duke
parents:
diff changeset
   133
    }
474761f14bca Initial load
duke
parents:
diff changeset
   134
474761f14bca Initial load
duke
parents:
diff changeset
   135
    protected void lookForEnvelope() throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   136
        Element envelopeChildElement = document.doGetDocumentElement();
474761f14bca Initial load
duke
parents:
diff changeset
   137
        if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
474761f14bca Initial load
duke
parents:
diff changeset
   138
            envelope = (EnvelopeImpl) envelopeChildElement;
474761f14bca Initial load
duke
parents:
diff changeset
   139
        } else if (!(envelopeChildElement instanceof ElementImpl)) {
474761f14bca Initial load
duke
parents:
diff changeset
   140
            log.severe("SAAJ0512.soap.incorrect.factory.used");
474761f14bca Initial load
duke
parents:
diff changeset
   141
            throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
474761f14bca Initial load
duke
parents:
diff changeset
   142
        } else {
474761f14bca Initial load
duke
parents:
diff changeset
   143
            ElementImpl soapElement = (ElementImpl) envelopeChildElement;
474761f14bca Initial load
duke
parents:
diff changeset
   144
            if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
474761f14bca Initial load
duke
parents:
diff changeset
   145
                String prefix = soapElement.getPrefix();
474761f14bca Initial load
duke
parents:
diff changeset
   146
                String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
474761f14bca Initial load
duke
parents:
diff changeset
   147
                if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) {
474761f14bca Initial load
duke
parents:
diff changeset
   148
                    log.severe("SAAJ0513.soap.unknown.ns");
474761f14bca Initial load
duke
parents:
diff changeset
   149
                    throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized");
474761f14bca Initial load
duke
parents:
diff changeset
   150
                }
474761f14bca Initial load
duke
parents:
diff changeset
   151
            } else {
474761f14bca Initial load
duke
parents:
diff changeset
   152
                log.severe("SAAJ0514.soap.root.elem.not.named.envelope");
474761f14bca Initial load
duke
parents:
diff changeset
   153
                throw new SOAPExceptionImpl(
474761f14bca Initial load
duke
parents:
diff changeset
   154
                    "Unable to create envelope from given source because the root element is not named \"Envelope\"");
474761f14bca Initial load
duke
parents:
diff changeset
   155
            }
474761f14bca Initial load
duke
parents:
diff changeset
   156
        }
474761f14bca Initial load
duke
parents:
diff changeset
   157
    }
474761f14bca Initial load
duke
parents:
diff changeset
   158
474761f14bca Initial load
duke
parents:
diff changeset
   159
    public void removeAllMimeHeaders() {
474761f14bca Initial load
duke
parents:
diff changeset
   160
        headers.removeAllHeaders();
474761f14bca Initial load
duke
parents:
diff changeset
   161
    }
474761f14bca Initial load
duke
parents:
diff changeset
   162
474761f14bca Initial load
duke
parents:
diff changeset
   163
    public void removeMimeHeader(String header) {
474761f14bca Initial load
duke
parents:
diff changeset
   164
        headers.removeHeader(header);
474761f14bca Initial load
duke
parents:
diff changeset
   165
    }
474761f14bca Initial load
duke
parents:
diff changeset
   166
474761f14bca Initial load
duke
parents:
diff changeset
   167
    public String[] getMimeHeader(String name) {
474761f14bca Initial load
duke
parents:
diff changeset
   168
        return headers.getHeader(name);
474761f14bca Initial load
duke
parents:
diff changeset
   169
    }
474761f14bca Initial load
duke
parents:
diff changeset
   170
474761f14bca Initial load
duke
parents:
diff changeset
   171
    public void setMimeHeader(String name, String value) {
474761f14bca Initial load
duke
parents:
diff changeset
   172
        headers.setHeader(name, value);
474761f14bca Initial load
duke
parents:
diff changeset
   173
    }
474761f14bca Initial load
duke
parents:
diff changeset
   174
474761f14bca Initial load
duke
parents:
diff changeset
   175
    public void addMimeHeader(String name, String value) {
474761f14bca Initial load
duke
parents:
diff changeset
   176
        headers.addHeader(name, value);
474761f14bca Initial load
duke
parents:
diff changeset
   177
    }
474761f14bca Initial load
duke
parents:
diff changeset
   178
474761f14bca Initial load
duke
parents:
diff changeset
   179
    public Iterator getAllMimeHeaders() {
474761f14bca Initial load
duke
parents:
diff changeset
   180
        return headers.getAllHeaders();
474761f14bca Initial load
duke
parents:
diff changeset
   181
    }
474761f14bca Initial load
duke
parents:
diff changeset
   182
474761f14bca Initial load
duke
parents:
diff changeset
   183
    public Iterator getMatchingMimeHeaders(String[] names) {
474761f14bca Initial load
duke
parents:
diff changeset
   184
        return headers.getMatchingHeaders(names);
474761f14bca Initial load
duke
parents:
diff changeset
   185
    }
474761f14bca Initial load
duke
parents:
diff changeset
   186
474761f14bca Initial load
duke
parents:
diff changeset
   187
    public Iterator getNonMatchingMimeHeaders(String[] names) {
474761f14bca Initial load
duke
parents:
diff changeset
   188
        return headers.getNonMatchingHeaders(names);
474761f14bca Initial load
duke
parents:
diff changeset
   189
    }
474761f14bca Initial load
duke
parents:
diff changeset
   190
474761f14bca Initial load
duke
parents:
diff changeset
   191
    public Source getContent() throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   192
        if (source != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   193
            InputStream bis = null;
474761f14bca Initial load
duke
parents:
diff changeset
   194
            if (source instanceof JAXMStreamSource) {
474761f14bca Initial load
duke
parents:
diff changeset
   195
                StreamSource streamSource = (StreamSource)source;
474761f14bca Initial load
duke
parents:
diff changeset
   196
                bis = streamSource.getInputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   197
            } else if (FastInfosetReflection.isFastInfosetSource(source)) {
474761f14bca Initial load
duke
parents:
diff changeset
   198
                // FastInfosetSource inherits from SAXSource
474761f14bca Initial load
duke
parents:
diff changeset
   199
                SAXSource saxSource = (SAXSource)source;
474761f14bca Initial load
duke
parents:
diff changeset
   200
                bis = saxSource.getInputSource().getByteStream();
474761f14bca Initial load
duke
parents:
diff changeset
   201
            }
474761f14bca Initial load
duke
parents:
diff changeset
   202
474761f14bca Initial load
duke
parents:
diff changeset
   203
            if (bis != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   204
                try {
474761f14bca Initial load
duke
parents:
diff changeset
   205
                    bis.reset();
474761f14bca Initial load
duke
parents:
diff changeset
   206
                } catch (IOException e) {
474761f14bca Initial load
duke
parents:
diff changeset
   207
                    /* This exception will never be thrown.
474761f14bca Initial load
duke
parents:
diff changeset
   208
                     *
474761f14bca Initial load
duke
parents:
diff changeset
   209
                     * The setContent method will modify the source
474761f14bca Initial load
duke
parents:
diff changeset
   210
                     * if StreamSource to JAXMStreamSource, that uses
474761f14bca Initial load
duke
parents:
diff changeset
   211
                     * a ByteInputStream, and for a FastInfosetSource will
474761f14bca Initial load
duke
parents:
diff changeset
   212
                     * replace the InputStream with a ByteInputStream.
474761f14bca Initial load
duke
parents:
diff changeset
   213
                     */
474761f14bca Initial load
duke
parents:
diff changeset
   214
                }
474761f14bca Initial load
duke
parents:
diff changeset
   215
            }
474761f14bca Initial load
duke
parents:
diff changeset
   216
            return source;
474761f14bca Initial load
duke
parents:
diff changeset
   217
        }
474761f14bca Initial load
duke
parents:
diff changeset
   218
474761f14bca Initial load
duke
parents:
diff changeset
   219
        return ((Envelope) getEnvelope()).getContent();
474761f14bca Initial load
duke
parents:
diff changeset
   220
    }
474761f14bca Initial load
duke
parents:
diff changeset
   221
474761f14bca Initial load
duke
parents:
diff changeset
   222
    public void setContent(Source source) throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   223
        try {
474761f14bca Initial load
duke
parents:
diff changeset
   224
            if (source instanceof StreamSource) {
474761f14bca Initial load
duke
parents:
diff changeset
   225
                InputStream is = ((StreamSource) source).getInputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   226
                Reader rdr = ((StreamSource) source).getReader();
474761f14bca Initial load
duke
parents:
diff changeset
   227
474761f14bca Initial load
duke
parents:
diff changeset
   228
                if (is != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   229
                    this.source = new JAXMStreamSource(is);
474761f14bca Initial load
duke
parents:
diff changeset
   230
                } else if (rdr != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   231
                    this.source = new JAXMStreamSource(rdr);
474761f14bca Initial load
duke
parents:
diff changeset
   232
                } else {
474761f14bca Initial load
duke
parents:
diff changeset
   233
                    log.severe("SAAJ0544.soap.no.valid.reader.for.src");
474761f14bca Initial load
duke
parents:
diff changeset
   234
                    throw new SOAPExceptionImpl("Source does not have a valid Reader or InputStream");
474761f14bca Initial load
duke
parents:
diff changeset
   235
                }
474761f14bca Initial load
duke
parents:
diff changeset
   236
            }
474761f14bca Initial load
duke
parents:
diff changeset
   237
            else if (FastInfosetReflection.isFastInfosetSource(source)) {
474761f14bca Initial load
duke
parents:
diff changeset
   238
                // InputStream is = source.getInputStream()
474761f14bca Initial load
duke
parents:
diff changeset
   239
                InputStream is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
474761f14bca Initial load
duke
parents:
diff changeset
   240
474761f14bca Initial load
duke
parents:
diff changeset
   241
                /*
474761f14bca Initial load
duke
parents:
diff changeset
   242
                 * Underlying stream must be ByteInputStream for getContentAsStream(). We pay the
474761f14bca Initial load
duke
parents:
diff changeset
   243
                 * cost of copying the underlying bytes here to avoid multiple copies every time
474761f14bca Initial load
duke
parents:
diff changeset
   244
                 * getBytes() is called on a ByteInputStream.
474761f14bca Initial load
duke
parents:
diff changeset
   245
                 */
474761f14bca Initial load
duke
parents:
diff changeset
   246
                if (!(is instanceof ByteInputStream)) {
474761f14bca Initial load
duke
parents:
diff changeset
   247
                    ByteOutputStream bout = new ByteOutputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   248
                    bout.write(is);
474761f14bca Initial load
duke
parents:
diff changeset
   249
474761f14bca Initial load
duke
parents:
diff changeset
   250
                    // source.setInputStream(new ByteInputStream(...))
474761f14bca Initial load
duke
parents:
diff changeset
   251
                    FastInfosetReflection.FastInfosetSource_setInputStream(
474761f14bca Initial load
duke
parents:
diff changeset
   252
                        source, bout.newInputStream());
474761f14bca Initial load
duke
parents:
diff changeset
   253
                }
474761f14bca Initial load
duke
parents:
diff changeset
   254
                this.source = source;
474761f14bca Initial load
duke
parents:
diff changeset
   255
            }
474761f14bca Initial load
duke
parents:
diff changeset
   256
            else {
474761f14bca Initial load
duke
parents:
diff changeset
   257
                this.source = source;
474761f14bca Initial load
duke
parents:
diff changeset
   258
            }
474761f14bca Initial load
duke
parents:
diff changeset
   259
            sourceWasSet = true;
474761f14bca Initial load
duke
parents:
diff changeset
   260
        }
474761f14bca Initial load
duke
parents:
diff changeset
   261
        catch (Exception ex) {
474761f14bca Initial load
duke
parents:
diff changeset
   262
            ex.printStackTrace();
474761f14bca Initial load
duke
parents:
diff changeset
   263
474761f14bca Initial load
duke
parents:
diff changeset
   264
            log.severe("SAAJ0545.soap.cannot.set.src.for.part");
474761f14bca Initial load
duke
parents:
diff changeset
   265
            throw new SOAPExceptionImpl(
474761f14bca Initial load
duke
parents:
diff changeset
   266
            "Error setting the source for SOAPPart: " + ex.getMessage());
474761f14bca Initial load
duke
parents:
diff changeset
   267
        }
474761f14bca Initial load
duke
parents:
diff changeset
   268
    }
474761f14bca Initial load
duke
parents:
diff changeset
   269
474761f14bca Initial load
duke
parents:
diff changeset
   270
    public ByteInputStream getContentAsStream() throws IOException {
474761f14bca Initial load
duke
parents:
diff changeset
   271
        if (source != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   272
            InputStream is = null;
474761f14bca Initial load
duke
parents:
diff changeset
   273
474761f14bca Initial load
duke
parents:
diff changeset
   274
            // Allow message to be transcode if so requested
474761f14bca Initial load
duke
parents:
diff changeset
   275
            if (source instanceof StreamSource && !isFastInfoset()) {
474761f14bca Initial load
duke
parents:
diff changeset
   276
                is = ((StreamSource) source).getInputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   277
            }
474761f14bca Initial load
duke
parents:
diff changeset
   278
            else if (FastInfosetReflection.isFastInfosetSource(source) &&
474761f14bca Initial load
duke
parents:
diff changeset
   279
                isFastInfoset())
474761f14bca Initial load
duke
parents:
diff changeset
   280
            {
474761f14bca Initial load
duke
parents:
diff changeset
   281
                try {
474761f14bca Initial load
duke
parents:
diff changeset
   282
                    // InputStream is = source.getInputStream()
474761f14bca Initial load
duke
parents:
diff changeset
   283
                    is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
474761f14bca Initial load
duke
parents:
diff changeset
   284
                }
474761f14bca Initial load
duke
parents:
diff changeset
   285
                catch (Exception e) {
474761f14bca Initial load
duke
parents:
diff changeset
   286
                    throw new IOException(e.toString());
474761f14bca Initial load
duke
parents:
diff changeset
   287
                }
474761f14bca Initial load
duke
parents:
diff changeset
   288
            }
474761f14bca Initial load
duke
parents:
diff changeset
   289
474761f14bca Initial load
duke
parents:
diff changeset
   290
            if (is != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   291
                if (!(is instanceof ByteInputStream)) {
474761f14bca Initial load
duke
parents:
diff changeset
   292
                    log.severe("SAAJ0546.soap.stream.incorrect.type");
474761f14bca Initial load
duke
parents:
diff changeset
   293
                    throw new IOException("Internal error: stream not of the right type");
474761f14bca Initial load
duke
parents:
diff changeset
   294
                }
474761f14bca Initial load
duke
parents:
diff changeset
   295
                return (ByteInputStream) is;
474761f14bca Initial load
duke
parents:
diff changeset
   296
            }
474761f14bca Initial load
duke
parents:
diff changeset
   297
            // need to do something here for reader...
474761f14bca Initial load
duke
parents:
diff changeset
   298
            // for now we'll see if we can fallback...
474761f14bca Initial load
duke
parents:
diff changeset
   299
        }
474761f14bca Initial load
duke
parents:
diff changeset
   300
474761f14bca Initial load
duke
parents:
diff changeset
   301
        ByteOutputStream b = new ByteOutputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   302
474761f14bca Initial load
duke
parents:
diff changeset
   303
        Envelope env = null;
474761f14bca Initial load
duke
parents:
diff changeset
   304
474761f14bca Initial load
duke
parents:
diff changeset
   305
        try {
474761f14bca Initial load
duke
parents:
diff changeset
   306
            env = (Envelope) getEnvelope();
474761f14bca Initial load
duke
parents:
diff changeset
   307
            env.output(b, isFastInfoset());
474761f14bca Initial load
duke
parents:
diff changeset
   308
        }
474761f14bca Initial load
duke
parents:
diff changeset
   309
        catch (SOAPException soapException) {
474761f14bca Initial load
duke
parents:
diff changeset
   310
            log.severe("SAAJ0547.soap.cannot.externalize");
474761f14bca Initial load
duke
parents:
diff changeset
   311
            throw new SOAPIOException(
474761f14bca Initial load
duke
parents:
diff changeset
   312
            "SOAP exception while trying to externalize: ",
474761f14bca Initial load
duke
parents:
diff changeset
   313
            soapException);
474761f14bca Initial load
duke
parents:
diff changeset
   314
        }
474761f14bca Initial load
duke
parents:
diff changeset
   315
474761f14bca Initial load
duke
parents:
diff changeset
   316
        return b.newInputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   317
    }
474761f14bca Initial load
duke
parents:
diff changeset
   318
474761f14bca Initial load
duke
parents:
diff changeset
   319
    MimeBodyPart getMimePart() throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   320
        try {
474761f14bca Initial load
duke
parents:
diff changeset
   321
            MimeBodyPart headerEnvelope = new MimeBodyPart();
474761f14bca Initial load
duke
parents:
diff changeset
   322
474761f14bca Initial load
duke
parents:
diff changeset
   323
            headerEnvelope.setDataHandler(getDataHandler());
474761f14bca Initial load
duke
parents:
diff changeset
   324
            AttachmentPartImpl.copyMimeHeaders(headers, headerEnvelope);
474761f14bca Initial load
duke
parents:
diff changeset
   325
474761f14bca Initial load
duke
parents:
diff changeset
   326
            return headerEnvelope;
474761f14bca Initial load
duke
parents:
diff changeset
   327
        } catch (SOAPException ex) {
474761f14bca Initial load
duke
parents:
diff changeset
   328
            throw ex;
474761f14bca Initial load
duke
parents:
diff changeset
   329
        } catch (Exception ex) {
474761f14bca Initial load
duke
parents:
diff changeset
   330
            log.severe("SAAJ0548.soap.cannot.externalize.hdr");
474761f14bca Initial load
duke
parents:
diff changeset
   331
            throw new SOAPExceptionImpl("Unable to externalize header", ex);
474761f14bca Initial load
duke
parents:
diff changeset
   332
        }
474761f14bca Initial load
duke
parents:
diff changeset
   333
    }
474761f14bca Initial load
duke
parents:
diff changeset
   334
474761f14bca Initial load
duke
parents:
diff changeset
   335
    MimeHeaders getMimeHeaders() {
474761f14bca Initial load
duke
parents:
diff changeset
   336
        return headers;
474761f14bca Initial load
duke
parents:
diff changeset
   337
    }
474761f14bca Initial load
duke
parents:
diff changeset
   338
474761f14bca Initial load
duke
parents:
diff changeset
   339
    DataHandler getDataHandler() {
474761f14bca Initial load
duke
parents:
diff changeset
   340
        DataSource ds = new DataSource() {
474761f14bca Initial load
duke
parents:
diff changeset
   341
            public OutputStream getOutputStream() throws IOException {
474761f14bca Initial load
duke
parents:
diff changeset
   342
                throw new IOException("Illegal Operation");
474761f14bca Initial load
duke
parents:
diff changeset
   343
            }
474761f14bca Initial load
duke
parents:
diff changeset
   344
474761f14bca Initial load
duke
parents:
diff changeset
   345
            public String getContentType() {
474761f14bca Initial load
duke
parents:
diff changeset
   346
                return getContentTypeString();
474761f14bca Initial load
duke
parents:
diff changeset
   347
            }
474761f14bca Initial load
duke
parents:
diff changeset
   348
474761f14bca Initial load
duke
parents:
diff changeset
   349
            public String getName() {
474761f14bca Initial load
duke
parents:
diff changeset
   350
                return getContentId();
474761f14bca Initial load
duke
parents:
diff changeset
   351
            }
474761f14bca Initial load
duke
parents:
diff changeset
   352
474761f14bca Initial load
duke
parents:
diff changeset
   353
            public InputStream getInputStream() throws IOException {
474761f14bca Initial load
duke
parents:
diff changeset
   354
                return getContentAsStream();
474761f14bca Initial load
duke
parents:
diff changeset
   355
            }
474761f14bca Initial load
duke
parents:
diff changeset
   356
        };
474761f14bca Initial load
duke
parents:
diff changeset
   357
        return new DataHandler(ds);
474761f14bca Initial load
duke
parents:
diff changeset
   358
    }
474761f14bca Initial load
duke
parents:
diff changeset
   359
474761f14bca Initial load
duke
parents:
diff changeset
   360
    public SOAPDocumentImpl getDocument() {
474761f14bca Initial load
duke
parents:
diff changeset
   361
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   362
        return document;
474761f14bca Initial load
duke
parents:
diff changeset
   363
    }
474761f14bca Initial load
duke
parents:
diff changeset
   364
474761f14bca Initial load
duke
parents:
diff changeset
   365
    public SOAPPartImpl getSOAPPart() {
474761f14bca Initial load
duke
parents:
diff changeset
   366
        return this;
474761f14bca Initial load
duke
parents:
diff changeset
   367
    }
474761f14bca Initial load
duke
parents:
diff changeset
   368
474761f14bca Initial load
duke
parents:
diff changeset
   369
    public DocumentType getDoctype() {
474761f14bca Initial load
duke
parents:
diff changeset
   370
        return document.getDoctype();
474761f14bca Initial load
duke
parents:
diff changeset
   371
    }
474761f14bca Initial load
duke
parents:
diff changeset
   372
474761f14bca Initial load
duke
parents:
diff changeset
   373
    // Forward all of these calls to the document to ensure that they work the
474761f14bca Initial load
duke
parents:
diff changeset
   374
    // same way whether they are called from here or directly from the document.
474761f14bca Initial load
duke
parents:
diff changeset
   375
    // If the document needs any help from this SOAPPart then
474761f14bca Initial load
duke
parents:
diff changeset
   376
    // Make it use a call-back as in doGetDocumentElement() below
474761f14bca Initial load
duke
parents:
diff changeset
   377
    public DOMImplementation getImplementation() {
474761f14bca Initial load
duke
parents:
diff changeset
   378
        return document.getImplementation();
474761f14bca Initial load
duke
parents:
diff changeset
   379
    }
474761f14bca Initial load
duke
parents:
diff changeset
   380
474761f14bca Initial load
duke
parents:
diff changeset
   381
    public Element getDocumentElement() {
474761f14bca Initial load
duke
parents:
diff changeset
   382
        // If there is no SOAP envelope already created, then create
474761f14bca Initial load
duke
parents:
diff changeset
   383
        // one from a source if one exists. If there is a newer source
474761f14bca Initial load
duke
parents:
diff changeset
   384
        // then use that source.
474761f14bca Initial load
duke
parents:
diff changeset
   385
        try {
474761f14bca Initial load
duke
parents:
diff changeset
   386
            getEnvelope();
474761f14bca Initial load
duke
parents:
diff changeset
   387
        } catch (SOAPException e) {
474761f14bca Initial load
duke
parents:
diff changeset
   388
        }
474761f14bca Initial load
duke
parents:
diff changeset
   389
        return document.getDocumentElement();
474761f14bca Initial load
duke
parents:
diff changeset
   390
    }
474761f14bca Initial load
duke
parents:
diff changeset
   391
474761f14bca Initial load
duke
parents:
diff changeset
   392
    protected void doGetDocumentElement() {
474761f14bca Initial load
duke
parents:
diff changeset
   393
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   394
        try {
474761f14bca Initial load
duke
parents:
diff changeset
   395
            lookForEnvelope();
474761f14bca Initial load
duke
parents:
diff changeset
   396
        } catch (SOAPException e) {
474761f14bca Initial load
duke
parents:
diff changeset
   397
        }
474761f14bca Initial load
duke
parents:
diff changeset
   398
    }
474761f14bca Initial load
duke
parents:
diff changeset
   399
474761f14bca Initial load
duke
parents:
diff changeset
   400
    public Element createElement(String tagName) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   401
        return document.createElement(tagName);
474761f14bca Initial load
duke
parents:
diff changeset
   402
    }
474761f14bca Initial load
duke
parents:
diff changeset
   403
474761f14bca Initial load
duke
parents:
diff changeset
   404
    public DocumentFragment createDocumentFragment() {
474761f14bca Initial load
duke
parents:
diff changeset
   405
        return document.createDocumentFragment();
474761f14bca Initial load
duke
parents:
diff changeset
   406
    }
474761f14bca Initial load
duke
parents:
diff changeset
   407
474761f14bca Initial load
duke
parents:
diff changeset
   408
    public org.w3c.dom.Text createTextNode(String data) {
474761f14bca Initial load
duke
parents:
diff changeset
   409
        return document.createTextNode(data);
474761f14bca Initial load
duke
parents:
diff changeset
   410
    }
474761f14bca Initial load
duke
parents:
diff changeset
   411
474761f14bca Initial load
duke
parents:
diff changeset
   412
    public Comment createComment(String data) {
474761f14bca Initial load
duke
parents:
diff changeset
   413
        return document.createComment(data);
474761f14bca Initial load
duke
parents:
diff changeset
   414
    }
474761f14bca Initial load
duke
parents:
diff changeset
   415
474761f14bca Initial load
duke
parents:
diff changeset
   416
    public CDATASection createCDATASection(String data) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   417
        return document.createCDATASection(data);
474761f14bca Initial load
duke
parents:
diff changeset
   418
    }
474761f14bca Initial load
duke
parents:
diff changeset
   419
474761f14bca Initial load
duke
parents:
diff changeset
   420
    public ProcessingInstruction createProcessingInstruction(
474761f14bca Initial load
duke
parents:
diff changeset
   421
    String target,
474761f14bca Initial load
duke
parents:
diff changeset
   422
    String data)
474761f14bca Initial load
duke
parents:
diff changeset
   423
    throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   424
        return document.createProcessingInstruction(target, data);
474761f14bca Initial load
duke
parents:
diff changeset
   425
    }
474761f14bca Initial load
duke
parents:
diff changeset
   426
474761f14bca Initial load
duke
parents:
diff changeset
   427
    public Attr createAttribute(String name) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   428
        return document.createAttribute(name);
474761f14bca Initial load
duke
parents:
diff changeset
   429
    }
474761f14bca Initial load
duke
parents:
diff changeset
   430
474761f14bca Initial load
duke
parents:
diff changeset
   431
    public EntityReference createEntityReference(String name)
474761f14bca Initial load
duke
parents:
diff changeset
   432
    throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   433
        return document.createEntityReference(name);
474761f14bca Initial load
duke
parents:
diff changeset
   434
    }
474761f14bca Initial load
duke
parents:
diff changeset
   435
474761f14bca Initial load
duke
parents:
diff changeset
   436
    public NodeList getElementsByTagName(String tagname) {
474761f14bca Initial load
duke
parents:
diff changeset
   437
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   438
        return document.getElementsByTagName(tagname);
474761f14bca Initial load
duke
parents:
diff changeset
   439
    }
474761f14bca Initial load
duke
parents:
diff changeset
   440
474761f14bca Initial load
duke
parents:
diff changeset
   441
    public org.w3c.dom.Node importNode(
474761f14bca Initial load
duke
parents:
diff changeset
   442
        org.w3c.dom.Node importedNode,
474761f14bca Initial load
duke
parents:
diff changeset
   443
        boolean deep)
474761f14bca Initial load
duke
parents:
diff changeset
   444
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   445
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   446
        return document.importNode(importedNode, deep);
474761f14bca Initial load
duke
parents:
diff changeset
   447
    }
474761f14bca Initial load
duke
parents:
diff changeset
   448
474761f14bca Initial load
duke
parents:
diff changeset
   449
    public Element createElementNS(String namespaceURI, String qualifiedName)
474761f14bca Initial load
duke
parents:
diff changeset
   450
    throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   451
        return document.createElementNS(namespaceURI, qualifiedName);
474761f14bca Initial load
duke
parents:
diff changeset
   452
    }
474761f14bca Initial load
duke
parents:
diff changeset
   453
474761f14bca Initial load
duke
parents:
diff changeset
   454
    public Attr createAttributeNS(String namespaceURI, String qualifiedName)
474761f14bca Initial load
duke
parents:
diff changeset
   455
    throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   456
        return document.createAttributeNS(namespaceURI, qualifiedName);
474761f14bca Initial load
duke
parents:
diff changeset
   457
    }
474761f14bca Initial load
duke
parents:
diff changeset
   458
474761f14bca Initial load
duke
parents:
diff changeset
   459
    public NodeList getElementsByTagNameNS(
474761f14bca Initial load
duke
parents:
diff changeset
   460
        String namespaceURI,
474761f14bca Initial load
duke
parents:
diff changeset
   461
        String localName) {
474761f14bca Initial load
duke
parents:
diff changeset
   462
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   463
        return document.getElementsByTagNameNS(namespaceURI, localName);
474761f14bca Initial load
duke
parents:
diff changeset
   464
    }
474761f14bca Initial load
duke
parents:
diff changeset
   465
474761f14bca Initial load
duke
parents:
diff changeset
   466
    public Element getElementById(String elementId) {
474761f14bca Initial load
duke
parents:
diff changeset
   467
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   468
        return document.getElementById(elementId);
474761f14bca Initial load
duke
parents:
diff changeset
   469
    }
474761f14bca Initial load
duke
parents:
diff changeset
   470
    public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
474761f14bca Initial load
duke
parents:
diff changeset
   471
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   472
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   473
        return document.appendChild(newChild);
474761f14bca Initial load
duke
parents:
diff changeset
   474
    }
474761f14bca Initial load
duke
parents:
diff changeset
   475
474761f14bca Initial load
duke
parents:
diff changeset
   476
    public org.w3c.dom.Node cloneNode(boolean deep) {
474761f14bca Initial load
duke
parents:
diff changeset
   477
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   478
        return document.cloneNode(deep);
474761f14bca Initial load
duke
parents:
diff changeset
   479
    }
474761f14bca Initial load
duke
parents:
diff changeset
   480
474761f14bca Initial load
duke
parents:
diff changeset
   481
    protected SOAPPartImpl doCloneNode() {
474761f14bca Initial load
duke
parents:
diff changeset
   482
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   483
        SOAPPartImpl newSoapPart = duplicateType();
474761f14bca Initial load
duke
parents:
diff changeset
   484
474761f14bca Initial load
duke
parents:
diff changeset
   485
        newSoapPart.headers = MimeHeadersUtil.copy(this.headers);
474761f14bca Initial load
duke
parents:
diff changeset
   486
        newSoapPart.source = this.source;
474761f14bca Initial load
duke
parents:
diff changeset
   487
        return newSoapPart;
474761f14bca Initial load
duke
parents:
diff changeset
   488
    }
474761f14bca Initial load
duke
parents:
diff changeset
   489
474761f14bca Initial load
duke
parents:
diff changeset
   490
    public NamedNodeMap getAttributes() {
474761f14bca Initial load
duke
parents:
diff changeset
   491
        return document.getAttributes();
474761f14bca Initial load
duke
parents:
diff changeset
   492
    }
474761f14bca Initial load
duke
parents:
diff changeset
   493
474761f14bca Initial load
duke
parents:
diff changeset
   494
    public NodeList getChildNodes() {
474761f14bca Initial load
duke
parents:
diff changeset
   495
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   496
        return document.getChildNodes();
474761f14bca Initial load
duke
parents:
diff changeset
   497
    }
474761f14bca Initial load
duke
parents:
diff changeset
   498
474761f14bca Initial load
duke
parents:
diff changeset
   499
    public org.w3c.dom.Node getFirstChild() {
474761f14bca Initial load
duke
parents:
diff changeset
   500
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   501
        return document.getFirstChild();
474761f14bca Initial load
duke
parents:
diff changeset
   502
    }
474761f14bca Initial load
duke
parents:
diff changeset
   503
474761f14bca Initial load
duke
parents:
diff changeset
   504
    public org.w3c.dom.Node getLastChild() {
474761f14bca Initial load
duke
parents:
diff changeset
   505
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   506
        return document.getLastChild();
474761f14bca Initial load
duke
parents:
diff changeset
   507
    }
474761f14bca Initial load
duke
parents:
diff changeset
   508
474761f14bca Initial load
duke
parents:
diff changeset
   509
    public String getLocalName() {
474761f14bca Initial load
duke
parents:
diff changeset
   510
        return document.getLocalName();
474761f14bca Initial load
duke
parents:
diff changeset
   511
    }
474761f14bca Initial load
duke
parents:
diff changeset
   512
474761f14bca Initial load
duke
parents:
diff changeset
   513
    public String getNamespaceURI() {
474761f14bca Initial load
duke
parents:
diff changeset
   514
        return document.getNamespaceURI();
474761f14bca Initial load
duke
parents:
diff changeset
   515
    }
474761f14bca Initial load
duke
parents:
diff changeset
   516
474761f14bca Initial load
duke
parents:
diff changeset
   517
    public org.w3c.dom.Node getNextSibling() {
474761f14bca Initial load
duke
parents:
diff changeset
   518
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   519
        return document.getNextSibling();
474761f14bca Initial load
duke
parents:
diff changeset
   520
    }
474761f14bca Initial load
duke
parents:
diff changeset
   521
474761f14bca Initial load
duke
parents:
diff changeset
   522
    public String getNodeName() {
474761f14bca Initial load
duke
parents:
diff changeset
   523
        return document.getNodeName();
474761f14bca Initial load
duke
parents:
diff changeset
   524
    }
474761f14bca Initial load
duke
parents:
diff changeset
   525
474761f14bca Initial load
duke
parents:
diff changeset
   526
    public short getNodeType() {
474761f14bca Initial load
duke
parents:
diff changeset
   527
        return document.getNodeType();
474761f14bca Initial load
duke
parents:
diff changeset
   528
    }
474761f14bca Initial load
duke
parents:
diff changeset
   529
474761f14bca Initial load
duke
parents:
diff changeset
   530
    public String getNodeValue() throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   531
        return document.getNodeValue();
474761f14bca Initial load
duke
parents:
diff changeset
   532
    }
474761f14bca Initial load
duke
parents:
diff changeset
   533
474761f14bca Initial load
duke
parents:
diff changeset
   534
    public Document getOwnerDocument() {
474761f14bca Initial load
duke
parents:
diff changeset
   535
        return document.getOwnerDocument();
474761f14bca Initial load
duke
parents:
diff changeset
   536
    }
474761f14bca Initial load
duke
parents:
diff changeset
   537
474761f14bca Initial load
duke
parents:
diff changeset
   538
    public org.w3c.dom.Node getParentNode() {
474761f14bca Initial load
duke
parents:
diff changeset
   539
        return document.getParentNode();
474761f14bca Initial load
duke
parents:
diff changeset
   540
    }
474761f14bca Initial load
duke
parents:
diff changeset
   541
474761f14bca Initial load
duke
parents:
diff changeset
   542
    public String getPrefix() {
474761f14bca Initial load
duke
parents:
diff changeset
   543
        return document.getPrefix();
474761f14bca Initial load
duke
parents:
diff changeset
   544
    }
474761f14bca Initial load
duke
parents:
diff changeset
   545
474761f14bca Initial load
duke
parents:
diff changeset
   546
    public org.w3c.dom.Node getPreviousSibling() {
474761f14bca Initial load
duke
parents:
diff changeset
   547
        return document.getPreviousSibling();
474761f14bca Initial load
duke
parents:
diff changeset
   548
    }
474761f14bca Initial load
duke
parents:
diff changeset
   549
474761f14bca Initial load
duke
parents:
diff changeset
   550
    public boolean hasAttributes() {
474761f14bca Initial load
duke
parents:
diff changeset
   551
        return document.hasAttributes();
474761f14bca Initial load
duke
parents:
diff changeset
   552
    }
474761f14bca Initial load
duke
parents:
diff changeset
   553
474761f14bca Initial load
duke
parents:
diff changeset
   554
    public boolean hasChildNodes() {
474761f14bca Initial load
duke
parents:
diff changeset
   555
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   556
        return document.hasChildNodes();
474761f14bca Initial load
duke
parents:
diff changeset
   557
    }
474761f14bca Initial load
duke
parents:
diff changeset
   558
474761f14bca Initial load
duke
parents:
diff changeset
   559
    public org.w3c.dom.Node insertBefore(
474761f14bca Initial load
duke
parents:
diff changeset
   560
        org.w3c.dom.Node arg0,
474761f14bca Initial load
duke
parents:
diff changeset
   561
        org.w3c.dom.Node arg1)
474761f14bca Initial load
duke
parents:
diff changeset
   562
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   563
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   564
        return document.insertBefore(arg0, arg1);
474761f14bca Initial load
duke
parents:
diff changeset
   565
    }
474761f14bca Initial load
duke
parents:
diff changeset
   566
474761f14bca Initial load
duke
parents:
diff changeset
   567
    public boolean isSupported(String arg0, String arg1) {
474761f14bca Initial load
duke
parents:
diff changeset
   568
        return document.isSupported(arg0, arg1);
474761f14bca Initial load
duke
parents:
diff changeset
   569
    }
474761f14bca Initial load
duke
parents:
diff changeset
   570
474761f14bca Initial load
duke
parents:
diff changeset
   571
    public void normalize() {
474761f14bca Initial load
duke
parents:
diff changeset
   572
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   573
        document.normalize();
474761f14bca Initial load
duke
parents:
diff changeset
   574
    }
474761f14bca Initial load
duke
parents:
diff changeset
   575
474761f14bca Initial load
duke
parents:
diff changeset
   576
    public org.w3c.dom.Node removeChild(org.w3c.dom.Node arg0)
474761f14bca Initial load
duke
parents:
diff changeset
   577
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   578
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   579
        return document.removeChild(arg0);
474761f14bca Initial load
duke
parents:
diff changeset
   580
    }
474761f14bca Initial load
duke
parents:
diff changeset
   581
474761f14bca Initial load
duke
parents:
diff changeset
   582
    public org.w3c.dom.Node replaceChild(
474761f14bca Initial load
duke
parents:
diff changeset
   583
        org.w3c.dom.Node arg0,
474761f14bca Initial load
duke
parents:
diff changeset
   584
        org.w3c.dom.Node arg1)
474761f14bca Initial load
duke
parents:
diff changeset
   585
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   586
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   587
        return document.replaceChild(arg0, arg1);
474761f14bca Initial load
duke
parents:
diff changeset
   588
    }
474761f14bca Initial load
duke
parents:
diff changeset
   589
474761f14bca Initial load
duke
parents:
diff changeset
   590
    public void setNodeValue(String arg0) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   591
        document.setNodeValue(arg0);
474761f14bca Initial load
duke
parents:
diff changeset
   592
    }
474761f14bca Initial load
duke
parents:
diff changeset
   593
474761f14bca Initial load
duke
parents:
diff changeset
   594
    public void setPrefix(String arg0) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   595
        document.setPrefix(arg0);
474761f14bca Initial load
duke
parents:
diff changeset
   596
    }
474761f14bca Initial load
duke
parents:
diff changeset
   597
474761f14bca Initial load
duke
parents:
diff changeset
   598
    private void handleNewSource() {
474761f14bca Initial load
duke
parents:
diff changeset
   599
        if (sourceWasSet) {
474761f14bca Initial load
duke
parents:
diff changeset
   600
         // There is a newer source use that source.
474761f14bca Initial load
duke
parents:
diff changeset
   601
         try {
474761f14bca Initial load
duke
parents:
diff changeset
   602
             getEnvelope();
474761f14bca Initial load
duke
parents:
diff changeset
   603
         } catch (SOAPException e) {
474761f14bca Initial load
duke
parents:
diff changeset
   604
         }
474761f14bca Initial load
duke
parents:
diff changeset
   605
      }
474761f14bca Initial load
duke
parents:
diff changeset
   606
    }
474761f14bca Initial load
duke
parents:
diff changeset
   607
474761f14bca Initial load
duke
parents:
diff changeset
   608
    protected XMLDeclarationParser lookForXmlDecl() throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   609
        if ((source != null) && (source instanceof StreamSource)) {
474761f14bca Initial load
duke
parents:
diff changeset
   610
474761f14bca Initial load
duke
parents:
diff changeset
   611
            Reader reader = null;
474761f14bca Initial load
duke
parents:
diff changeset
   612
474761f14bca Initial load
duke
parents:
diff changeset
   613
            InputStream inputStream = ((StreamSource) source).getInputStream();
474761f14bca Initial load
duke
parents:
diff changeset
   614
            if (inputStream != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   615
                if (sourceCharsetEncoding == null) {
474761f14bca Initial load
duke
parents:
diff changeset
   616
                    reader = new InputStreamReader(inputStream);
474761f14bca Initial load
duke
parents:
diff changeset
   617
                } else {
474761f14bca Initial load
duke
parents:
diff changeset
   618
                    try {
474761f14bca Initial load
duke
parents:
diff changeset
   619
                        reader =
474761f14bca Initial load
duke
parents:
diff changeset
   620
                            new InputStreamReader(
474761f14bca Initial load
duke
parents:
diff changeset
   621
                                inputStream, sourceCharsetEncoding);
474761f14bca Initial load
duke
parents:
diff changeset
   622
                    } catch (UnsupportedEncodingException uee) {
474761f14bca Initial load
duke
parents:
diff changeset
   623
                        log.log(
474761f14bca Initial load
duke
parents:
diff changeset
   624
                            Level.SEVERE,
474761f14bca Initial load
duke
parents:
diff changeset
   625
                            "SAAJ0551.soap.unsupported.encoding",
474761f14bca Initial load
duke
parents:
diff changeset
   626
                            new Object[] {sourceCharsetEncoding});
474761f14bca Initial load
duke
parents:
diff changeset
   627
                        throw new SOAPExceptionImpl(
474761f14bca Initial load
duke
parents:
diff changeset
   628
                            "Unsupported encoding " + sourceCharsetEncoding,
474761f14bca Initial load
duke
parents:
diff changeset
   629
                            uee);
474761f14bca Initial load
duke
parents:
diff changeset
   630
                    }
474761f14bca Initial load
duke
parents:
diff changeset
   631
                }
474761f14bca Initial load
duke
parents:
diff changeset
   632
            } else {
474761f14bca Initial load
duke
parents:
diff changeset
   633
                reader = ((StreamSource) source).getReader();
474761f14bca Initial load
duke
parents:
diff changeset
   634
            }
474761f14bca Initial load
duke
parents:
diff changeset
   635
            if (reader != null) {
474761f14bca Initial load
duke
parents:
diff changeset
   636
                PushbackReader pushbackReader =
474761f14bca Initial load
duke
parents:
diff changeset
   637
                    new PushbackReader(reader, 4096); //some size to unread <?xml ....?>
474761f14bca Initial load
duke
parents:
diff changeset
   638
                XMLDeclarationParser ev =
474761f14bca Initial load
duke
parents:
diff changeset
   639
                        new XMLDeclarationParser(pushbackReader);
474761f14bca Initial load
duke
parents:
diff changeset
   640
                try {
474761f14bca Initial load
duke
parents:
diff changeset
   641
                    ev.parse();
474761f14bca Initial load
duke
parents:
diff changeset
   642
                } catch (Exception e) {
474761f14bca Initial load
duke
parents:
diff changeset
   643
                    log.log(
474761f14bca Initial load
duke
parents:
diff changeset
   644
                        Level.SEVERE,
474761f14bca Initial load
duke
parents:
diff changeset
   645
                        "SAAJ0552.soap.xml.decl.parsing.failed");
474761f14bca Initial load
duke
parents:
diff changeset
   646
                    throw new SOAPExceptionImpl(
474761f14bca Initial load
duke
parents:
diff changeset
   647
                        "XML declaration parsing failed", e);
474761f14bca Initial load
duke
parents:
diff changeset
   648
                }
474761f14bca Initial load
duke
parents:
diff changeset
   649
                String xmlDecl = ev.getXmlDeclaration();
474761f14bca Initial load
duke
parents:
diff changeset
   650
                if ((xmlDecl != null) && (xmlDecl.length() > 0))
474761f14bca Initial load
duke
parents:
diff changeset
   651
                    this.omitXmlDecl = false;
474761f14bca Initial load
duke
parents:
diff changeset
   652
                return ev;
474761f14bca Initial load
duke
parents:
diff changeset
   653
            }
474761f14bca Initial load
duke
parents:
diff changeset
   654
        }
474761f14bca Initial load
duke
parents:
diff changeset
   655
        return null;
474761f14bca Initial load
duke
parents:
diff changeset
   656
    }
474761f14bca Initial load
duke
parents:
diff changeset
   657
474761f14bca Initial load
duke
parents:
diff changeset
   658
    public void setSourceCharsetEncoding(String charset) {
474761f14bca Initial load
duke
parents:
diff changeset
   659
        this.sourceCharsetEncoding = charset;
474761f14bca Initial load
duke
parents:
diff changeset
   660
    }
474761f14bca Initial load
duke
parents:
diff changeset
   661
474761f14bca Initial load
duke
parents:
diff changeset
   662
    public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName)
474761f14bca Initial load
duke
parents:
diff changeset
   663
        throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   664
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   665
        return document.renameNode(n, namespaceURI, qualifiedName);
474761f14bca Initial load
duke
parents:
diff changeset
   666
    }
474761f14bca Initial load
duke
parents:
diff changeset
   667
474761f14bca Initial load
duke
parents:
diff changeset
   668
    public void normalizeDocument() {
474761f14bca Initial load
duke
parents:
diff changeset
   669
        document.normalizeDocument();
474761f14bca Initial load
duke
parents:
diff changeset
   670
    }
474761f14bca Initial load
duke
parents:
diff changeset
   671
474761f14bca Initial load
duke
parents:
diff changeset
   672
    public DOMConfiguration getDomConfig() {
474761f14bca Initial load
duke
parents:
diff changeset
   673
        return document.getDomConfig();
474761f14bca Initial load
duke
parents:
diff changeset
   674
    }
474761f14bca Initial load
duke
parents:
diff changeset
   675
474761f14bca Initial load
duke
parents:
diff changeset
   676
    public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   677
        handleNewSource();
474761f14bca Initial load
duke
parents:
diff changeset
   678
        return document.adoptNode(source);
474761f14bca Initial load
duke
parents:
diff changeset
   679
    }
474761f14bca Initial load
duke
parents:
diff changeset
   680
474761f14bca Initial load
duke
parents:
diff changeset
   681
    public void setDocumentURI(String documentURI) {
474761f14bca Initial load
duke
parents:
diff changeset
   682
        document.setDocumentURI(documentURI);
474761f14bca Initial load
duke
parents:
diff changeset
   683
    }
474761f14bca Initial load
duke
parents:
diff changeset
   684
474761f14bca Initial load
duke
parents:
diff changeset
   685
    public String getDocumentURI() {
474761f14bca Initial load
duke
parents:
diff changeset
   686
        return document.getDocumentURI();
474761f14bca Initial load
duke
parents:
diff changeset
   687
    }
474761f14bca Initial load
duke
parents:
diff changeset
   688
474761f14bca Initial load
duke
parents:
diff changeset
   689
    public void  setStrictErrorChecking(boolean strictErrorChecking) {
474761f14bca Initial load
duke
parents:
diff changeset
   690
        document.setStrictErrorChecking(strictErrorChecking);
474761f14bca Initial load
duke
parents:
diff changeset
   691
    }
474761f14bca Initial load
duke
parents:
diff changeset
   692
474761f14bca Initial load
duke
parents:
diff changeset
   693
    public String getInputEncoding() {
474761f14bca Initial load
duke
parents:
diff changeset
   694
        return document.getInputEncoding();
474761f14bca Initial load
duke
parents:
diff changeset
   695
    }
474761f14bca Initial load
duke
parents:
diff changeset
   696
474761f14bca Initial load
duke
parents:
diff changeset
   697
    public String getXmlEncoding() {
474761f14bca Initial load
duke
parents:
diff changeset
   698
        return document.getXmlEncoding();
474761f14bca Initial load
duke
parents:
diff changeset
   699
    }
474761f14bca Initial load
duke
parents:
diff changeset
   700
474761f14bca Initial load
duke
parents:
diff changeset
   701
    public boolean getXmlStandalone() {
474761f14bca Initial load
duke
parents:
diff changeset
   702
        return document.getXmlStandalone();
474761f14bca Initial load
duke
parents:
diff changeset
   703
    }
474761f14bca Initial load
duke
parents:
diff changeset
   704
474761f14bca Initial load
duke
parents:
diff changeset
   705
    public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   706
        document.setXmlStandalone(xmlStandalone);
474761f14bca Initial load
duke
parents:
diff changeset
   707
    }
474761f14bca Initial load
duke
parents:
diff changeset
   708
474761f14bca Initial load
duke
parents:
diff changeset
   709
    public String getXmlVersion() {
474761f14bca Initial load
duke
parents:
diff changeset
   710
        return document.getXmlVersion();
474761f14bca Initial load
duke
parents:
diff changeset
   711
    }
474761f14bca Initial load
duke
parents:
diff changeset
   712
474761f14bca Initial load
duke
parents:
diff changeset
   713
    public void setXmlVersion(String xmlVersion) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   714
        document.setXmlVersion(xmlVersion);
474761f14bca Initial load
duke
parents:
diff changeset
   715
    }
474761f14bca Initial load
duke
parents:
diff changeset
   716
474761f14bca Initial load
duke
parents:
diff changeset
   717
    public boolean  getStrictErrorChecking() {
474761f14bca Initial load
duke
parents:
diff changeset
   718
        return document.getStrictErrorChecking();
474761f14bca Initial load
duke
parents:
diff changeset
   719
    }
474761f14bca Initial load
duke
parents:
diff changeset
   720
474761f14bca Initial load
duke
parents:
diff changeset
   721
    // DOM L3 methods from org.w3c.dom.Node
474761f14bca Initial load
duke
parents:
diff changeset
   722
    public String getBaseURI() {
474761f14bca Initial load
duke
parents:
diff changeset
   723
        return document.getBaseURI();
474761f14bca Initial load
duke
parents:
diff changeset
   724
    }
474761f14bca Initial load
duke
parents:
diff changeset
   725
474761f14bca Initial load
duke
parents:
diff changeset
   726
    public short compareDocumentPosition(org.w3c.dom.Node other)
474761f14bca Initial load
duke
parents:
diff changeset
   727
                              throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   728
        return document.compareDocumentPosition(other);
474761f14bca Initial load
duke
parents:
diff changeset
   729
    }
474761f14bca Initial load
duke
parents:
diff changeset
   730
474761f14bca Initial load
duke
parents:
diff changeset
   731
    public String getTextContent()
474761f14bca Initial load
duke
parents:
diff changeset
   732
                      throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   733
        return document.getTextContent();
474761f14bca Initial load
duke
parents:
diff changeset
   734
    }
474761f14bca Initial load
duke
parents:
diff changeset
   735
474761f14bca Initial load
duke
parents:
diff changeset
   736
    public void setTextContent(String textContent) throws DOMException {
474761f14bca Initial load
duke
parents:
diff changeset
   737
         document.setTextContent(textContent);
474761f14bca Initial load
duke
parents:
diff changeset
   738
    }
474761f14bca Initial load
duke
parents:
diff changeset
   739
474761f14bca Initial load
duke
parents:
diff changeset
   740
    public boolean isSameNode(org.w3c.dom.Node other) {
474761f14bca Initial load
duke
parents:
diff changeset
   741
        return document.isSameNode(other);
474761f14bca Initial load
duke
parents:
diff changeset
   742
    }
474761f14bca Initial load
duke
parents:
diff changeset
   743
474761f14bca Initial load
duke
parents:
diff changeset
   744
    public String lookupPrefix(String namespaceURI) {
474761f14bca Initial load
duke
parents:
diff changeset
   745
        return document.lookupPrefix(namespaceURI);
474761f14bca Initial load
duke
parents:
diff changeset
   746
    }
474761f14bca Initial load
duke
parents:
diff changeset
   747
474761f14bca Initial load
duke
parents:
diff changeset
   748
    public boolean isDefaultNamespace(String namespaceURI) {
474761f14bca Initial load
duke
parents:
diff changeset
   749
        return document.isDefaultNamespace(namespaceURI);
474761f14bca Initial load
duke
parents:
diff changeset
   750
    }
474761f14bca Initial load
duke
parents:
diff changeset
   751
474761f14bca Initial load
duke
parents:
diff changeset
   752
    public String lookupNamespaceURI(String prefix) {
474761f14bca Initial load
duke
parents:
diff changeset
   753
        return document.lookupNamespaceURI(prefix);
474761f14bca Initial load
duke
parents:
diff changeset
   754
    }
474761f14bca Initial load
duke
parents:
diff changeset
   755
474761f14bca Initial load
duke
parents:
diff changeset
   756
    public boolean isEqualNode(org.w3c.dom.Node arg) {
474761f14bca Initial load
duke
parents:
diff changeset
   757
        return document.isEqualNode(arg);
474761f14bca Initial load
duke
parents:
diff changeset
   758
    }
474761f14bca Initial load
duke
parents:
diff changeset
   759
474761f14bca Initial load
duke
parents:
diff changeset
   760
    public Object getFeature(String feature,
474761f14bca Initial load
duke
parents:
diff changeset
   761
                  String version) {
474761f14bca Initial load
duke
parents:
diff changeset
   762
        return  document.getFeature(feature,version);
474761f14bca Initial load
duke
parents:
diff changeset
   763
    }
474761f14bca Initial load
duke
parents:
diff changeset
   764
474761f14bca Initial load
duke
parents:
diff changeset
   765
    public Object setUserData(String key,
474761f14bca Initial load
duke
parents:
diff changeset
   766
                   Object data,
474761f14bca Initial load
duke
parents:
diff changeset
   767
                  UserDataHandler handler) {
474761f14bca Initial load
duke
parents:
diff changeset
   768
        return document.setUserData(key, data, handler);
474761f14bca Initial load
duke
parents:
diff changeset
   769
    }
474761f14bca Initial load
duke
parents:
diff changeset
   770
474761f14bca Initial load
duke
parents:
diff changeset
   771
    public Object getUserData(String key) {
474761f14bca Initial load
duke
parents:
diff changeset
   772
        return document.getUserData(key);
474761f14bca Initial load
duke
parents:
diff changeset
   773
    }
474761f14bca Initial load
duke
parents:
diff changeset
   774
474761f14bca Initial load
duke
parents:
diff changeset
   775
    public void recycleNode() {
474761f14bca Initial load
duke
parents:
diff changeset
   776
        // Nothing seems to be required to be done here
474761f14bca Initial load
duke
parents:
diff changeset
   777
    }
474761f14bca Initial load
duke
parents:
diff changeset
   778
474761f14bca Initial load
duke
parents:
diff changeset
   779
    public String getValue() {
474761f14bca Initial load
duke
parents:
diff changeset
   780
        return null;
474761f14bca Initial load
duke
parents:
diff changeset
   781
    }
474761f14bca Initial load
duke
parents:
diff changeset
   782
474761f14bca Initial load
duke
parents:
diff changeset
   783
    public void setValue(String value) {
474761f14bca Initial load
duke
parents:
diff changeset
   784
        log.severe("SAAJ0571.soappart.setValue.not.defined");
474761f14bca Initial load
duke
parents:
diff changeset
   785
        throw new IllegalStateException("Setting value of a soap part is not defined");
474761f14bca Initial load
duke
parents:
diff changeset
   786
    }
474761f14bca Initial load
duke
parents:
diff changeset
   787
474761f14bca Initial load
duke
parents:
diff changeset
   788
    public void setParentElement(SOAPElement parent) throws SOAPException {
474761f14bca Initial load
duke
parents:
diff changeset
   789
        log.severe("SAAJ0570.soappart.parent.element.not.defined");
474761f14bca Initial load
duke
parents:
diff changeset
   790
        throw new SOAPExceptionImpl("The parent element of a soap part is not defined");
474761f14bca Initial load
duke
parents:
diff changeset
   791
    }
474761f14bca Initial load
duke
parents:
diff changeset
   792
474761f14bca Initial load
duke
parents:
diff changeset
   793
    public SOAPElement getParentElement() {
474761f14bca Initial load
duke
parents:
diff changeset
   794
        return null;
474761f14bca Initial load
duke
parents:
diff changeset
   795
    }
474761f14bca Initial load
duke
parents:
diff changeset
   796
474761f14bca Initial load
duke
parents:
diff changeset
   797
    public void detachNode() {
474761f14bca Initial load
duke
parents:
diff changeset
   798
        // Nothing seems to be required to be done here
474761f14bca Initial load
duke
parents:
diff changeset
   799
    }
474761f14bca Initial load
duke
parents:
diff changeset
   800
}