尝试使用Tomcat 7 Maven插件和CXF 2.7.8部署JAX-WS端点。作为优先事项,我不想为Spring或CXF设置任何XML配置。我看到了使用cxf-servlet.xml
和CXFServlet的几个博客,文章,帖子,但完全没有使用Java config的博客。查看CXFServlet源代码,它cxf-servlet.xml
在servlet上下文中的key下寻找或东西'config-location'
。我尝试以编程方式注册端点,而不是在cxf-servlet.xml
,但它不起作用。访问该服务时,我收到404。有任何想法吗?
@Configuration
@ImportResource({ "classpath:META-INF/cxf/cxf.xml" })
public class CXFConfig {
@Autowired
Bus cxfBus;
// More code
@Bean
public Endpoint calculator() {
EndpointImpl endpoint = new EndpointImpl(cxfBus, new Calculator());
endpoint.setAddress("/CalculatorService");
return endpoint;
}
}
所需要的就是endpoint.publish()
上面的电话。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句