Can I ask what version of CXF?   This sounds like 2.2.x or earlier behavior.  

I just checked with the latest code and CXF is definitely creating 
JAXWSMethodInvoker objects for the WebServiceProviders.

Dan


On Friday, January 06, 2012 5:39:22 PM cbwhitebu wrote:
> I have WebServiceProvider that I have annotated to get the
> WebServiceContext. The context is injected but never contains anything
> useful.
> 
> @WebServiceProvider
> @ServiceMode(value = Service.Mode.MESSAGE)
> public class FirstService implements Provider<SOAPMessage>
> {
>       @Resource
>       WebServiceContext context;
> 
>       @Override
>       public SOAPMessage invoke(SOAPMessage message) {
> 'ctx' is always null -->      MessageContext ctx = 
context.getMessageContext();
>         ....
>        }
> }
> 
> 
> The JAXWSMethodInvoker calls code like this to populate the context but this
> is apparently not used for WebServiceProviders.
> 
>     protected Object invoke(Exchange exchange, final Object serviceObject,
> Method m, List params) {
> 
>         // set up the webservice request context
>         WrappedMessageContext ctx = new
> WrappedMessageContext(exchange.getInMessage(), Scope.APPLICATION);
> 
>         Map<String, Object> handlerScopedStuff =
> removeHandlerProperties(ctx);
> 
>         WebServiceContextImpl.setMessageContext(ctx);
> 
>         ...
>    }
> 
> The FactoryInvoker used for WebServiceProviders never does this. Should I
> write my own interceptor and add it to the inteceptor chain to take care of
> this?
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/WebServiceContext-with-WebServiceProvider-t
> p5127015p5127015.html Sent from the cxf-user mailing list archive at
> Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to