You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Eric Nygma <pr...@gmail.com> on 2007/06/18 12:32:30 UTC

HTTP header info from MessageContext

Hi,

I am writing a class mediator. The mediator will typically have access to
the MessageContext.
I need to access information on the HTTP headers in the incoming message
through the mediator. The MessageContext seems to go as far as giving info
on the SOAP message only. Is there a way to get HTTP header info from a
class mediator ?

Appreciate your help.

Thanks.
E \.

Re: HTTP header info from MessageContext

Posted by Eric Nygma <pr...@gmail.com>.
Thanks a lot Asankha . That did the job for me.

Eric.

On 6/18/07, Asankha C. Perera <as...@wso2.com> wrote:
>
> Hi Eric
>
> Once you have the Axis2 MessageContext, you could do
> messageContext.getProperty(MessageContext.TRANSPORT_HEADERS) and it will
> return to you a Map of the transport headers associated with the message.
>
> i.e.
> public boolean mediate(MessageContext smc) {
>   Axis2MessageContext axis2smc = (Axis2MessageContext) smc;
>   org.apache.axis2.context.MessageContext axis2MessageCtx =
> axis2smc.getAxis2MessageContext();
>   Map transportHeaders = (Map)
> messageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
>   ...
> }
>
> asankha
>
> Eric Nygma wrote:
> > Hi,
> >
> > I am writing a class mediator. The mediator will typically have access
> to
> > the MessageContext.
> > I need to access information on the HTTP headers in the incoming message
> > through the mediator. The MessageContext seems to go as far as giving
> > info
> > on the SOAP message only. Is there a way to get HTTP header info from a
> > class mediator ?
> >
> > Appreciate your help.
> >
> > Thanks.
> > E \.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-user-help@ws.apache.org
>
>

Re: HTTP header info from MessageContext

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Eric

Once you have the Axis2 MessageContext, you could do 
messageContext.getProperty(MessageContext.TRANSPORT_HEADERS) and it will 
return to you a Map of the transport headers associated with the message.

i.e.
public boolean mediate(MessageContext smc) {
  Axis2MessageContext axis2smc = (Axis2MessageContext) smc;
  org.apache.axis2.context.MessageContext axis2MessageCtx = 
axis2smc.getAxis2MessageContext();
  Map transportHeaders = (Map) 
messageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
  ...
}

asankha

Eric Nygma wrote:
> Hi,
>
> I am writing a class mediator. The mediator will typically have access to
> the MessageContext.
> I need to access information on the HTTP headers in the incoming message
> through the mediator. The MessageContext seems to go as far as giving 
> info
> on the SOAP message only. Is there a way to get HTTP header info from a
> class mediator ?
>
> Appreciate your help.
>
> Thanks.
> E \.
>

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