You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Da Cruz Pinto, Juan M" <ju...@intel.com> on 2007/09/21 02:55:02 UTC

[Axis2] MessageContext properties lifetime

Hi all,

 

I'm trying to build an Axis2 module. In the server side, when I process
an incoming message I need to store some information that will be used
later during response processing.

I've tried using setProperty(...) from MessageContext, but when I do so,
the property is not present when processing the response (MessageContext
lifetime is only request or response? But not both?). I've also tried
setting the property in the OperationContext I get from the current
MessageContext, but when the module is active in the server side,
OperationContext and all other *Context instances I get from the current
MessageContext are null... don't know what else to try.

 

 

Thanks in advanced,

Marcelo.

 

 


RE: [Axis2] MessageContext properties lifetime

Posted by "Da Cruz Pinto, Juan M" <ju...@intel.com>.
Deepal,

Thanks for your answer! And sorry for explaining things wrong:). I'm not
using the "getCurrentContext" method, but instead I'm accessing the
MessageContext parameter received in the "invoke" method of the handler.
That link was what I needed!

Thanks again,
Marcelo.

 
-----Original Message-----
From: Deepal Jayasinghe [mailto:deepal@opensource.lk] 
Sent: Friday, September 21, 2007 01:21
To: axis-dev@ws.apache.org
Subject: Re: [Axis2] MessageContext properties lifetime



Da Cruz Pinto, Juan M wrote:
>
> Hi all,
>
>  
>
> I'm trying to build an Axis2 module. In the server side, when I
> process an incoming message I need to store some information that will
> be used later during response processing.
>
> I've tried using setProperty(...) from MessageContext, but when I do
> so, the property is not present when processing the response
> (MessageContext lifetime is only request or response? But not both?).
> I've also tried setting the property in the OperationContext I get
> from the current MessageContext, but when the module is active in the
> server side, OperationContext and all other *Context instances I get
> from the current MessageContext are null... don't know what else to
try.
>
Well getCurrentContext only work inside the service impl class , since
you have access to the message context inside your handler you do not
need to use that method. But for accessing req property in the response
please refer to

http://wso2.org/library/2084

Thanks
Deepal


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

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


Re: [Axis2] MessageContext properties lifetime

Posted by Deepal Jayasinghe <de...@opensource.lk>.

Da Cruz Pinto, Juan M wrote:
>
> Hi all,
>
>  
>
> I’m trying to build an Axis2 module. In the server side, when I
> process an incoming message I need to store some information that will
> be used later during response processing.
>
> I’ve tried using setProperty(...) from MessageContext, but when I do
> so, the property is not present when processing the response
> (MessageContext lifetime is only request or response? But not both?).
> I’ve also tried setting the property in the OperationContext I get
> from the current MessageContext, but when the module is active in the
> server side, OperationContext and all other *Context instances I get
> from the current MessageContext are null... don’t know what else to try.
>
Well getCurrentContext only work inside the service impl class , since
you have access to the message context inside your handler you do not
need to use that method. But for accessing req property in the response
please refer to

http://wso2.org/library/2084

Thanks
Deepal


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