web.xml配置
<!--webservice 专用 -->
<servlet>
<display-name>springcxf</display-name>
<servlet-name>springcxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>springcxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<!--webservice 专用 -->
spring 配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
·
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<-- 实现了启动服务的流程-->
<jaxws:endpoint id="helloworld" implementor="com.atguigu.cxf.spring.HelloWorldImpl" address="/HelloWorld">
</jaxws:endpoint>
<jaxrs:server id="customerService" address="/CustService">
<jaxrs:serviceBeans>
<bean class="com.atguigu.service.CustomerService" />
</jaxrs:serviceBeans>
</jaxrs:server>
</beans>