src/java.xml.ws/share/classes/javax/xml/soap/MessageFactory.java
author aefimov
Thu, 23 Nov 2017 18:23:15 +0000
changeset 47930 f2de2c55c6c7
parent 47216 71c04702a3d5
permissions -rw-r--r--
8187954: Update JAX-WS RI integration to latest version Reviewed-by: lancea Contributed-by: zheng.jun.li@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     1
/*
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
     2
 * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     4
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    10
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    15
 * accompanied this code).
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    16
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    20
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    23
 * questions.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    24
 */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    25
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    26
package javax.xml.soap;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    27
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    28
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    29
import java.io.IOException;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    30
import java.io.InputStream;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    31
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    32
/**
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    33
 * A factory for creating {@code SOAPMessage} objects.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    34
 * <P>
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    35
 * A SAAJ client can create a {@code MessageFactory} object
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    36
 * using the method {@code newInstance}, as shown in the following
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    37
 * lines of code.
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    38
 * <pre>{@code
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    39
 *       MessageFactory mf = MessageFactory.newInstance();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    40
 *       MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    41
 * }</pre>
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    42
 * <P>
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    43
 * All {@code MessageFactory} objects, regardless of how they are
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    44
 * created, will produce {@code SOAPMessage} objects that
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    45
 * have the following elements by default:
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    46
 * <UL>
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    47
 *  <LI>A {@code SOAPPart} object
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    48
 *  <LI>A {@code SOAPEnvelope} object
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    49
 *  <LI>A {@code SOAPBody} object
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    50
 *  <LI>A {@code SOAPHeader} object
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    51
 * </UL>
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    52
 * In some cases, specialized MessageFactory objects may be obtained that produce messages
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    53
 * prepopulated with additional entries in the {@code SOAPHeader} object and the
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    54
 * {@code SOAPBody} object.
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    55
 * The content of a new {@code SOAPMessage} object depends on which of the two
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    56
 * {@code MessageFactory} methods is used to create it.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    57
 * <UL>
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    58
 *  <LI>{@code createMessage()} <BR>
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    59
 *      This is the method clients would normally use to create a request message.
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    60
 *  <LI>{@code createMessage(MimeHeaders, java.io.InputStream)} -- message has
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    61
 *       content from the {@code InputStream} object and headers from the
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    62
 *       {@code MimeHeaders} object <BR>
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    63
 *        This method can be used internally by a service implementation to
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    64
 *        create a message that is a response to a request.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    65
 * </UL>
25840
c2002453eec3 8047724: @since tag cleanup in jaxws
henryjen
parents: 20590
diff changeset
    66
 *
c2002453eec3 8047724: @since tag cleanup in jaxws
henryjen
parents: 20590
diff changeset
    67
 * @since 1.6
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    68
 */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    69
