0

I have created soap web Service using Exclipse webservice tool.I have tested webservice its working fine. Autowiring is not working in WebService Class. I tried to resolve the issue by extending SpringBeanAutowiringSupport class in web Service and Using @Post Construct.

This is my web Service.

@Service
@WebService(targetNamespace = "http://webservice.csm.cms.hpe.com/",    
endpointInterface = "com.hpe.cms.csm.webservice.AuthenticateUserSEI",   
portName = "AuthenticateUserPort", serviceName = "AuthenticateUserService")

public class AuthenticateUser   implements AuthenticateUserSEI{

@Autowired
public LoginService loginService;
public boolean findValidUser(String userName,String password)
{
    return loginService.validateUser(userName,password);

}

}

This is LoginServiceInterface Code

@Service
public interface LoginService { 
public boolean findValidUser(String userName,String password);
}

This is LoginServiceImpl Code

@Service
public class LoginServiceImpl implements LoginService {
@Autowired 
private LoginDAO loginDao;  
public boolean findValidUser(String userName,String password) {
    System.out.println("Login DAO:- "+loginDao);
    return loginDao.validateUser(userName,password);        
}

When i invoke my webService loginService is always Null. I reffered below link JAX WS webservice does not take spring bean from applicationcontext, hence throws null pointer exception

Still i m facing the null pointer Exception. Please let me know the solution

When I tried extending SpringBeanAutowiringSupport class,i m getting following error

org.springframework.beans.factory.NoSuchBeanDefinitionException: No    
qualifying bean of type [com.hpe.cms.csm.services.LoginService] found for   
dependency: expected at least 1 bean which qualifies as autowire candidate 
for this dependency.
Community
  • 1
  • 1
Niketa
  • 453
  • 2
  • 9
  • 24
  • Possible duplicate - http://stackoverflow.com/questions/17567546/spring-autowired-is-not-working-for-webservice-annotated-class – ChrisF May 17 '16 at 08:01
  • I refereed above link.. Still error exists – Niketa May 17 '16 at 08:41
  • when i treid to extend SpringBeanAutowiring Support class i am getting org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.hpe.cms.csm.services.LoginService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. – Niketa May 17 '16 at 09:02

0 Answers0