Class 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
    • Method Detail

      • 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
      • outputImpl

        protected void outputImpl​(SerializationContext context)
                           throws java.lang.Exception
        Description copied from class: MessageElement
        override point -output to a serialization context.
        Overrides:
        outputImpl in class MessageElement
        Parameters:
        context - destination.
        Throws:
        java.lang.Exception - if something went wrong.
      • 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.