public abstract class MessageFactory {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    70
34467
024f1ce7da02 8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
mkos
parents: 31746
diff changeset
    71
    private static final String DEFAULT_MESSAGE_FACTORY
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    72
        = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl";
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    73
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    74
    /**
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    75
     * Creates a new {@code MessageFactory} object that is an instance
34467
024f1ce7da02 8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
mkos
parents: 31746
diff changeset
    76
     * of the default implementation (SOAP 1.1).
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    77
     *
34467
024f1ce7da02 8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
mkos
parents: 31746
diff changeset
    78
     * This method uses the lookup procedure specified in {@link javax.xml.soap} to locate and load the
024f1ce7da02 8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
mkos
parents: 31746
diff changeset
    79
     * {@link javax.xml.soap.MessageFactory} class.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    80
     *
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    81
     * @return a new instance of a {@code MessageFactory}
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    82
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    83
     * @exception SOAPException if there was an error in creating the
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    84
     *            default implementation of the
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
    85
     *            {@code MessageFactory}.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    86
     * @see SAAJMetaFactory
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    87
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    88
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    89
    public static MessageFactory newInstance() throws SOAPException {
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    90
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    91
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    92
        try {
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    93
            MessageFactory factory = (MessageFactory) FactoryFinder.find(
34467
024f1ce7da02 8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
mkos
parents: 31746
diff changeset
    94
                    MessageFactory.class,
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    95
                    DEFAULT_MESSAGE_FACTORY,
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    96
                    false);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    97
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
    98
            if (factory != null) {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    99
                return factory;
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
   100
            }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   101
            return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
18372
4d90cbb0d70a 8013021: Rebase 8005432 & 8003542 against the latest jdk8/jaxws
mkos
parents: 16791
diff changeset
   102
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   103
        } catch (Exception ex) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   104
            throw new SOAPException(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   105
                    "Unable to create message factory for SOAP: "
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   106
                                    +ex.getMessage());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   107
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   108
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   109
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   110
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   111
    /**
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   112
     * Creates a new {@code MessageFactory} object that is an instance
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   113
     * of the specified implementation.  May be a dynamic message factory,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   114
     * a SOAP 1.1 message factory, or a SOAP 1.2 message factory. A dynamic
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   115
     * message factory creates messages based on the MIME headers specified
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   116
     * as arguments to the {@code createMessage} method.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   117
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   118
     * This method uses the SAAJMetaFactory to locate the implementation class
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   119
     * and create the MessageFactory instance.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   120
     *
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   121
     * @return a new instance of a {@code MessageFactory}
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   122
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   123
     * @param protocol  a string constant representing the class of the
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   124
     *                   specified message factory implementation. May be
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   125
     *                   either {@code DYNAMIC_SOAP_PROTOCOL},
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   126
     *                   {@code DEFAULT_SOAP_PROTOCOL} (which is the same
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   127
     *                   as) {@code SOAP_1_1_PROTOCOL}, or
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   128
     *                   {@code SOAP_1_2_PROTOCOL}.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   129
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   130
     * @exception SOAPException if there was an error in creating the
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   131
     *            specified implementation of  {@code MessageFactory}.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   132
     * @see SAAJMetaFactory
25840
c2002453eec3 8047724: @since tag cleanup in jaxws
henryjen
parents: 20590
diff changeset
   133
     * @since 1.6, SAAJ 1.3
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   134
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   135
    public static MessageFactory newInstance(String protocol) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   136
        return SAAJMetaFactory.getInstance().newMessageFactory(protocol);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   137
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   138
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   139
    /**
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   140
     * Creates a new {@code SOAPMessage} object with the default
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   141
     * {@code SOAPPart}, {@code SOAPEnvelope}, {@code SOAPBody},
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   142
     * and {@code SOAPHeader} objects. Profile-specific message factories
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   143
     * can choose to prepopulate the {@code SOAPMessage} object with
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   144
     * profile-specific headers.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   145
     * <P>
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   146
     * Content can be added to this message's {@code SOAPPart} object, and
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   147
     * the message can be sent "as is" when a message containing only a SOAP part
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   148
     * is sufficient. Otherwise, the {@code SOAPMessage} object needs
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   149
     * to create one or more {@code AttachmentPart} objects and
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   150
     * add them to itself. Any content that is not in XML format must be
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   151
     * in an {@code AttachmentPart} object.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   152
     *
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   153
     * @return a new {@code SOAPMessage} object
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   154
     * @exception SOAPException if a SOAP error occurs
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   155
     * @exception UnsupportedOperationException if the protocol of this
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   156
     *      {@code MessageFactory} instance is {@code DYNAMIC_SOAP_PROTOCOL}
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   157
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   158
    public abstract SOAPMessage createMessage()
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   159
        throws SOAPException;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   160
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   161
    /**
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   162
     * Internalizes the contents of the given {@code InputStream} object into a
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   163
     * new {@code SOAPMessage} object and returns the {@code SOAPMessage}
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   164
     * object.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   165
     *
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   166
     * @param in the {@code InputStream} object that contains the data
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   167
     *           for a message
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   168
     * @param headers the transport-specific headers passed to the
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   169
     *        message in a transport-independent fashion for creation of the
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   170
     *        message
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   171
     * @return a new {@code SOAPMessage} object containing the data from
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   172
     *         the given {@code InputStream} object
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   173
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   174
     * @exception IOException if there is a problem in reading data from
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   175
     *            the input stream
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   176
     *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   177
     * @exception SOAPException may be thrown if the message is invalid
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   178
     *
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   179
     * @exception IllegalArgumentException if the {@code MessageFactory}
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   180
     *      requires one or more MIME headers to be present in the
31746
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   181
     *      {@code headers} parameter and they are missing.
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   182
     *      {@code MessageFactory} implementations for
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   183
     *      {@code SOAP_1_1_PROTOCOL} or
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   184
     *      {@code SOAP_1_2_PROTOCOL} must not throw
7573de6b8e46 8130753: Sync-up javadoc changes in jax-ws area - includes JAX-B API, JAX-WS API, SAAJ-API
mkos
parents: 28326
diff changeset
   185
     *      {@code IllegalArgumentException} for this reason.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   186
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   187
    public abstract SOAPMessage createMessage(MimeHeaders headers,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   188
                                              InputStream in)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   189
        throws IOException, SOAPException;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   190
}