org.apache.axis.message
Class SOAPHeader

java.lang.Object
  extended byorg.apache.axis.message.NodeImpl
      extended byorg.apache.axis.message.MessageElement
          extended byorg.apache.axis.message.SOAPHeader
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.Node, Node, org.w3c.dom.NodeList, java.io.Serializable, SOAPElement, SOAPHeader

public class SOAPHeader
extends MessageElement
implements SOAPHeader

Holder for header elements.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.axis.message.MessageElement
namespaces
 
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
 
Constructor Summary
SOAPHeader(java.lang.String namespace, java.lang.String localPart, java.lang.String prefix, org.xml.sax.Attributes attributes, org.apache.axis.encoding.DeserializationContext context, SOAPConstants soapConsts)
           
 
Method Summary
 void 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.
 SOAPElement addChildElement(Name name)
          Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(SOAPElement element)
          Add a SOAPElement as a child of this SOAPElement instance.
 SOAPElement addChildElement(java.lang.String localName)
          Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix)
          Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix, java.lang.String uri)
          Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
 SOAPHeaderElement addHeaderElement(Name name)
          Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
          Adds the node newChild to the end of the list of children of this node.
 java.util.Iterator examineAllHeaderElements()
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
 java.util.Iterator examineHeaderElements(java.lang.String actor)
          Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor.
 java.util.Iterator examineMustUnderstandHeaderElements(java.lang.String actor)
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.
 java.util.Iterator extractAllHeaderElements()
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.
 java.util.Iterator extractHeaderElements(java.lang.String actor)
          Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor and detaches them from this SOAPHeader object.
 void setParentElement(SOAPElement parent)
          Sets the parent of this Node object to the given SOAPElement object.
 
Methods inherited from class org.apache.axis.message.MessageElement
addAttribute, addAttribute, addAttribute, addAttribute, addMapping, addNamespaceDeclaration, addTextNode, cloneNode, detachAllChildren, equals, getAllAttributes, getAsDocument, getAsDOM, getAsString, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributesEx, getAttributeValue, getAttributeValue, getChildElement, getChildElements, getChildElements, getChildElements, getChildren, getCompleteAttributes, getDeserializationContext, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getEnvelope, getFixupDeserializer, getHref, getID, getLength, getName, getNamespacePrefixes, getNamespaceURI, getObjectValue, getObjectValue, getOwnerDocument, getPrefix, getQName, getRealElement, getRecorder, getTagName, getType, getValue, getValueAsType, getValueAsType, 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
detachNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentElement, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isDirty, isSupported, normalize, recycleNode, removeChild, replaceChild, setDirty, setNodeValue, setOwnerDocument, setPrefix
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addNamespaceDeclaration, addTextNode, getAllAttributes, getAttributeValue, getChildElements, getChildElements, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
 
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setValue
 
Methods inherited from interface org.w3c.dom.Node
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
 

Constructor Detail

SOAPHeader

public SOAPHeader(java.lang.String namespace,
                  java.lang.String localPart,
                  java.lang.String prefix,
                  org.xml.sax.Attributes attributes,
                  org.apache.axis.encoding.DeserializationContext context,
                  SOAPConstants soapConsts)
           throws AxisFault
Method Detail

setParentElement

public void setParentElement(SOAPElement parent)
                      throws SOAPException
Description copied from interface: Node
Sets the parent of this Node object to the given SOAPElement object.

Specified by:
setParentElement in interface Node
Overrides:
setParentElement in class NodeImpl
Parameters:
parent - the SOAPElement object to be set as the parent of this Node object
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: SOAPHeader
Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.

Specified by:
addHeaderElement in interface SOAPHeader
Parameters:
name - a Name object with the name of the new SOAPHeaderElement object
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs

examineHeaderElements

public java.util.Iterator examineHeaderElements(java.lang.String actor)
Description copied from interface: SOAPHeader
Returns a list of all the SOAPHeaderElement objects in this SOAPHeader 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 a SOAPHeader object, the message is sent to its ultimate destination.

Specified by:
examineHeaderElements in interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects 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: SOAPHeader
Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor and detaches them from this SOAPHeader 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 interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects 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: SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.

Specified by:
examineMustUnderstandHeaderElements in interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor and are marked as MustUnderstand

examineAllHeaderElements

public java.util.Iterator examineAllHeaderElements()
Description copied from interface: SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.

Specified by:
examineAllHeaderElements in interface SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader

extractAllHeaderElements

public java.util.Iterator extractAllHeaderElements()
Description copied from interface: SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.

Specified by:
extractAllHeaderElements in interface SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader

addChild

public void addChild(MessageElement element)
              throws SOAPException
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 class MessageElement
Throws:
SOAPException

addChildElement

public SOAPElement addChildElement(SOAPElement element)
                            throws SOAPException
Description copied from interface: SOAPElement
Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPElementFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of the SOAPElement passed into an instance of a different SOAPElement implementation. For instance if addChildElement() is called on a SOAPHeader, element will be copied into an instance of a SOAPHeaderElement.

The fragment rooted in element is either added as a whole or not at all, if there was an error.

The fragment rooted in element cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Throws:
SOAPException
See Also:
SOAPElement.addChildElement(javax.xml.soap.SOAPElement)

addChildElement

public SOAPElement addChildElement(Name name)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Parameters:
name - uri, prefix and local name of the element to add
Returns:
the child element
Throws:
SOAPException
See Also:
SOAPElement.addChildElement(javax.xml.soap.Name)

addChildElement

public SOAPElement addChildElement(java.lang.String localName)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Parameters:
localName -
Returns:
the child element
Throws:
SOAPException
See Also:
SOAPElement.addChildElement(String)

addChildElement

public SOAPElement addChildElement(java.lang.String localName,
                                   java.lang.String prefix)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Parameters:
localName -
prefix -
Returns:
the child element
Throws:
SOAPException
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 interface: SOAPElement
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Parameters:
localName -
prefix -
uri -
Returns:
the child element
Throws:
SOAPException
See Also:
SOAPElement.addChildElement(String, String, String)

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                             throws org.w3c.dom.DOMException
Description copied from class: NodeImpl
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.

Specified by:
appendChild in interface org.w3c.dom.Node
Overrides:
appendChild in class NodeImpl
Parameters:
newChild - The node to add.If it is a DocumentFragment object, 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 the newChild node, or if the node to append is one of this node's ancestors or this node itself.
WRONG_DOCUMENT_ERR: Raised if newChild 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.


Copyright © 2003 Apache Web Services Project. A ll Rights Reserved.