You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marc Preddie <mp...@gmail.com> on 2007/07/13 18:24:05 UTC

spring injection with jaxws:endpoint

Hi,

I have exposed a web service using cxf using the systex below, and it works
fine....

<jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
address= "/MyTestService"> </jaxws:endpoint >

What I then did was to actully make the service do something (access a
database through hibernate), so I wanted to inject my SpringDAO into my
service. This is where I get lost.... I tried the systax below, but to no
avial. (of course TestDAO is defined within the spring xml config...)

<jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
address= "/MyTestService">

<
property name="testDAO" ><ref bean="TestDAO" /></property>

</jaxws:endpoint>

I tried many differnt things with no success and I was wondering whether or
not anyone has done this and how they did it.

BTW. I'm using Java 6, CXF 2.0 and Spring 2.1

Regards

Marc

Re: spring injection with jaxws:endpoint

Posted by Marc Preddie <mp...@gmail.com>.
Hi,

Sorry for the late reply, I was away on business. Anyway, both solutions
solve my problem, thanks.

Regards
Marc


On 7/16/07, Holger Stolzenberg <h....@ewerk.com> wrote:
>
> For me this worked:
>
> <bean id="CustomerServiceImpl" class="com.domain.CustomerServiceImpl">
>        <property name="daoProxyProvider" ref="DaoProxyProvider"/>
>        <property name="eventManager" ref="EventManager"/>
> </bean>
> <jaxws:endpoint id="CustomerService" address="/CustomerService">
>        <jaxws:implementor>
>                <bean parent="CustomerServiceImpl" />
>        </jaxws:implementor>
> </jaxws:endpoint>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Dan Diephouse [mailto:dan@envoisolutions.com]
> Gesendet: Freitag, 13. Juli 2007 23:11
> An: cxf-user@incubator.apache.org
> Betreff: Re: spring injection with jaxws:endpoint
>
> I believe this is what you want:
>
> <bean id="foo" class="com.test.testServiceImpl"> <property name="testDAO"
> ><ref bean="TestDAO" /> </bean>
>
> <jaxws:endpoint id="testService" implementor="#foo"
> address= "/MyTestService">
>
> Hope that helps :-)
>
> - Dan
>
>
> On 7/13/07, Marc Preddie <mp...@gmail.com> wrote:
> >
> > Hi,
> >
> > I have exposed a web service using cxf using the systex below, and it
> > works fine....
> >
> > <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> > address= "/MyTestService"> </jaxws:endpoint >
> >
> > What I then did was to actully make the service do something (access a
> > database through hibernate), so I wanted to inject my SpringDAO into
> > my service. This is where I get lost.... I tried the systax below, but
> > to no avial. (of course TestDAO is defined within the spring xml
> > config...)
> >
> > <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> > address= "/MyTestService">
> >
> > <
> > property name="testDAO" ><ref bean="TestDAO" /></property>
> >
> > </jaxws:endpoint>
> >
> > I tried many differnt things with no success and I was wondering
> > whether or not anyone has done this and how they did it.
> >
> > BTW. I'm using Java 6, CXF 2.0 and Spring 2.1
> >
> > Regards
> >
> > Marc
> >
>
>
>
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
>

AW: spring injection with jaxws:endpoint

Posted by Holger Stolzenberg <h....@ewerk.com>.
For me this worked:

<bean id="CustomerServiceImpl" class="com.domain.CustomerServiceImpl">
	<property name="daoProxyProvider" ref="DaoProxyProvider"/>
	<property name="eventManager" ref="EventManager"/>
</bean> 
<jaxws:endpoint id="CustomerService" address="/CustomerService">
	<jaxws:implementor>
		<bean parent="CustomerServiceImpl" />
	</jaxws:implementor>
</jaxws:endpoint>


-----Ursprüngliche Nachricht-----
Von: Dan Diephouse [mailto:dan@envoisolutions.com] 
Gesendet: Freitag, 13. Juli 2007 23:11
An: cxf-user@incubator.apache.org
Betreff: Re: spring injection with jaxws:endpoint

I believe this is what you want:

<bean id="foo" class="com.test.testServiceImpl"> <property name="testDAO" ><ref bean="TestDAO" /> </bean>

<jaxws:endpoint id="testService" implementor="#foo"
address= "/MyTestService">

Hope that helps :-)

- Dan


On 7/13/07, Marc Preddie <mp...@gmail.com> wrote:
>
> Hi,
>
> I have exposed a web service using cxf using the systex below, and it 
> works fine....
>
> <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> address= "/MyTestService"> </jaxws:endpoint >
>
> What I then did was to actully make the service do something (access a 
> database through hibernate), so I wanted to inject my SpringDAO into 
> my service. This is where I get lost.... I tried the systax below, but 
> to no avial. (of course TestDAO is defined within the spring xml 
> config...)
>
> <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> address= "/MyTestService">
>
> <
> property name="testDAO" ><ref bean="TestDAO" /></property>
>
> </jaxws:endpoint>
>
> I tried many differnt things with no success and I was wondering 
> whether or not anyone has done this and how they did it.
>
> BTW. I'm using Java 6, CXF 2.0 and Spring 2.1
>
> Regards
>
> Marc
>



--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: spring injection with jaxws:endpoint

Posted by Dan Diephouse <da...@envoisolutions.com>.
I believe this is what you want:

<bean id="foo" class="com.test.testServiceImpl">
<property name="testDAO" ><ref bean="TestDAO" />
</bean>

<jaxws:endpoint id="testService" implementor="#foo"
address= "/MyTestService">

Hope that helps :-)

- Dan


On 7/13/07, Marc Preddie <mp...@gmail.com> wrote:
>
> Hi,
>
> I have exposed a web service using cxf using the systex below, and it
> works
> fine....
>
> <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> address= "/MyTestService"> </jaxws:endpoint >
>
> What I then did was to actully make the service do something (access a
> database through hibernate), so I wanted to inject my SpringDAO into my
> service. This is where I get lost.... I tried the systax below, but to no
> avial. (of course TestDAO is defined within the spring xml config...)
>
> <jaxws:endpoint id="testService" implementor="com.test.testServiceImpl"
> address= "/MyTestService">
>
> <
> property name="testDAO" ><ref bean="TestDAO" /></property>
>
> </jaxws:endpoint>
>
> I tried many differnt things with no success and I was wondering whether
> or
> not anyone has done this and how they did it.
>
> BTW. I'm using Java 6, CXF 2.0 and Spring 2.1
>
> Regards
>
> Marc
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog