You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Raymond Zhou <ra...@yahoo.com> on 2010/09/30 00:12:40 UTC

multiple soap Headers in axis2/axiom

Hi All,
 
I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
 
In axis/java, I used to do like this: 
 
   Vector headers = soapenvelope.getHeaders();
 
This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
  
   SOAPHeader header = envelope.getHeader();
 
My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
 
Thanks in advance!
Raymond


      

Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: multiple soap Headers in axis2/axiom

Posted by Andreas Veithen <an...@gmail.com>.
A SOAP message can have at most one soap:Header element, but that
element can have any number of children. The getHeaders method in Axis
returns the children of soap:Header, while in Axis2, SOAPHeader
represents the soap:Header element itself. To add individual headers
(also called SOAPHeaderBlocks in Axiom), use the methods defined by
the SOAPHeader interface.

Andreas

On Thu, Sep 30, 2010 at 00:12, Raymond Zhou <ra...@yahoo.com> wrote:
>
> Hi All,
>
> I am moving from axis/java to axis2/java. I am encountering a few issues. One of them has to do with soap headers in soap envelope.
>
> In axis/java, I used to do like this:
>
>    Vector headers = soapenvelope.getHeaders();
>
> This is to get all the soap headers (soap:header) from a soap envelope. But I noticed that in axis2/java/AXIOM, this is NOT possible. It seems like always assume there is only one soapHeader, so you can only do something like this:
>
>    SOAPHeader header = envelope.getHeader();
>
> My question is: Is this a known issue or it is the new restriction from specifications (you can have only one soap headers)?
>
> Thanks in advance!
> Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org