SOAP with Attachments API for JavaTM (SAAJ) 1.2
March, 12 2003
Quick jump to changes
C001, C002, C003, C004, C005, C006, C007, C008, C009, C010, C011, C012, C013, C014, C015, C016, C017, C018, C019, C020, C021, C022, C023, C024, C025, C026, C027, C028, C029, C030, C031, C032, C033, C034, C035, C036, C037, C038, C039, C040, C041, C042, C043, C044, C045, C046
1) Description
Maintenance revision of the SOAP with Attachments API for JavaTM (SAAJ), version 1.2.
2) Specification Leads
Nicholas Kassem and Phil Goodwin, Sun Microsystems, Inc.
3) Feedback
Comments should be sent to mailto:jaxm-final@sun.com
4) Rationale for proposed changes
The goal of this maintenance release is to provide support for the proposed WS-I Basic Profile of SOAP 1.1. In addition we would like to take the opportunity to make a number of corrections and clarifications to the specification and JavaDocs.
The WS-I Basic Profile does not add any capabilities to the SOAP 1.1 document that it moderates. It does, however, promote the use of some SOAP 1.1 features even as it proscribes the use of others. The goal of this change log is to make it easier for applications to create and use messages that are WS-I conformant. This maintenance release is concerned with the following areas:
The use of literal encoding
Access to SOAP 1.1 features that are of increased prominence
Easier conformance to WS-I recommendations
5) Summary of Proposed changes
Bind SAAJ APIs to DOM APIs
Rationale: DOM is already
in use in many environments. If SAAJ trees are also DOM trees then
SAAJ will be able to integrate more easily with many applications
and tools.
Add
properties to SOAPMessage
Rationale: There are several details about the
formatting and encoding of a SOAP message that can affect
interoperability. Giving the end user control over these details
while retaining the same defaults as SAAJ 1.1 allows us to deliver
a higher degree of potential interoperability without sacrificing
usability or backward compatibility.
Add ease of use methods to key APIs
Rationale: There
are several opportunities in the SAAJ API to make it easier
on the end user to conform to the recommendations of SOAP
1.1 or WS-I. These new methods will automate frequent or error-prone
tasks, leading to higher productivity, fewer errors - and less
technical support.In addition, it is expected that the average
developer will not have extensive knowledge of DOM APIs
and so we would like to support common SOAP use cases involving DOM
through the SAAJ APIs.
Clarify and
correct the wording of JavaDocs and specification
Scope: None of these changes will break backward
compatibility or allow new behavior that was explicitly forbidden
before. In particular, conforming implementations will not
break existing clients and will be capable of passing the existing
TCK. Some of these changes will impose new requirements on
implementations. Where that is the case the changes will
be specifically enumerated in this document.
Rationale: Corrections of this nature cost
little and improve the overall integrity of the specification
making correct implementations easier to create, validate and
use.
6) Proposed Changes
Supporting the addition of DOM Interfaces
The following classes and interfaces would implement
interfaces from the org.w3c.dom package:
javax.xml.soap
Interface Node
- All Superinterfaces:
- org.w3c.dom.Node
- public interface Node
- extends org.w3c.dom.Node
A representation of a node (element) in an XML document. This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node, for getting and setting the parent of a node, and for removing a node.
Field Summary
Fields inherited from interface org.w3c.dom.Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface org.w3c.dom.Node appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
javax.xml.soap
Interface SOAPElement
- All Superinterfaces:
- org.w3c.dom.Element, Node, org.w3c.dom.Node
- public interface SOAPElement
- extends Node, org.w3c.dom.Element
An object representing the contents in aSOAPBodyobject, the contents in aSOAPHeaderobject, the content that can follow theSOAPBodyobject in aSOAPEnvelopeobject, or what can follow the detail element in aSOAPFaultobject. It is the base class for all of the classes that represent the SOAP objects as defined in the SOAP specification.
An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification. This interface serves as the base interface for those objects that are specifically prescribed by a SOAP specification.
Methods in this interface that are required to return SAAJ specific objects may "silently" replace nodes in the tree as required to successfully return objects of the correct type. See
getChildElements()and javax.xml.soap for details.
Field Summary
Fields inherited from interface org.w3c.dom.Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface org.w3c.dom.Node appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
Methods inherited from interface org.w3c.dom.Element getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
javax.xml.soap
Class SOAPPartjava.lang.Object
|
+--javax.xml.soap.SOAPPart
- All Implemented Interfaces:
- org.w3c.dom.Document, org.w3c.dom.Node
- public abstract class SOAPPart
- extends java.lang.Object
- implements org.w3c.dom.Document
Field Summary
Fields inherited from interface org.w3c.dom.Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface org.w3c.dom.Document createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode
Methods inherited from interface org.w3c.dom.Node appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
javax.xml.soap
Interface Text
- All Superinterfaces:
- org.w3c.dom.CharacterData, Node, org.w3c.dom.Node, org.w3c.dom.Text
- public interface Text
- extends Node, org.w3c.dom.Text
Field Summary
Fields inherited from interface org.w3c.dom.Node ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface org.w3c.dom.Node appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
Methods inherited from interface org.w3c.dom.Text splitText
Methods inherited from interface org.w3c.dom.CharacterData appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
This would be added to the package comment:
In addition the APIs in the
javax.xml.soappackage extend their counterparts in theorg.w3c.dompackage. This means that theSOAPPartof aSOAPMessageis also a DOM Level 2Document, and can be manipulated as such by applications, tools and libararies that use DOM (see http://www.w3.org/DOM/ for more information). It is important to note that, while it is possible to use DOM APIs to add ordinary DOM nodes to a SAAJ tree, the SAAJ APIs are still required to return SAAJ types when examining or manipulating the tree. In order to accomplish this the SAAJ APIs (specificallySOAPElement.getChildElements()) are allowed to "silently" replace objects that are incorrectly typed relative to SAAJ requirements with equivalent objects of the required type. These replacements must never cause the logical structure of the tree to change, so from the perspective of the DOM APIs the tree will remain unchanged. However, the physical composition of the tree will have changed so that references to the nodes that were replaced will refer to nodes that are no longer a part of the tree. The SAAJ APIs are not allowed to make these replacements if they are not required so the replacement objects will never subsequently be "silently" replaced by future calls to the SAAJ API. What this means in practical terms is that an application that starts to use SAAJ APIs on a tree after manipulating it using DOM APIs must assume that the tree has been translated into an all SAAJ tree and that any references to objects within the tree that were obtained using DOM APIs are no longer valid. Switching from SAAJ APIs to DOM APIs is not allowed to cause invalid references and neither is using SAAJ APIs exclusively. It is only switching from using DOM APIs on a particular SAAJ tree to using SAAJ APIs that causes the risk of invalid references.
7) Proposed
Changes for Adding Properties to SOAPMessage
These are the additional methods and constants intended to
provide user control over SOAPMessage properties.
javax.xml.soap
Class SOAPMessagejava.lang.Object
|
+--javax.xml.soap.SOAPMessage
- public abstract class SOAPMessage
- extends java.lang.Object
Method Summary abstract java.lang.StringgetProperty(java.lang.String property)
Retrieves value of the specified property.
abstract voidsetProperty(java.lang.String property, java.lang.Object value)
Associates the specified value with the specified property.
Method Detail
getProperty
public abstract java.lang.Object getProperty(java.lang.String property)
throws SOAPException
- Retrieves value of the specified property.
- Parameters:
property- the name of the property to retrieve- Returns:
- the value of the property or
nullif no such property exists.- Throws:
SOAPException- if the property name is not recognized.- Since:
- SAAJ 1.2
setProperty
public abstract void setProperty(java.lang.String property,
java.lang.Object value)
throws SOAPException
- Associates the specified value with the specified property. If there was already a value associated with this property, the old value is replaced.
The valid property names include
WRITE_XML_DECLARATIONandCHARACTER_SET_ENCODING. All of these standard SAAJ properties are prefixed by "javax.xml.soap". Vendors may also add implementation specific properties. These properties must be prefixed with package names that are unique to the vendor.Setting the property
WRITE_XML_DECLARATIONto"true"will cause an XML Declaration to be written out at the start of the SOAP message. The default value of "false" suppresses this declaration.The property
CHARACTER_SET_ENCODINGdefaults to the value"utf-8"which causes the SOAP message to be encoded using UTF-8. SettingCHARACTER_SET_ENCODINGto"utf-16"causes the SOAP message to be encoded using UTF-16.Some implementations may allow encodings in addition to UTF-8 and UTF-16. Refer to your vendor's documentation for details.
- Parameters:
property- the property with which the specified value is to be associated.value- the value to be associated with the specified property- Throws:
SOAPException- if the property name is not recognized.- Since:
- SAAJ 1.2
Field Summary static java.lang.StringCHARACTER_SET_ENCODING
Specifies the character type encoding for the SOAP Message.static java.lang.StringWRITE_XML_DECLARATION
WRITE_XML_DECLARATION specifies whether the SOAP Message should contain an XML declaration; the value must be "true" or "false".
Field Detail
CHARACTER_SET_ENCODING
public static final java.lang.String CHARACTER_SET_ENCODING
- Specifies the character type encoding for the SOAP Message. Valid values include "utf-8" and "utf-16". See vendor documentation for additional supported values. The default is "utf-8".
- Since:
- SAAJ 1.2
- See Also:
SOAPMessage.setProperty, Constant Field Values
WRITE_XML_DECLARATION
public static final java.lang.String WRITE_XML_DECLARATION
- Specifies whether the SOAP Message should contain an XML declaration. The only valid values are "true" and "false". The default is "false".
- Since:
- SAAJ 1.2
- See Also:
SOAPMessage.setProperty, Constant Field Values
Constant Field Values
javax.xml.soap. SOAPMessage public static final java.lang.StringCHARACTER_SET_ENCODING"javax.xml.soap.character-set-encoding"public static final java.lang.StringWRITE_XML_DECLARATION"javax.xml.soap.write-xml-declaration"
8) Proposed Changes to Enhance Ease of Use
Change JavaDoc:
javax.xml.soap
Interface Node
Method Summary voiddetachNode()
Removes thisNodeobject from the tree.Once removed, this node can be garbage collected if there are no application references to it.
javax.xml.soap
Interface Node
Method Summary voidsetValue(java.lang.String value)
If this is aTextnode then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.
Method Detail
setValue
public void setValue(java.lang.String value)
- If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node. The value of the immediate child of this node can be set only if, there is one child node and that node is a
Textnode, or if there are no children in which case a childTextnode will be created.
- Throws:
java.lang.IllegalStateException- if the node is not aTextnode and either has more than one child node or has a child node that is not aTextnode.- Since:
- SAAJ 1.2
Add methods:
javax.xml.soap
Interface SOAPFault
Method Summary NamegetFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for thisSOAPFaultobject as a SAAJNameobject.voidsetFaultCode(Name faultCodeQName)
Sets thisSOAPFaultobject with the given fault code.void
setFaultString(java.lang.String faultString, java.util.Locale locale)
Sets the fault string for thisSOAPFaultobject to the given string and localized to the given locale.
java.util.Locale
getFaultStringLocale()
Gets the locale of the fault string for thisSOAPFaultobject.
Method Detail
getFaultCodeAsName
public Name getFaultCodeAsName()
- Gets the mandatory SOAP 1.1 fault code for this
SOAPFaultobject as a SAAJNameobject. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName. This method returns the content of the element as a QName in the form of a SAAJ Name object. This method should be used instead of thegetFaultCodemethod since it allows applications to easily access the namespace name without additional parsing.In the future, a QName object version of this method may also be added.
- Returns:
- a
Namerepresenting the faultcode- Since:
- SAAJ 1.2
- See Also:
setFaultCode(Name)
setFaultCode
public void setFaultCode(NamefaultCodeQName)throws SOAPException
- Sets this
SOAPFaultobject with the given fault code.Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type
QName. This method provides a convenient way to set a fault code. For example,SOAPEnvelope se = ...;It is preferable to use this method over
// Create a qualified name in the SOAP namespace with a localName
// of "Client". Note that prefix parameter is optional and is null
// here which causes the implementation to use an appropriate prefix.
Name qname = se.createName("Client", null,
SOAPConstants.URI_NS_SOAP_ENVELOPE);
SOAPFault fault = ...;
fault.setFaultCode(qname);setFaultCode(String).
- Parameters:
faultCodeQName- aNameobject giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification and of type QName- Throws:
SOAPException- if there was an error in adding thefaultcodeelement to the underlying XML tree.- Since:
- SAAJ 1.2
- See Also:
getFaultCodeAsName()
setFaultString
public void setFaultString(java.lang.String faultString,
java.util.Locale locale)
throws SOAPException
- Sets the fault string for this
SOAPFaultobject to the given string and localized to the given locale.
- Parameters:
faultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString- Throws:
SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- Since:
- SAAJ 1.2
- See Also:
getFaultString()
Rationale: These two methods allow the fault code to be treated as a fully qualified name, as required by SOAP 1.1.getFaultStringLocale
public java.util.Locale getFaultStringLocale()
- Gets the locale of the fault string for this
SOAPFaultobject.
- Returns:
- a
Localeobject indicating the native language of the fault string ornullif no locale was specified
- Since:
- SAAJ 1.2
- See Also:
setFaultString(String, Locale)
Add method:
javax.xml.soap
Interface SOAPBody
Method Detail
addDocument
public SOAPBodyElement addDocument(org.w3c.dom.Document document)
- Adds the root node of the DOM
Documentto thisSOAPBodyobject.
C016
Calling this method invalidates the
documentparameter. The client application should discard all references to thisDocumentand its contents upon callingaddDocument. The behavior of an application that continues to use such references is undefined. [end of C045]
- Parameters:
document- theDocumentobject whose root node will be added to thisSOAPBody.- Returns:
- the
SOAPBodyElementthat represents the root node that was added.- Throws:
SOAPException- if theDocumentcannot be added- Since:
- SAAJ 1.2
Rationale: This user requested method makes it easier to use DOM in SAAJ applications. Without this method the end user must rely entirely on DOM APIs to perform this operation. C045 allows a wider range of implementation choices including possible optimizations at the expense of some usability.
Add method:
javax.xml.soap
Interface SOAPElement
Method Detail
removeContents
public void removeContents()
Detaches all children of thisSOAPElement.This method is useful for rolling back the construction of partially completed
SOAPHeadersandSOAPBodysin preparation for sending a fault when an error condition is detected. It is also useful for recycling portions of a document within a SOAP message.
- Since:
- SAAJ 1.2
Rationale: This method supports a common use case where elements in a partially assembled body are replaced with a fault in response to an error condition. It originated in the SOAPBody interface and was pulled up into SOAPElement because of its general utility.
Add method:
Rationale: This is a common operation. It is likely that vendors can provide an implmentation that is more efficient than what can be obtained directly from the other SAAJ or DOM APIs.javax.xml.soap
Interface SOAPElement
Method Detail
getVisibleNamespacePrefixes
public java.util.Iterator getVisibleNamespacePrefixes()
- Returns an
Iteratorover the namespace prefixStrings visible to this element. The prefixes returned by this iterator can be passed to the methodgetNamespaceURIto retrieve the URI of each namespace.
- Returns:
- an iterator over the namespace prefixes that are within scope of this
SOAPElementobject- Since:
- SAAJ 1.2
Add methods:
javax.xml.soap
Interface SOAPHeader
Method Summary java.util.IteratorexamineAllHeaderElements()
Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.java.util.IteratorexamineMustUnderstandHeaderElements(java.lang.String actor)
Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue.java.util.IteratorextractAllHeaderElements()
Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject and detaches them from thisSOAPHeaderobject.
examineAllHeaderElements
public java.util.Iterator examineAllHeaderElements()
- Returns an
Iteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.
- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader- Since:
- SAAJ 1.2
- See Also:
extractAllHeaderElements()
examineMustUnderstandHeaderElements
public java.util.Iterator examineMustUnderstandHeaderElements(java.lang.String actor)
- Returns an
Iteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue.
- Parameters:
actor- aStringgiving the URI of the actor for which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specified actor and are marked as MustUnderstand- Since:
- SAAJ 1.2
- See Also:
examineHeaderElements(java.lang.String),extractHeaderElements(java.lang.String),SOAPConstants.URI_SOAP_ACTOR_NEXT
extractAllHeaderElements
public java.util.Iterator extractAllHeaderElements()
- Returns an
Iteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject and detaches them from thisSOAPHeaderobject.
- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader- Since:
- SAAJ 1.2
- See Also:
examineAllHeaderElements()
Rationale: The ability to examine or extract all header elements gives an application flexibility to implement its own processing model. Applications implementing SOAP processing will need to be able to examine all of the header elements marked must understand in order to correctly fulfill the must understand contract. The examineMustUnderstandHeaderElements(String) method provides easy and correct access to this piece of necessary and routine processing.
Add methods:
javax.xml.soap
Class SOAPMessage
Method Summary abstract SOAPBodygetSOAPBody()
Gets the SOAP Body contained in thisSOAPMessageobject.abstract SOAPHeadergetSOAPHeader()
Gets the SOAP Header contained in thisSOAPMessageobject.
Method Detail
getSOAPBody
public abstract SOAPBody getSOAPBody()
- Gets the SOAP Body contained in this
SOAPMessageobject.
- Returns:
- the
SOAPBodyobject contained by thisSOAPMessageobject
- Throws:
SOAPException- if the SOAP Body does not exist or cannot be retrieved- Since:
- SAAJ 1.2
getSOAPHeader
public abstract SOAPHeader getSOAPHeader()
- Gets the SOAP Header contained in this
SOAPMessageobject.
- Returns:
- the
SOAPHeaderobject contained by thisSOAPMessageobject
- Throws:
SOAPException- if the SOAP Header does not exist or cannot be retrieved- Since:
- SAAJ 1.2
Rationale: These methods make writing SAAJ clients easier by eliminating the getSOAPPart().getEnvelope() call sequence for gaining access to the header and body elements of the message. This allows developers to focus on their application needs rather than the details of the structure of SOAP messages.
9) Corrections
The following JavaDoc changes will correct ambiguities and
errors from earlier versions.
javax.xml.soap
Interface Detail
Method Detail
Rationale:The actual return type is an Iterator, not a List.getDetailEntries
public java.util.Iterator getDetailEntries()
Gets a list of detail entriesGets an Iterator over all of theDetailEntrys in thisDetailobject.
- Returns:
- an
Iteratorobject over theDetailEntryobjects in thisDetailobject
javax.xml.soap
Class MessageFactory
Rationale: SAAJ is independant of JAXM. While it is appropriate to mention the available interactions between the two, it is misleading to suggest that JAXM APIs are the endorsed mechanism for accessing the SAAJ factory classes.
- public abstract class MessageFactory
- extends java.lang.Object
A factory for creating
SOAPMessageobjects.A JAXM client performs the following steps to create a message.
Creates aMessageFactoryobject from aProviderConnectionobject (conin the following line of code). TheStringpassed to thecreateMessageFactorymethod is the name of of a messaging profile, which must be the URL for the schema.MessageFactory mf = con.createMessageFactory(schemaURL);
Calls the methodcreateMessageon theMessageFactoryobject. All messages produced by thisMessageFactoryobject will have the header information appropriate for the messaging profile that was specified when theMessageFactoryobject was created.SOAPMessage m = mf.createMessage();
It is also possible to create aMessageFactoryobjectA SAAJ client can create a
MessageFactoryobject using the methodnewInstance, as shown in the following line of code.[...]
If aMessageFactoryobject was created using aProviderConnectionobject, which means that it was initialized with a specified profile, itMessageFactoryobjects can be initialized with a JAXM profile. In such a case it will produce messages that also come prepopulated with additional entries in theSOAPHeaderobject and theSOAPBodyobject.
[...]
javax.xml.soap
Class MimeHeaders
Method Summary java.util.IteratorgetAllHeaders()
Returns all theheadersMimeHeaderobjects in thisMimeHeadersobject.
Rationale:The method summaries for methods that return Iterators should indicate the types of the objects contained by the iterated collections. Otherwise clients will be unable to use the objects returned by the iteration process.
javax.xml.soap
Interface Name
Method Detail
getPrefix
public java.lang.String getPrefix()
Returns the prefix associated with the namespace for the XMLReturns the prefix that was specified when thisNameobject was initialized. This prefix is associated with the namespace for the XML name that thisNameobject represents.
- Returns:
- the prefix as a string
Rationale:The phrase "the prefix" was ambiguous since there may be zero or many prefixes associated with a given namespace within a given context. This change helps to clarify that a Name is a simple value, unassociated with any context and providing no claims with respect to the validity of its prefix. The TCK already enforces this interpretation of the original wording. This is simply a clarification of the original intent. It is also consistent with the thinking that is driving the evolution of the QName class.
javax.xml.soap
Interface Node
Method Detail
getValue
public java.lang.String getValue()
Returns the the value of the immediate child of thisNodeobject if a child exists and its value is text.- Returns the value of this node if this is a
Textnode or the value of the immediate child of this node otherwise. If there is an immediate child of thisNodethat it is aTextnode then it's value will be returned. If there is more tha oneTextnode then the value of the firstTextNode will be returned. Otherwisenullis returned.
- Returns:
aStringwith the text of the immediate child of thisNodeobject if (1) there is a child and (2) the child is aTextobject;nullotherwise- a
Stringwith the text of this node if this is aTextnode or the text contained by the first immediate child of thisNodeobject that is aTextobject if such a child exists;nullotherwise.
Rationale:This reflects the actual behavior of the Reference Implementation, the original intent of the specification, the equivalent behavior of DOM, and what we believe the end user will expect. It does represent a new behavior rather than a new restriction which raises the possibility of broken backward compatibility, however, in light of the facts listed above coupled with the fact that the TCK already allows this behavior (or else the Reference Implementation would not have passed) we believe that it is both safe and desirable to make this change.
javax.xml.soap
Interface SOAPBody
Method Detail
addFault
public SOAPException
- Creates a new
SOAPFaultobject and adds it to thisSOAPBodyobject.A
SOAPBodymay contain at most oneSOAPFaultchild element.
- Returns:
- the new
SOAPFaultobject- Throws:
SOAPException- if there is a SOAP error
Rationale:This reflects restrictions present in the SOAP 1.1 specification.
javax.xml.soap
Class SOAPConnection
- public abstract class SOAPConnection
- extends java.lang.Object
A point-to-point connection that a client can use for sending messages directly to a remote party (represented by a URL, for instance).
A client can obtain aSOAPConnectionobject simply by calling the following static method.SOAPConnection con = SOAPConnection.newInstance();
A client can obtain aSOAPConnectionobject using aSOAPConnectionFactoryobject as in the following example:SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();A
SOAPConnection con = factory.createConnection();
SOAPConnectionobject can be used to send messages directly to a URL following the request/response paradigm. That is, messages are sent using the methodcall, which sends the message and then waits until it gets a reply.
Rationale:The orginal JavaDoc was wrong.
javax.xml.soap
Class SOAPConnectionFactory
- public abstract class SOAPConnectionFactory
- extends java.lang.Object
A factory for creating
SOAPConnectionobjects. Implementation of this class is optional. IfSOAPConnectionFactory.newInstance()throws an UnsupportedOperationException then the implementation does not support the SAAJ communication infrastructure. OtherwiseSOAPConnectionobjects can be created by callingcreateConnection()on the newly createdSOAPConnectionFactoryobject.
Rationale:There was no JavaDoc class comment for this class before. This comment clearly states the optional nature of the SAAJ communication artifacts and exposes the mechanism that allows them to be optional.
javax.xml.soap
Interface SOAPConstants
Field Detail
URI_NS_SOAP_ENVELOPE
public static final java.lang.String URI_NS_SOAP_ENVELOPE
- The namespace identifier for the SOAP 1.1 envelope. All
SOAPElements in this namespace are defined by the SOAP 1.1 specification.
- See Also:
- Constant Field Values
URI_NS_SOAP_ENCODING
public static final java.lang.String URI_NS_SOAP_ENCODING
- The namespace identifier for the SOAP 1.1 encoding. An attribute named
encodingStylein theURI_NS_SOAP_ENVELOPEnamespace and set to the valueURI_NS_SOAP_ENCODINGcan be added to an element to indicate that it is encoded using the rules in section 5 of the SOAP 1.1 specification.
- See Also:
- Constant Field Values
URI_SOAP_ACTOR_NEXT
public static final java.lang.String URI_SOAP_ACTOR_NEXT
- The URI identifying the
firstnext application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification).This value can be passed to
SOAPHeader.examineMustUnderstandHeaderElements(String),SOAPHeader.examineHeaderElements(String)andSOAPHeader.extractHeaderElements(String)
- See Also:
- Constant Field Values
Rationale:These are just informational changes. They do not change the meaning of the specification at all.
javax.xml.soap
Interface SOAPElement
- public interface SOAPElement
- extends Node, org.w3c.dom.Element
Method Summary SOAPElementC035
addChildElement(java.lang.String localName)
Creates a newSOAPElementobject initialized with thegivenspecified local name and adds the new element to thisStringSOAPElementobject.java.util.IteratorC036
getAllAttributes()
Returns aniterator over all of the attribute namesIteratorover all of the attributeNameobjects in thisSOAPElementobject.java.util.IteratorC037
getChildElements()
Returns an iterator over all the immediate content of this element.
Returns anIteratorover all the immediate childNodesof this element. This includesTextobjects as well asSOAPElementobjects.
Calling this method may cause child
Element,SOAPElementandorg.w3c.dom.Textnodes to be replaced bySOAPElement,SOAPHeaderElement,SOAPBodyElementorjavax.xml.soap.Textnodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by thisIterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.
java.util.Iterator
C038
getChildElements( Name name)
Returns an iterator over all the child elements with the specified name.Returns anIteratorover all the immediate childNodesof this element with the specified name.All of thes