axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cédric Chabanois <>
Subject MessageContext
Date Fri, 25 Jan 2002 13:19:24 GMT

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() ?


Cédric Chabanois

View raw message