You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sistar <ra...@gmail.com> on 2008/10/22 21:03:39 UTC

Spring DI into a SOAPHandler

Hi,
is there any elegant way to inject dependencies into a
javax.xml.ws.handler.soap.SOAPHandler which is configured in the handler
chain.

(@Configurable and AspectJ are just to heavyweight and cause any kinds of
trouble.)

Cheers Ralf

Ralf Sigmund


-- 
View this message in context: http://www.nabble.com/Spring-DI-into-a-SOAPHandler-tp20117640p20117640.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Spring DI into a SOAPHandler

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 23 October 2008 5:19:37 pm Daniel Kulp wrote:
> On Wednesday 22 October 2008 3:03:39 pm sistar wrote:
> > Hi,
> > is there any elegant way to inject dependencies into a
> > javax.xml.ws.handler.soap.SOAPHandler which is configured in the handler
> > chain.
> >
> > (@Configurable and AspectJ are just to heavyweight and cause any kinds of
> > trouble.)
> >
> > Cheers Ralf
> >
> > Ralf Sigmund
>
> You should be able to use @Resource annotations on the handlers.   If the
> name="...." matches a bean defined in your spring file, it should be picked
> up.

Actually, the other option is to not use a handler chain file.   Instead, 
directly inject the handler beans into the jaxws:client/endpoint in spring.  
The jaxws:endpoint has a <jaxws:handlers> subelement which is a list of 
Handler beans.   Thus, you can wire the handlers and everything completely 
together via spring and not have the handler chain file outside of spring.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Spring DI into a SOAPHandler

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 22 October 2008 3:03:39 pm sistar wrote:
> Hi,
> is there any elegant way to inject dependencies into a
> javax.xml.ws.handler.soap.SOAPHandler which is configured in the handler
> chain.
>
> (@Configurable and AspectJ are just to heavyweight and cause any kinds of
> trouble.)
>
> Cheers Ralf
>
> Ralf Sigmund

You should be able to use @Resource annotations on the handlers.   If the 
name="...." matches a bean defined in your spring file, it should be picked 
up.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog