2014-12-18 2 views
0

Я пытаюсь ввести Spring Service в SOAPHandler, но ссылка всегда равна нулю.SOAPHandler и Spring Autowire

Я попытался простирающийся SpringBeanAutowiringSupport и использование:

public class FuelServiceSOAPHandlerBase extends SpringBeanAutowiringSupport implements SOAPHandler<SOAPMessageContext>, InitializingBean { 
    @Autowired 
    private AuthenticationService authenticationService; 

    @Override 
    @PostConstruct 
    public void afterPropertiesSet() throws Exception { 
     LOG.info("AuthenticationHandler - PostConstruct"); 
     SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); 
    } 
    .... 
} 

Это не работает, AuthenticationService всегда нуль. Я попробовал также получить Bean throw

authenticationService = WebApplicationContextUtils.getWebApplicationContext(((HttpServletRequest)context.getMessage().getProperty(MessageContext.SERVLET_REQUEST)).getSession().getServletContext()).getBean(FuelAuthenticationService.class); 

Но ServletRequest имеет значение null. Я выполняю вызов Webservice-Call SOAPUI.

Кто-нибудь знает, что такое ошибка?

Благодаря

ответ

2

Я решил с помощью @Resource и не @Autowire