axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haug, Thomas" <>
Subject AW: How to access the SOAPHeader
Date Fri, 14 Jul 2006 09:51:20 GMT
Hi Chinthaka,

Thank you for the quick answer.
So if I got it right: the Axis2 framework inspects the service class (via reflection?), if
the service class provides a  setOperationContext(OperationContext opContext) method. Are
there any other operation which can be 'magically' called ?

>From a design perspective this looks a bit awkward, because there is no interface which
mandates that my service class has to implement the corresponding method(s). Instead the contract
between my class and Axis2 is done implicitly and I have to mention it at least at 'JavaDoc
level' otherwise nobody of my developers whould know. I would rather like to see an approach
similar as in Axis 1 (which is similar to the CORBA Current object approach).But this is only
my opinion ... ;-)

Nevertheless, thanks for the hint. At least I am now able to get the SOAPHeader.


-----Urspr√ľngliche Nachricht-----
Von: Eran Chinthaka [] 
Gesendet: Freitag, 14. Juli 2006 11:53
Betreff: Re: How to access the SOAPHeader

First get access to the message context within the service
implementation class following this (

Then from the message context you can get access to the soap envelope
using msgCtxt.getEnvelope()

-- Chinthaka

Haug, Thomas wrote:
> Hi,
> I want to access the SOAPHeader in my service implementation class.
> In Axis 1 I have done soemthing like
>    SOAPHeader header = null;
>    //extract the Header from the current SOAP Request
>    try {
>      header = (SOAPHeader)
> MessageContext.getCurrentContext().getRequestMessage().getSOAPEnvelope().getHeader();
>    }
>    catch (SOAPException e) {
>      //do what ever
>    }
> Is there a similar mechanism in Axis2. I have not found a glue so far.
> Thanks,
> Thomas

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message