创建webservice服务端以及生成客户端进行调用
2016-03-14 22:33
417 查看
1.准备jar包
apache-cxf-2.3.3.zip
2.客户端具体部分查看 http://www.tuicool.com/m/articles/jQraum
3.wsdl2java生成客户端
3.1切换到需要生成文件的目录
3.2执行C:\Users\Administrator\Desktop\webservice\apache-cxf\apache-cxf-2.3.3\apache-cxf-2.3.3\bin\wsdl2java http://localhost:8080/chh/Users?wsdl
3.将客户端贴到你的项目里就可以调用对方的方法了
ComplexUserServiceService factory = new ComplexUserServiceService();//这个继承service方法的类就是服务类
// 此处返回的只是远程WebService的代理
IComplexUserService helloWorld = factory.getComplexUserServicePort();//通过这个服务类获取端口
User user = helloWorld.getUserByName("zhangsan");//通过这个端口调用方法,返回对象在生成的类也有
apache-cxf-2.3.3.zip
2.客户端具体部分查看 http://www.tuicool.com/m/articles/jQraum
3.wsdl2java生成客户端
3.1切换到需要生成文件的目录
3.2执行C:\Users\Administrator\Desktop\webservice\apache-cxf\apache-cxf-2.3.3\apache-cxf-2.3.3\bin\wsdl2java http://localhost:8080/chh/Users?wsdl
3.将客户端贴到你的项目里就可以调用对方的方法了
ComplexUserServiceService factory = new ComplexUserServiceService();//这个继承service方法的类就是服务类
// 此处返回的只是远程WebService的代理
IComplexUserService helloWorld = factory.getComplexUserServicePort();//通过这个服务类获取端口
User user = helloWorld.getUserByName("zhangsan");//通过这个端口调用方法,返回对象在生成的类也有
相关文章推荐
- openstack kilo部署-基础环境
- python + Streaming框架的MR实践与优化
- AngularJS in Action读书笔记4(实战篇)——创建Statistic模块
- 冒烟测试与回归测试
- unity AssetBundles
- oracle基本总结
- 命名要能揭示意图
- sscanf函数
- 第一次电话面试_(:з」∠)_
- 在很多问题上面,枚举不一定不可行,只要你能剪枝剪得好
- SpringAOP的切点表达式详解
- string类基础知识
- Android ORM 框架greenDao快速入门
- 胖子哥的大数据之路(14):数据价值链模型
- [leetcode 153]Find Minimum in Rotated Sorted Array----求旋转数组的最小值
- 配置QtCreator+CDB远程调试环境(要设置_NT_SYMBOL_PATH和QT_PLUGIN_PATH和Path)
- 架构探险——从零开始写Java Web框架》第二章照作
- mod3 如何用硬件实现
- python之路-django深入
- 未来的你才是时间的新欢