spring对cxf的webservice调用做好很好的支持,只需要一下步骤即可调用cxf:
1.加cxf的jar包:cxf-2.6.2.jar、neethi-3.0.2.jar、xmlschema-core-2.0.jar
2.增加spring配置文件如下:
<bean id="subFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass"
value="用eclipse生成的cxf客户端接口类" />
<property name="address"
value="webservice的地址" />
</bean>
<bean id="subService" class="用eclipse生成的cxf客户端接口类"
factory-bean="subFactory" factory-method="create" />
上面需要用eclipse生成的cxf客户端接口类即可。
如果其他的类要调用cxf的webservice接口,只需要把subService注入即可。