JBoss Community

Re: CDI @Inject in a JAX-WS service impl?

created by Martin Kouba in JBoss Web Services - View the full discussion

I'm not sure this (interceptor invocation) is required by the spec (EE 6, CDI 1.0 or JAX-WS 2.x). Although your endpoint is valid CDI bean JAX-WS probably does define its own lifecycle for SEI. JAX-WS spec does not say a word about CDI integration. EE 6 spec states: service endpoints and handlers support injection (this works right now). CDI spec states: built-in request/application contexts are active during web service invocation (this works too). On the other hand EJB spec allows SLSB and singletons to be JAX-WS endpoints.

 

So I'd recommend either use EJB (SLSB, singleton) or inject separate managed bean with app logic and bind interceptor to this bean (like the source in the first comment).

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community