Try: MessageContext.getCurrentMessageContext() The setOperationContext() stuff was removed prior to Axis2 1.1 because it wasn't thread safe.
David On 01/02/07, George Stanchev <[EMAIL PROTECTED]> wrote:
Hi Angerl, Yeah, I did this and it works fine. I just wanted to avoid it and use the "out-of-the-box" mechanism for obtaining the message context since there were several examples out there on the web indicating that setOperationContext should work. After I posted my question on this list I looked around the message receivers code and found out that currently (in 1.1.1) the DependencyManager class which is called inirectly from the invokeBusinessLogic method does attempt to call "init" method with "ServiceContext" parameter. This however, does not help me much. After initialization, the service class is cached on the service context and subsequent calls would not invoke the "init" method. Also I don't know if there is an easy way to get the message context from the service context. I guess I am stuck with my own custom receiver. Thanks! Best Regards, George -----Original Message----- From: Angel Todorov [mailto:[EMAIL PROTECTED] Sent: Thursday, February 01, 2007 11:56 AM To: [email protected] Subject: Re: setOperationContext on service Hi George, You can probably implement a custom message receiver that extends any of the default ones, and inject any object in your service implementation. In this way you basically gain control over the lifecycle of the business logic. Regards, Angel On 2/1/07, George Stanchev <[EMAIL PROTECTED]> wrote: > > > Hi, > > How can I get a hold of message context within a service? > There are several places on the web that show that if the service > implements a > > void setOprationContext(OperationContext) > > method, it will get called prior to the operation method. > However I have not been successful in getting this method called. > Several of the unit tests use > > void init(MessageContext) > > But this is not called either. Is there any other way to get a hold of > the message context? I have tried the RawXMLInOutMessageReceiver and > the RPCMessageReceiver. > > Has the method signature changed? Has it been removed? > > Thanks in advance! > > George > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. Any unauthorized review, use, disclosure or > distribution is prohibited. If you are not the intended recipient, > please contact the sender by reply e-mail and destroy all copies of the original message. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- David Illsley - IBM Web Services Development --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
