cxf ServerFactoryBean 生成基于soap1.2的WebServices
2016-05-10 16:01
405 查看
//获得服务工厂bean ServerFactoryBean bean = new ServerFactoryBean(); HTTPTransportFactory httpTransportFactory = new HTTPTransportFactory(); //绑定服务的发布地址 bean.setAddress("http://10.0.1.32:5678/hello"); //指定提供服务的类型 bean.setServiceClass(HelloService.class); //指定提供服务的实例 bean.setServiceBean(new HelloServiceImpl()); bean.getServiceFactory().getConfigurations().add(new MethodNameSoapActionServiceConfiguration()); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); bean.setBindingConfig(conf); //启动服务-----publish bean.setStart(false); ServerImpl server= (ServerImpl)bean.create(); EndpointInfo e1=((ServletDestination)server.getDestination()).getEndpointInfo(); e1.getBinding().getOperations().forEach(e->{ }); Bus b1=((ServletDestination)server.getDestination()).getBus(); Destination destination= httpTransportFactory.getDestination(e1,b1); server.setDestination(destination); server.start(); System.out.println("server ready...");
重点代码是
SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); bean.setBindingConfig(conf);
相关文章推荐
- [C#]线程处理
- Leetcode 221 Maximal Square
- C# 之 判断或设置以管理员身份运行程序
- WordPress中设置Post Type自定义文章类型的实例教程
- 【C语言】数组对应位置交换值
- POV-Ray简单上手教程——第一幅图像和基础图形
- Android 从网上下载图片并显示到ListView上
- Andriod调用WebService交互(.net)
- rsync故障排除解答
- 飞机游戏
- Android_动态权限管理的解决方案
- MyBatis学习总结(七)——Mybatis缓存
- Android 如何对apk文件进行反编译以及重新打包签名
- Java反射机制的原理及在Android下的简单应用
- Android 如何对apk文件进行反编译以及重新打包签名 标签: apktoolandroid反编译jebSmali2Java 2016-05-10 16:00 3897人阅读 评论(0) 收藏
- [BZOJ3931][CQOI2015]网络吞吐量(spfa+最大流)
- HYSBZ 2160 拉拉队排练(回文树)
- caffe+Xubuntu14.04+cuda7.5+matlab2014b配置
- GridView
- iOS开发之静态库.a的制作教程