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:
java.io.Serializable,java.lang.Cloneable,Node,SOAPElement,SOAPHeader,org.w3c.dom.Element,org.w3c.dom.Node,org.w3c.dom.NodeList
public class SOAPHeader extends MessageElement implements SOAPHeader
Holder for header elements.- Author:
- Glyn Normington (glyn@apache.org)
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description SOAPHeader(java.lang.String namespace, java.lang.String localPart, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext context, SOAPConstants soapConsts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(MessageElement element)Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.SOAPElementaddChildElement(java.lang.String localName)add a child element in the message element's own namespaceSOAPElementaddChildElement(java.lang.String localName, java.lang.String prefix)add a child elementSOAPElementaddChildElement(java.lang.String localName, java.lang.String prefix, java.lang.String uri)add a child elementSOAPElementaddChildElement(Name name)add the child elementSOAPElementaddChildElement(SOAPElement element)The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.SOAPHeaderElementaddHeaderElement(Name name)Creates a newSOAPHeaderElementobject initialized with the specified name and adds it to thisSOAPHeaderobject.org.w3c.dom.NodeappendChild(org.w3c.dom.Node newChild)Adds the nodenewChildto the end of the list of children of this node.java.util.IteratorexamineAllHeaderElements()Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.java.util.IteratorexamineHeaderElements(java.lang.String actor)Returns a list of all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the the specified actor.java.util.IteratorexamineMustUnderstandHeaderElements(java.lang.String actor)Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have 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.java.util.IteratorextractHeaderElements(java.lang.String actor)Returns a list of all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the the specified actor and detaches them from thisSOAPHeaderobject.protected voidoutputImpl(SerializationContext context)override point -output to a serialization context.voidsetParentElement(SOAPElement parent)Sets the parent of thisNodeobject to the givenSOAPElementobject.-
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 Detail
-
SOAPHeader
public SOAPHeader(java.lang.String namespace, java.lang.String localPart, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext context, SOAPConstants soapConsts) throws AxisFault- Throws:
AxisFault
-
-
Method Detail
-
setParentElement
public void setParentElement(SOAPElement parent) throws SOAPException
Description copied from class:NodeImplSets the parent of thisNodeobject to the givenSOAPElementobject.- Specified by:
setParentElementin interfaceNode- Overrides:
setParentElementin classNodeImpl- Parameters:
parent- theSOAPElementobject to be set as the parent of thisNodeobject- Throws:
SOAPException- if there is a problem in setting the parent to the given element- See Also:
getParentElement()
-
addHeaderElement
public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
Description copied from interface:SOAPHeaderCreates a newSOAPHeaderElementobject initialized with the specified name and adds it to thisSOAPHeaderobject.- Specified by:
addHeaderElementin interfaceSOAPHeader- Parameters:
name- aNameobject with the name of the newSOAPHeaderElementobject- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs
-
examineHeaderElements
public java.util.Iterator examineHeaderElements(java.lang.String actor)
Description copied from interface:SOAPHeaderReturns a list of all theSOAPHeaderElementobjects in thisSOAPHeaderobject 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 aSOAPHeaderobject, the message is sent to its ultimate destination.- Specified by:
examineHeaderElementsin interfaceSOAPHeader- Parameters:
actor- aStringgiving the URI of the actor for which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specified actor - See Also:
extractHeaderElements(java.lang.String)
-
extractHeaderElements
public java.util.Iterator extractHeaderElements(java.lang.String actor)
Description copied from interface:SOAPHeaderReturns a list of all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the the specified actor and detaches them from thisSOAPHeaderobject.This method allows an actor to process only the parts of the
SOAPHeaderobject that apply to it and to remove them before passing the message on to the next actor.- Specified by:
extractHeaderElementsin interfaceSOAPHeader- Parameters:
actor- aStringgiving the URI of the actor for which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specified actor - See Also:
examineHeaderElements(java.lang.String)
-
examineMustUnderstandHeaderElements
public java.util.Iterator examineMustUnderstandHeaderElements(java.lang.String actor)
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue.- Specified by:
examineMustUnderstandHeaderElementsin interfaceSOAPHeader- 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
-
examineAllHeaderElements
public java.util.Iterator examineAllHeaderElements()
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.- Specified by:
examineAllHeaderElementsin interfaceSOAPHeader- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader
-
extractAllHeaderElements
public java.util.Iterator extractAllHeaderElements()
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject and detaches them from thisSOAPHeaderobject.- Specified by:
extractAllHeaderElementsin interfaceSOAPHeader- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader
-
outputImpl
protected void outputImpl(SerializationContext context) throws java.lang.Exception
Description copied from class:MessageElementoverride point -output to a serialization context.- Overrides:
outputImplin classMessageElement- Parameters:
context- destination.- Throws:
java.lang.Exception- if something went wrong.
-
addChild
public void addChild(MessageElement element) throws SOAPException
Description copied from class:MessageElementNote that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.- Overrides:
addChildin classMessageElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(SOAPElement element) throws SOAPException
Description copied from class:MessageElementThe added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classMessageElement- Parameters:
element- theSOAPElementto 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:
SOAPElement.addChildElement(javax.xml.soap.SOAPElement)
-
addChildElement
public SOAPElement addChildElement(Name name) throws SOAPException
Description copied from class:MessageElementadd the child element- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classMessageElement- Parameters:
name- uri, prefix and local name of the element to add- Returns:
- the child element
- Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(javax.xml.soap.Name)
-
addChildElement
public SOAPElement addChildElement(java.lang.String localName) throws SOAPException
Description copied from class:MessageElementadd a child element in the message element's own namespace- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classMessageElement- Parameters:
localName- aStringgiving the local name for the element- Returns:
- the child element
- Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(String)
-
addChildElement
public SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix) throws SOAPException
Description copied from class:MessageElementadd a child element- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classMessageElement- Parameters:
localName- aStringgiving the local name for the new elementprefix- aStringgiving the namespace prefix for the new element- Returns:
- the child element
- Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(String, String)
-
addChildElement
public SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix, java.lang.String uri) throws SOAPException
Description copied from class:MessageElementadd a child element- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classMessageElement- Parameters:
localName- aStringgiving the local name for the new elementprefix- aStringgiving the namespace prefix for the new elementuri- aStringgiving the URI of the namespace to which the new element belongs- Returns:
- the child element
- Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(String, String, String)
-
appendChild
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMExceptionDescription copied from class:NodeImplAdds the nodenewChildto the end of the list of children of this node. If thenewChildis already in the tree, it is first removed.- Specified by:
appendChildin interfaceorg.w3c.dom.Node- Overrides:
appendChildin classNodeImpl- Parameters:
newChild- The node to add.If it is aDocumentFragmentobject, the entire contents of the document fragment are moved into the child list of this node- Returns:
- The node added.
- Throws:
org.w3c.dom.DOMException- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of thenewChildnode, or if the node to append is one of this node's ancestors or this node itself.
WRONG_DOCUMENT_ERR: Raised ifnewChildwas 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.
-
-