1/*
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26/**
27 * Provides the API for creating and building SOAP messages. This package
28 * is defined in the <i>SOAP with Attachments API for Java&trade; (SAAJ) 1.4</i> specification.
29 *
30 * <p> The API in the <code>javax.xml.soap</code> package allows you to do the following:
31 *
32 * <ul>
33 *     <li>create a point-to-point connection to a specified endpoint
34 *     <li>create a SOAP message
35 *     <li>create an XML fragment
36 *     <li>add content to the header of a SOAP message
37 *     <li>add content to the body of a SOAP message
38 *     <li>create attachment parts and add content to them
39 *     <li>access/add/modify parts of a SOAP message
40 *     <li>create/add/modify SOAP fault information
41 *     <li>extract content from a SOAP message
42 *     <li>send a SOAP request-response message
43 * </ul>
44 *
45 * <p>
46 * In addition the APIs in the <code>javax.xml.soap</code> package extend
47 * their  counterparts in the <code>org.w3c.dom</code> package. This means that
48 * the  <code>SOAPPart</code> of a <code>SOAPMessage</code> is also a DOM Level
49 * 2 <code>Document</code>, and can be manipulated as such by applications,
50 * tools and libraries that use DOM (see http://www.w3.org/DOM/ for more information).
51 * It is important to note that, while it is possible to use DOM APIs to add
52 * ordinary DOM nodes to a SAAJ tree, the SAAJ APIs are still required to return
53 * SAAJ types when examining or manipulating the tree. In order to accomplish
54 * this the SAAJ APIs (specifically {@link javax.xml.soap.SOAPElement#getChildElements()})
55 * are allowed to silently replace objects that are incorrectly typed relative
56 * to SAAJ requirements with equivalent objects of the required type. These
57 * replacements must never cause the logical structure of the tree to change,
58 * so from the perspective of the DOM APIs the tree will remain unchanged. However,
59 * the physical composition of the tree will have changed so that references
60 * to the nodes that were replaced will refer to nodes that are no longer a
61 * part of the tree. The SAAJ APIs are not allowed to make these replacements
62 * if they are not required so the replacement objects will never subsequently
63 * be silently replaced by future calls to the SAAJ API.
64 * <p>
65 * What this means in practical terms is that an application that starts to use
66 * SAAJ APIs on a tree after manipulating it using DOM APIs must assume that the
67 * tree has been translated into an all SAAJ tree and that any references to objects
68 * within the tree that were obtained using DOM APIs are no longer valid. Switching
69 * from SAAJ APIs to DOM APIs is not allowed to cause invalid references and
70 * neither is using SAAJ APIs exclusively. It is only switching from using DOM
71 * APIs on a particular SAAJ tree to using SAAJ APIs that causes the risk of
72 * invalid references.
73 *
74 * <h3>Discovery of SAAJ implementation</h3>
75 * <p>
76 * There are several factories defined in the SAAJ API to discover and load specific implementation:
77 *
78 * <ul>
79 *     <li>{@link javax.xml.soap.SOAPFactory}
80 *     <li>{@link javax.xml.soap.MessageFactory}
81 *     <li>{@link javax.xml.soap.SOAPConnectionFactory}
82 *     <li>{@link javax.xml.soap.SAAJMetaFactory}
83 * </ul>
84 *
85 * First three define {@code newInstance()} method which uses a common lookup procedure to determine
86 * the implementation class:
87 *
88 * <ul>
89 *  <li>Checks if a system property with the same name as the factory class is set (e.g.
90 *  {@code javax.xml.soap.SOAPFactory}). If such property exists then its value is assumed to be the fully qualified
91 *  name of the implementation class. This phase of the look up enables per-JVM override of the SAAJ implementation.
92 *  <li>Use the configuration file "jaxm.properties". The file is in standard
93 *  {@link java.util.Properties} format and typically located in the
94 *  {@code conf} directory of the Java installation. It contains the fully qualified
95 *  name of the implementation class with the key being the system property
96 *  defined above.
97 *  <li> Use the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class,
98 *  to attempt to locate and load an implementation of the service using the {@linkplain
99 *  java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}.
100 *  <li> Finally, if all the steps above fail, {@link javax.xml.soap.SAAJMetaFactory} instance is used
101 *  to locate specific implementation (for {@link javax.xml.soap.MessageFactory} and {@link javax.xml.soap.SOAPFactory})
102 *  or platform default implementation is used ({@link javax.xml.soap.SOAPConnectionFactory}).
103 *  Whenever {@link javax.xml.soap.SAAJMetaFactory} is used, its lookup procedure to get actual instance is performed.
104 * </ul>
105 */
106package javax.xml.soap;
107