CXF整合Spring通过tomcat发布webservice
1.创建web工程,下载apache-cxf-2.7.18,将apache-cxf-2.7.18下的lib下的jar包加入项目lib中
2.项目中添加Spring(自动添加application.xml文件,以及在web.xml中加入spring监听器)
3.web.xml中添加cxfservlet,并配置拦截/cxf/* (拦截所有cxf请求)
4.编写接口和实现,一定要在接口中添加注解@webservice
5.applicationContext.xml中添加协议
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation中尾部添加 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
并配置接口实现bean和接口bean
6.访问http://localhost:8080/cxf_server/cxf 即出现webservice服务列表(cxf功能)
7.点进去右边wsdl进入对应webservice