Package org.apache.axis.message
Class SOAPHeader
java.lang.Object
org.apache.axis.message.NodeImpl
org.apache.axis.message.MessageElement
org.apache.axis.message.SOAPHeader
- All Implemented Interfaces:
Serializable
,Cloneable
,Node
,SOAPElement
,SOAPHeader
,Element
,Node
,NodeList
Holder for header elements.
- Author:
- Glyn Normington (glyn@apache.org)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.axis.message.MessageElement
MessageElement.QNameAttr
-
Field Summary
Fields inherited from class org.apache.axis.message.MessageElement
_isRoot, context, encodingStyle, endEventIndex, fixupDeserializer, href, id, message, namespaces, qNameAttrs, recorder, startContentsIndex, startEventIndex, typeQName
Fields inherited from class org.apache.axis.message.NodeImpl
_isDirty, attributes, children, document, name, namespaceURI, parent, prefix, textRep
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Constructor Summary
ConstructorsConstructorDescriptionSOAPHeader
(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context, SOAPConstants soapConsts) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(MessageElement element) Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.addChildElement
(String localName) add a child element in the message element's own namespaceaddChildElement
(String localName, String prefix) add a child elementaddChildElement
(String localName, String prefix, String uri) add a child elementaddChildElement
(Name name) add the child elementaddChildElement
(SOAPElement element) The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.addHeaderElement
(Name name) Creates a newSOAPHeaderElement
object initialized with the specified name and adds it to thisSOAPHeader
object.appendChild
(Node newChild) Adds the nodenewChild
to the end of the list of children of this node.Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object.examineHeaderElements
(String actor) Returns a list of all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the the specified actor.Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue
.Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object and detaches them from thisSOAPHeader
object.extractHeaderElements
(String actor) Returns a list of all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the the specified actor and detaches them from thisSOAPHeader
object.protected void
outputImpl
(SerializationContext context) override point -output to a serialization context.void
setParentElement
(SOAPElement parent) Sets the parent of thisNode
object to the givenSOAPElement
object.Methods inherited from class org.apache.axis.message.MessageElement
addAttribute, addAttribute, addAttribute, addAttribute, addMapping, addNamespaceDeclaration, addTextNode, childDeepCloned, cloneNode, cloning, detachAllChildren, equals, findElement, getAllAttributes, getAsDocument, getAsDOM, getAsString, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributesEx, getAttributeValue, getAttributeValue, getChildElement, getChildElements, getChildElements, getChildElements, getChildren, getCompleteAttributes, getDeserializationContext, getElementName, getElementsByTagName, getElementsByTagNameNS, getElementsNS, getEncodingStyle, getEnvelope, getFixupDeserializer, getHref, getID, getLength, getName, getNamespacePrefixes, getNamespaceURI, getObjectValue, getObjectValue, getOwnerDocument, getPrefix, getQName, getRealElement, getRecorder, getTagName, getType, getValue, getValueAsType, getValueAsType, getValueDOM, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, isRoot, item, output, publishContents, publishToHandler, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeContents, removeNamespaceDeclaration, setAllAttributes, setAttribute, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setContentsIndex, setEncodingStyle, setEndIndex, setEnvelope, setFixupDeserializer, setName, setNamespaceURI, setNSMappings, setObjectValue, setQName, setRecorder, setType, setValue, toString
Methods inherited from class org.apache.axis.message.NodeImpl
compareDocumentPosition, convertAttrSAXtoDOM, detachNode, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTextContent, getUserData, hasAttributes, hasChildNodes, initializeChildren, insertBefore, isDefaultNamespace, isDirty, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, makeAttributesEditable, normalize, recycleNode, removeChild, replaceChild, reset, setDirty, setDirty, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setOwnerDocument, setParent, setPrefix, setTextContent, setUserData
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setValue
Methods inherited from interface org.w3c.dom.Node
cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addNamespaceDeclaration, addTextNode, getAllAttributes, getAttributeValue, getChildElements, getChildElements, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
-
Constructor Details
-
SOAPHeader
public SOAPHeader(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context, SOAPConstants soapConsts) throws AxisFault - Throws:
AxisFault
-
-
Method Details
-
setParentElement
Description copied from class:NodeImpl
Sets the parent of thisNode
object to the givenSOAPElement
object.- Specified by:
setParentElement
in interfaceNode
- Overrides:
setParentElement
in classNodeImpl
- Parameters:
parent
- theSOAPElement
object to be set as the parent of thisNode
object- Throws:
SOAPException
- if there is a problem in setting the parent to the given element- See Also:
-
addHeaderElement
Description copied from interface:SOAPHeader
Creates a newSOAPHeaderElement
object initialized with the specified name and adds it to thisSOAPHeader
object.- Specified by:
addHeaderElement
in interfaceSOAPHeader
- Parameters:
name
- aName
object with the name of the newSOAPHeaderElement
object- Returns:
- the new
SOAPHeaderElement
object that was inserted into thisSOAPHeader
object - Throws:
SOAPException
- if a SOAP error occurs
-
examineHeaderElements
Description copied from interface:SOAPHeader
Returns a list of all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the the specified actor. An actor is a global attribute that indicates the intermediate parties to whom the message should be sent. An actor receives the message and then sends it to the next actor. The default actor is the ultimate intended recipient for the message, so if no actor attribute is included in aSOAPHeader
object, the message is sent to its ultimate destination.- Specified by:
examineHeaderElements
in interfaceSOAPHeader
- Parameters:
actor
- aString
giving the URI of the actor for which to search- Returns:
- an
Iterator
object over all theSOAPHeaderElement
objects that contain the specified actor - See Also:
-
extractHeaderElements
Description copied from interface:SOAPHeader
Returns a list of all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the the specified actor and detaches them from thisSOAPHeader
object.This method allows an actor to process only the parts of the
SOAPHeader
object that apply to it and to remove them before passing the message on to the next actor.- Specified by:
extractHeaderElements
in interfaceSOAPHeader
- Parameters:
actor
- aString
giving the URI of the actor for which to search- Returns:
- an
Iterator
object over all theSOAPHeaderElement
objects that contain the specified actor - See Also:
-
examineMustUnderstandHeaderElements
Description copied from interface:SOAPHeader
Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue
.- Specified by:
examineMustUnderstandHeaderElements
in interfaceSOAPHeader
- Parameters:
actor
- aString
giving the URI of the actor for which to search- Returns:
- an
Iterator
object over all theSOAPHeaderElement
objects that contain the specified actor and are marked as MustUnderstand
-
examineAllHeaderElements
Description copied from interface:SOAPHeader
Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object.- Specified by:
examineAllHeaderElements
in interfaceSOAPHeader
- Returns:
- an
Iterator
object over all theSOAPHeaderElement
objects contained by thisSOAPHeader
-
extractAllHeaderElements
Description copied from interface:SOAPHeader
Returns anIterator
over all theSOAPHeaderElement
objects in thisSOAPHeader
object and detaches them from thisSOAPHeader
object.- Specified by:
extractAllHeaderElements
in interfaceSOAPHeader
- Returns:
- an
Iterator
object over all theSOAPHeaderElement
objects contained by thisSOAPHeader
-
outputImpl
Description copied from class:MessageElement
override point -output to a serialization context.- Overrides:
outputImpl
in classMessageElement
- Parameters:
context
- destination.- Throws:
Exception
- if something went wrong.
-
addChild
Description copied from class:MessageElement
Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.- Overrides:
addChild
in classMessageElement
- Throws:
SOAPException
-
addChildElement
Description copied from class:MessageElement
The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classMessageElement
- Parameters:
element
- theSOAPElement
to be added as a new child- Returns:
- an instance representing the new SOAP element that was actually added to the tree.
- Throws:
SOAPException
- if there was an error in adding this element as a child- See Also:
-
addChildElement
Description copied from class:MessageElement
add the child element- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classMessageElement
- Parameters:
name
- uri, prefix and local name of the element to add- Returns:
- the child element
- Throws:
SOAPException
- See Also:
-
addChildElement
Description copied from class:MessageElement
add a child element in the message element's own namespace- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classMessageElement
- Parameters:
localName
-- Returns:
- the child element
- Throws:
SOAPException
- See Also:
-
addChildElement
Description copied from class:MessageElement
add a child element- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classMessageElement
- Parameters:
localName
-prefix
-- Returns:
- the child element
- Throws:
SOAPException
- See Also:
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException Description copied from class:MessageElement
add a child element- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classMessageElement
- Parameters:
localName
-prefix
-uri
-- Returns:
- the child element
- Throws:
SOAPException
- See Also:
-
appendChild
Description copied from class:NodeImpl
Adds the nodenewChild
to the end of the list of children of this node. If thenewChild
is already in the tree, it is first removed.- Specified by:
appendChild
in interfaceNode
- Overrides:
appendChild
in classNodeImpl
- Parameters:
newChild
- The node to add.If it is aDocumentFragment
object, the entire contents of the document fragment are moved into the child list of this node- Returns:
- The node added.
- Throws:
DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of thenewChild
node, or if the node to append is one of this node's ancestors or this node itself.
WRONG_DOCUMENT_ERR: Raised ifnewChild
was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the previous parent of the node being inserted is readonly.
-