Apache Cxf WebService整合Spring(2)
来源:互联网 发布:mac口红a17是什么颜色 编辑:程序博客网 时间:2024/05/20 18:41
Apache Cxf WebService整合Spring(2)
分类: WebService2013-11-03 17:15 60人阅读 评论(0) 收藏 举报
六:部署项目,启动Tomcat,发布WebService,在浏览器输入http://localhost:8080/Spring-Cxf-Demo/lzw/cxf?wsdl
七:配置apache-cxf(在环境变量Path中加入:;F:\Java\WebService\CXF\apache-cxf-2.7.6\bin)
八:生成客户端代码
(1)在本地建立Test 工程
(2)在src目录下输入 wsdl2java http://localhost:8080/Spring-Cxf-Demo/lzw/cxf?wsdl
九:添加测试代码
- package com.lzw.springcxf.client;
- import java.util.List;
- import com.lzw.springcxf.service.ClubModel;
- import com.lzw.springcxf.service.HandleService;
- import com.lzw.springcxf.service.PlayerModel;
- import com.lzw.springcxf.service.impl.HandleServiceTest;
- public class WSClient {
- public static void main(String[] args) {
- HandleServiceTest factory = new HandleServiceTest();
- HandleService handleService = factory.getHandleServiceImplPort();
- System.out.println(handleService.sayName("内马尔"));
- ClubModel clubModel = new ClubModel();
- clubModel.setClubId(1111);
- clubModel.setClubName("巴塞罗那");
- clubModel.setCountry("西班牙");
- List<PlayerModel> players = handleService.getPlayerByClub(clubModel);
- for (PlayerModel play:players) {
- System.out.println(play.getPlayerName());
- }
- }
- }
控制台输出:
- 本次西班牙国家德比的最佳球员是:内马尔
- 梅西
- 内马尔
0 0
- Apache Cxf WebService整合Spring(2)
- Apache Cxf WebService整合Spring(2)
- Apache Cxf WebService整合Spring(1)
- Apache Cxf WebService整合Spring(1)
- CXF Webservice 6 - Spring 3 整合Apache CXF WebService
- webservice快速入门-使用spring整合apache-cxf(五)
- webservice快速入门-使用spring整合apache-cxf(五)
- Spring 3 整合Apache CXF WebService
- Spring 3 整合Apache CXF WebService
- Spring 整合 Apache CXF发布webService
- Spring 3 整合Apache CXF WebService
- Spring 3 整合Apache CXF WebService
- Spring 3 整合Apache CXF WebService
- CXF WebService整合Spring
- CXF WebService整合Spring
- CXF WebService整合Spring
- CXF WebService整合Spring
- CXF WebService整合Spring
- memmove函数的使用方法
- 复制当前目录及其子目录下面的所有的txt文件,如果有文件名相同则重命名为bak01,bak02 ......
- 使用 Apache CXF 实现 Web Service 详解
- CXF整合spring
- Apache Cxf WebService整合Spring(1)
- Apache Cxf WebService整合Spring(2)
- cxf小实例
- Apache CXF 客户端调用 超时设置
- 用js来刷新当夜页面,保留参数
- Linux下python默认版本设置
- arch下ibus选择
- 大数据下Sql优化心得记录
- Node中的模块机制
- 异步I/O