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 Cédric Chabanois <CC...@cognicase.fr> on 2002/01/25 14:19:24 UTC

MessageContext

Hi,

In my [...]BindingImpl file, I have an init method that is called when the
constructor itself is called.

In this method, i want to get what is the path to the WEB-INF subdirectory,
so I did the following :

MessageContext msgContext = MessageContext.getCurrentContext();
String configPath = msgContext.getStrProp(Constants.MC_CONFIGPATH);

But an instance of this class is created when user wants the wsdl (?wsdl)
and msgContext is null in this case.
Indeed in AxisServer.invoke, setCurrentMessageContext(msgContext) is called
but this is not the case in AxisServer.generateWSDL.

I could also call init in each method (testing in init if I already done
what I wanted), but I would prefer not to do this.

Is there any reason why currentMessageContext is not available when the
request is ?wsdl ?


Another question : I know that methods can take MessageContext as first
parameter. So what is the best method : take a MessageContext as first
parameter or get it with MessageContext.getCurrentContext() ?

Thanks,

Cédric Chabanois