`
sanshi
  • 浏览: 82260 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

CXF客户端

    博客分类:
  • java
阅读更多

beans.xml配置:

        <?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-2.0.xsd
  http://cxf.apache.org/jaxws
  http://cxf.apache.org/schemas/jaxws.xsd">

 <jaxws:client
  id="accountClient"
  address="http://192.168.2.100:8080/DuanXin/services/accountServices"
  serviceClass="com.hongxin.account.AccountDaoInterface"/>
 <jaxws:client
  id="sendMessageClient"
  address="http://192.168.2.100:8080/DuanXin/services/sendMessage"
  serviceClass="com.hongxin.account.SendMessageInterface"/>
 <jaxws:client
  id="sendMessageDaoClient"
  address="http://192.168.2.100:8080/DuanXin/services/querySendMessage"
  serviceClass="com.hongxin.account.SendMessageDaoInterface"/>
 <jaxws:client
  id="userAccountDaoClient"
  address="http://192.168.2.100:8080/DuanXin/services/userAccount"
  serviceClass="com.hongxin.account.UserAccountDaoInterface"/>
  
 <jaxws:client
  id="receiveMessageDaoClient"
  address="http://192.168.2.100:8080/DuanXin/services/receiveMessage"
  serviceClass="com.hongxin.account.ReceiveMessageDaoInterface"/>    
</beans>

当然工程里要把众多的接口类写上

 客户端代码:

         ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
  AccountDaoInterface account = (AccountDaoInterface) context.getBean("accountClient");

分享到:
CXF
评论

相关推荐

Global site tag (gtag.js) - Google Analytics