Igor Custodio

+ Follow
since Sep 09, 2014
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Igor Custodio

I would like to inject (@Autowired or @Resource) beans created by Spring (3.x or 4.x) in a class that implements a JAX-WS (reference implementation) interface.

Tested and works on Tomcat 6 but in Tomcat 7, it seems that something on the container has changed and the contexts are different.

I have used the proposed integration (which even has bad documentation) as suggested in: http://www.mkyong.com/webservices/jax-ws/jax-ws-spring-integration-example/

In this example, the sun-jaxws.xml file is replaced by a Spring configuration file. However, in my example I'm doing everything with @Configuration because I was trying to avoid XMLs.
I do not know how to make this change to the JAX-WS Endpoint be able to use a bean injected by Spring, without me having to use the applicationContext.getBean ("myBean").

ps.: I have read about every kind of solution, believe me! Some suggest extending SpringBeanAutowiringSupport, others put a @PostConstructor method, but nothing works in Tomcat 7, when I send a SOAP request, my WebService class has no beans in it (NPE).

It is a definition of container? There's no way to do it? That is the main question, so I can give up forever. ;)

Another possible solution: does anyone knows how to do this:

<wss:binding url="/hello">
<ws:service bean="#helloWorldWS"/>

in a java @Configuration class?

Thank you
9 years ago