alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Axis 2 example source code file (SOAPHeader.java)

This example Axis 2 source code file (SOAPHeader.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Axis 2 tags/keywords

iterator, iterator, soapelement, soapelement, soapexception, soapexception, soapheader, soapheaderelement, soapheaderelement, util

The Axis 2 SOAPHeader.java source code

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package javax.xml.soap;

import java.util.Iterator;

/**
 * <P>A representation of the SOAP header element. A SOAP header element consists of XML data that
 * affects the way the application-specific content is processed by the message provider. For
 * example, transaction semantics, authentication information, and so on, can be specified as the
 * content of a <CODE>SOAPHeader object.

* <p/> * <P>A SOAPEnvelope object contains an empty SOAPHeader object by * default. If the <CODE> SOAPHeader object, which is optional, is not needed, it can be * retrieved and deleted with the following line of code. The variable <I>se is a * <CODE>SOAPEnvelope object.

 se.getHeader().detachNode(); 
A * <CODE>SOAPHeader object is created with the SOAPEnvelope method * <CODE>addHeaderBlock. This method, which creates a new header and adds it to the envelope, * may be called only after the existing header has been removed. <PRE> se.getHeader().detachNode(); * SOAPHeader sh = se.addHeaderBlock(); </PRE> * <p/> * <P>A SOAPHeader object can have only SOAPHeaderElement objects as its * immediate children. The method <CODE>addHeaderElement creates a new * HeaderElement</CODE> object and adds it to the SOAPHeader object. In the following * line of code, the argument to the method <CODE>addHeaderElement is a Name * object that is the name for the new <CODE> HeaderElement object.

 * SOAPHeaderElement shElement = sh.addHeaderElement(name); </PRE>
 *
 * @see SOAPHeaderElement SOAPHeaderElement
 */
public interface SOAPHeader extends SOAPElement {

    /**
     * Creates a new <CODE>SOAPHeaderElement object initialized with the specified name and
     * adds it to this <CODE>SOAPHeader object.
     *
     * @param name a <CODE>Name object with the name of the new SOAPHeaderElement
     *             object
     * @return the new <CODE>SOAPHeaderElement object that was inserted into this
     *         <CODE>SOAPHeader object
     * @throws SOAPException if a SOAP error occurs
     */
    public abstract SOAPHeaderElement addHeaderElement(Name name)
            throws SOAPException;

    /**
     * Returns a list of all the <CODE>SOAPHeaderElement objects in this
     * <CODE>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
     * <CODE>SOAPHeader object, the message is sent to its ultimate destination.
     *
     * @param actor a <CODE>String giving the URI of the actor for which to search
     * @return an <CODE>Iterator object over all the  SOAPHeaderElement objects
     *         that contain the specified actor
     * @see #extractHeaderElements(String) extractHeaderElements(java.lang.String)
     */
    public abstract Iterator examineHeaderElements(String actor);

    /**
     * Returns a list of all the <CODE>SOAPHeaderElement objects in this
     * <CODE>SOAPHeader object that have the the specified actor and detaches them from this
     * <CODE> SOAPHeader object.
     * <p/>
     * <P>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.
     *
     * @param actor a <CODE>String giving the URI of the actor for which to search
     * @return an <CODE>Iterator object over all the  SOAPHeaderElement objects
     *         that contain the specified actor
     * @see #examineHeaderElements(String) examineHeaderElements(java.lang.String)
     */
    public abstract Iterator extractHeaderElements(String actor);

    /**
     * Returns an <code>Iterator over all the SOAPHeaderElement objects in this
     * <code>SOAPHeader object that have the specified actor and that have a MustUnderstand
     * attribute whose value is equivalent to <code>true.
     *
     * @param actor a <code>String giving the URI of the actor for which to search
     * @return an <code>Iterator object over all the SOAPHeaderElement objects
     *         that contain the specified actor and are marked as MustUnderstand
     */
    public abstract Iterator examineMustUnderstandHeaderElements(String actor);

    /**
     * Returns an <code>Iterator over all the SOAPHeaderElement objects in this
     * <code>SOAPHeader object.
     *
     * @return an <code>Iterator object over all the SOAPHeaderElement objects
     *         contained by this <code>SOAPHeader
     */
    public abstract Iterator examineAllHeaderElements();

    /**
     * Returns an <code>Iterator over all the SOAPHeaderElement objects in this
     * <code>SOAPHeader  object and detaches them from this SOAPHeader object.
     *
     * @return an <code>Iterator object over all the SOAPHeaderElement objects
     *         contained by this <code>SOAPHeader
     */
    public abstract Iterator extractAllHeaderElements();

    public abstract SOAPHeaderElement addHeaderElement(javax.xml.namespace.QName qname)
            throws SOAPException;

    public abstract SOAPHeaderElement addNotUnderstoodHeaderElement(javax.xml.namespace.QName qname)
            throws SOAPException;

    public abstract SOAPHeaderElement addUpgradeHeaderElement(java.util.Iterator iterator)
            throws SOAPException;

    public abstract SOAPHeaderElement addUpgradeHeaderElement(java.lang.String[] as)
            throws SOAPException;

    public abstract SOAPHeaderElement addUpgradeHeaderElement(java.lang.String s)
            throws SOAPException;
}

Other Axis 2 examples (source code examples)

Here is a short list of links related to this Axis 2 SOAPHeader.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.