1 CXFcrm
1.1
1.2 web
web
CXFjar
web.xml
<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:cxf.xml</param-value> </context-param> <!-- 配置监听器加载CXF的cxf.xml --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 配置CXF框架提供的Servlet --> <servlet> <servlet-name>cxf</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>cxf</servlet-name> <url-pattern>/service/*</url-pattern> </servlet-mapping>
cxf.xml
t_customerCustomer
cxf.xml
<!-- 配置数据源 --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql:///crm_javaweb"/> <property name="username" value="root"/> <property name="password" value=""/> </bean> <!-- 事物管理器 --> <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 支持事务注解 --> <tx:annotation-driven transaction-manager="txManager"/> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="customerService" class="com.javaweb.crm.service.CustomerServiceImpl"> <property name="jdbcTemplate" ref="jdbcTemplate" /> </bean> <!-- 注册服务 --> <jaxws:server id="mtService" address="/service"> <jaxws:serviceBean> <ref bean="customerService"/> </jaxws:serviceBean> </jaxws:server>
原文:https://www.cnblogs.com/FanJava/p/9283588.html