aseem cheema wrote:
> Hey Folks,
> I am using Spring with cxf, following the sample in
> apache-cxf-2.2\samples\java_first_spring_support.
> 
> I have some other beans (my application related beans) that are
> defined in the same xml file as my endpoint. I need to retrieve these
> beans in my service implementation code. I am not able to find an
> example of that. How do I do this?

The best approach would be to define your implementation bean separately
from the endpoint, i.e. instead of:

<jaxws:endpoint implementor="my.service.FooImpl" .... />

you do:

<jaxws:endpoint implementor="#serviceImplementation"
                implementorClass="my.service.FooImpl" .... />

and then you can add the relevant setter methods to your implementation
class and do dependency injection in the normal Spring way:

<bean id="serviceImplementation" class="my.service.FooImpl">
  <property name="helper" ref="helperBean" />
  ...
</bean>

Ian

-- 
Ian Roberts               | Department of Computer Science
[email protected]  | University of Sheffield, UK

Reply via email to