以下內容是在配置cxf過程中需要注意的點
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<!-- import cxf -->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<!-- 在寫分佈式項目的時候一定要把服務端和客戶端區分開來寫,雖然可以運行,但是很亂 -->
<!--
需要注意的點:
1.implementor="com.qfy.service.impl.EmpImpl"
如果這種方式不好使,可以使用手動注入bean,然後設置一個選擇器
手動注入
<bean id="iemp" class="com.qfy.service.impl.EmpImpl"></bean>
<jaxws:endpoint implementor="#iemp" address="/iemp"></jaxws:endpoint>
-->
<jaxws:endpoint implementorClass="com.qfy.service.IEmp" implementor="com.qfy.service.impl.EmpImpl" address="/iemp"></jaxws:endpoint>
<!-- 客戶端接口注入到cxf中 -->
<jaxws:client id="iemp" serviceClass="com.qfy.service.IEmp" address="http://127.0.0.1:8080/spring-cxf/webservice/iemp"></jaxws:client>
</beans>