spring调用cxf webservice方法

来源:互联网 发布:知势而后可以加兵的加 编辑:程序博客网 时间:2024/04/30 14:10

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注入即可。

原创粉丝点击