cxf 客户端开发

  1. 下载cxf 包 找到wsdl2java.bat 

  2. 运行wsdl2java -d G:\\com -p com.gcj.utils.userCheck  -client http://home.glodon.com:7783/Utilities/Account/ProxyService/SsoAuthUserProcess?wsdl

    -d 指定存放的位置  -p 指定包路径 -client 生成客户端   

    3.    找到com.gcj.utiles.userCheck 把相关  文件 复制到 开发项目中。

    4.    配置spring 集成配置 

<bean id="userClientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<!-- 接口类 -->
<property name="serviceClass" value="com.gcj.utils.userCheck.SsoAuthUserProcess" />
<!-- 服务地址 -->
<property name="address" value="http://home.glodon.com:7783/Utilities/Account/ProxyService/SsoAuthUserProcess" />

</bean>
<!-- 生成客户端 -->
<bean id="userClient" class="com.gcj.utils.userCheck.SsoAuthUserProcess"factory-bean="userClientFactory" factory-method="create" />

    5.    注入调用就行了

            

@Autowired
private SsoAuthUserProcess ssoAuthUserProcess;


你可能感兴趣的:(cxf 客户端开发)