You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by J Bouck <bo...@gmail.com> on 2007/09/15 00:47:34 UTC

Is it possible to get the org.apache.axis2.context.MessageContext in a synapse Mediator?

I would like to get the WSSecurityEngine results in a custom synapse
mediator (see the code sample at
http://ws.apache.org/wss4j/package.html#Reporting_Security_results_to_services_applications
).
Is it possible to get the org.apache.axis2.context.MessageContext in a
synapse Mediator?  I only seem to have access to the
org.apache.synapse.MessageContext in custom mediators.

~john

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


Re: Is it possible to get the org.apache.axis2.context.MessageContext in a synapse Mediator?

Posted by J Bouck <bo...@gmail.com>.
It works for me.
Here's mediator code snippet I used:

public boolean mediate(org.apache.synapse.MessageContext mc) {
    	
   org.apache.axis2.context.MessageContext axisctx =
((org.apache.synapse.core.axis2.Axis2MessageContext)
mc).getAxis2MessageContext();
    log.info("This is the message id from axis
context:"+axisctx.getMessageID());

Thanks,
~john

On 9/14/07, Ruwan Linton <ru...@gmail.com> wrote:
> Hi John,
>
> See my comments in line;
>
> On 9/15/07, J Bouck <bo...@gmail.com> wrote:
> >
> > I would like to get the WSSecurityEngine results in a custom synapse
> > mediator (see the code sample at
> >
> > http://ws.apache.org/wss4j/package.html#Reporting_Security_results_to_services_applications
> > ).
> > Is it possible to get the org.apache.axis2.context.MessageContext in a
> > synapse Mediator?  I only seem to have access to the
> > org.apache.synapse.MessageContext in custom mediators.
>
>
> Yes, but you can retrieve the axis2 message context using the following code
> segment.
>
> ((Axis2MessageContext) synapseMessageContext).getAxis2MessageContext()
>
>
> Here the synapseMessageContext is the Synapse MessageContext which casts to
> Axis2MessageContext and there you have a method to get the axis2 message
> context.
>
> Thanks,
> Ruwan
>
> ~john
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-user-help@ws.apache.org
> >
> >
>
>
> --
> Ruwan Linton
> http://www.wso2.org - "Oxygenating the Web Services Platform"
>

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


Re: Is it possible to get the org.apache.axis2.context.MessageContext in a synapse Mediator?

Posted by Ruwan Linton <ru...@gmail.com>.
Hi John,

See my comments in line;

On 9/15/07, J Bouck <bo...@gmail.com> wrote:
>
> I would like to get the WSSecurityEngine results in a custom synapse
> mediator (see the code sample at
>
> http://ws.apache.org/wss4j/package.html#Reporting_Security_results_to_services_applications
> ).
> Is it possible to get the org.apache.axis2.context.MessageContext in a
> synapse Mediator?  I only seem to have access to the
> org.apache.synapse.MessageContext in custom mediators.


Yes, but you can retrieve the axis2 message context using the following code
segment.

((Axis2MessageContext) synapseMessageContext).getAxis2MessageContext()


Here the synapseMessageContext is the Synapse MessageContext which casts to
Axis2MessageContext and there you have a method to get the axis2 message
context.

Thanks,
Ruwan

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


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"