Bruno Melloni wrote:
> No, sorry.  I guess I did not communicate it clearly.  
> 
> <jaxws:endpoint implementor="#webServiceImpl" ... /> works great.
> 
> The problem happens when I add a vanilla bean to the context:
> 
> <bean id="myBean".... />
> 
> I try to read the bean fail miserably.
> 
> - I already tried adding "private MyBeanClass myBean" and the corresponding 
> getter/setter in my code.  No luck.

OK, your webServiceImpl class has a

public void setMyBean(MyBeanClass b) { ... }

So to wire that up all you need is the relevant <property> tag in the
webServiceImpl bean definition:

<bean id="webServiceImpl" class="my.example.WebServiceImpl">
  <property name="myBean" ref="myBean" />
</bean>

This is how Spring is supposed to work - you don't "grab" beans from the
context, the context injects them for you.

Ian

P.S. The @Autowired annotation will also work but for that you need to
add <context:annotation-config /> to your XML
(http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-annotation-config)
in order to tell Spring to look for the annotation.

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

Reply via email to