AxisMessage doesn't represent the current message. Instead it
represents a wsdl:message element, i.e. it is part of the service
description. To get the SOAP headers from the current message, get the
SOAPEnvelope from the MessageContext.

Andreas

On Mon, Mar 26, 2012 at 16:49,  <aaron.stro...@rsa.com> wrote:
> Hello all,
>
>
>
> My web service client passes a custom SOAP header to the service. The
> SOAPMonitor shows that it is included <soapenv:Header> element.
>
> On the server side I’m attempting to get it using this bit of code:
>
>
>
> MessageContext ctx = MessageContext.getCurrentMessageContext();
>
>
>
> OperationContext opctx = ctx.getOperationContext();
>
> try {
>
>                 MessageContext msgctx =
> opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>
>                 AxisMessage message = msgctx.getAxisMessage();
>
>                  ArrayList headers = message.getSoapHeaders();
>
> } catch (AxisFault e) {
>
>                 log.debug("Failed getting incoming message context", e);
>
> }
>
>
>
> But the headers list is empty.
>
>
>
> I’m using Axis 1.6.1. According to various document I found on the net, I
> should be able to get the SOAP message from the message context, SOAP
> envelope from the SOAP message and from that get the headers but
> org.apache.axis2.context.MessageContext allows me to get only to
> AxisMessage, which does not provide the means to get the SOAP envelope.
> Please advise what I am doing wrong and what is the correct way. Thanks,
>
>
>
> -a

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

Reply via email to