根据网上流行配置
spring mvc + cxf 配置成功 也可以访问到wsdl
但是使用@Autowired在web service接口实现类中注入组件时总是得到null的结果。
最后发现
<context:component-scan base-package="xxxx.xxx" />
写到xxx-serverlet.xml中未能对自定义的接口实现类起到作用,当放置到applicationContext.xml中才变得好用。
同时注意
<bean id="hello" class="web.service.HelloServiceImpl" /> <jaxws:endpoint id="helloWorld" implementor="#hello" address="/HelloWorld" />
可用此种方式将webservice类纳入spring管理之中。