My Oracle Support Banner

Invocationctx.Getcontextdata() Does Not Include Webservicecontext Parameters (Doc ID 1408723.1)

Last updated on MAY 06, 2020

Applies to:

Oracle WebLogic Server - Version 10.3.3 and later
Information in this document applies to any platform.


An EJB  method  is called as a web service in 10.3.3 WLS.
EJB interceptor mechanism  is used to intercept this  EJB method call.

When intercepting this method call, the following code is executed :

public class MyInterceptor {
WebServiceContext wsContext;
* The method called at the @AroundInvoke aspect to intercept the orginal
* Service Request.
public Object intercept(InvocationContext invocationCtx) throws Exception
 String ctxValue = (String)invocationCtx.getContextData().get("KEY");
 String wsValue = (String)wsContext.getMessageContext().get("KEY");

 return "From intercept: Value from invocationCtx: " +
         ctxValue +
         ". Value from wsContext: " + wsValue;

The  invocationCtx.getContextData("KEY") method returns  NULL .
And,  wsContext.getMessageContext().get("KEY") returns a non NULL value

Referring to EJB 3.0 core specification (section 12.5 InvocationContext) :

'If interceptors are invoked as a result of the invocation on a web service
endpoint, the map returned by getContextData will be the JAX-WS
MessageContext [32].'

Therefore,  if s wsContext().get("KEY")  returns a non NULL value,  invocationCtx.getContextData("KEY") should return the same  non NULL value.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.