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-tp5127015p5127015.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to