Hi,

MessageContext stores the current message context in a ThreadLocal. To be able to retrieve it, two conditions must be met:

1) The Axis JARs must be loaded from the same class loader.
2) MessageContext#getCurrentMessageContext must be called from within the thread that received the request.

For point 1: Where did you put the Axis JARs?
For point 2: I'm not very familiar with EJBs, but it might be that this is the case only if the EJB is called through its local interface.

Regards,

Andreas

On 21 Jan 2008, at 15:39, Etches, Adam (GE Infra, Energy) wrote:

Hi all first time posting…

I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service.

I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned.

Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB?

thanks
Adam


Reply via email to