cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <bimargul...@gmail.com>
Subject Re: Injecting other beans into service implementation
Date Fri, 11 Jul 2008 01:09:58 GMT
Make a separate <bean/> for the SEB, and use the # syntax to drop it into
the endpoint.

On Thu, Jul 10, 2008 at 8:45 PM, hansamann <hansamann@yahoo.de> wrote:

>
> Hi all,
>
> I have successfully created a few JAXWS endpoints, e.g.
>
>        <jaxws:endpoint
>          id="helloWorld"
>          implementor="com.yahoo.cl.madness.api.impl.HelloWorldImpl"
>          address="/HelloWorld" />
>
> Now I would like to inject some additional beans into the implementation
> classes, for example a hibernate sessionfactory.
>
> I tried using this in my service implementation class:
>
>        @Autowired
>        @Qualifier("dataAccess")
>        private DataAccess dataAccess = null;
>
> ... but it just won't be set. The bean I am trying really does exist, but
> it
> seems spring does not inspect the whole service implementation class at
> all.
>
> This is the beginning of the implementation class:
>
> @WebService(endpointInterface = "com.yahoo.cl.madness.api.AccountService")
> @Service
> public class AccountServiceImpl implements AccountService
> {
>        private static Logger log =
> Logger.getLogger(AccountServiceImpl.class);
>
>        @Autowired
>        @Qualifier("dataAccess")
>        private DataAccess dataAccess = null;
>        ...
>
> The web service itself works great, just all beans I am trying to inject
> are
> not there.
>
> Is there an issue with using
> @WebService(endpointInterface = "com.yahoo.cl.madness.api.AccountService")
> @Service
> at the same time? I do not need to create a spring bean from the
> implementation class, but I thought that way the dependencies might get
> resolved. I also removed the @Service already (Web Services were still
> exported by CXF) but did not work.
>
> If annotation-based injection does not work, how would I otherwise inject
> some beans into the implementation object?
>
> Thanx,
> Sven
> --
> View this message in context:
> http://www.nabble.com/Injecting-other-beans-into-service-implementation-tp18394692p18394692.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message