CXF调用webservice超时设置
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(Service1Soap.class);// 设置请求接口
factory.setAddress("http://*.*.*.*/SMSService/Service1.asmx?WSDL");
Service1Soap esbServer = (Service1Soap) factory.create(); // 创建客户端对象
// 设置客户端的配置信息,超时等.
Client proxy = ClientProxy.getClient(esbServer);
HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setConnectionTimeout(10000); // 连接超时时间
policy.setReceiveTimeout(10000);// 请求超时时间.
conduit.setClient(policy);
String _sendSms_account = "";
String _sendSms_password = "";
String _sendSms__return = "";
_sendSms_account = "1";
_sendSms_password = "2";
esbServer.sendSms(_sendSms_account, _sendSms_password, "", "", "");
System.out.println(System.currentTimeMillis() - a);
CXF调用webservice超时设置的更多相关文章
- cxf调用WebService
一.用CXF调用WebService的几种方式,参考: http://cxf.apache.org/docs/how-do-i-develop-a-client.html 二.JaxWsProxyFa ...
- Spring Boot 使用 CXF 调用 WebService 服务
上一张我们讲到 Spring Boot 开发 WebService 服务,本章研究基于 CXF 调用 WebService.另外本来想写一篇 xfire 作为 client 端来调用 webservi ...
- Java调用WebService方法总结(7)--CXF调用WebService
CXF = Celtix + XFire,继承了Celtix和XFire两大开源项目的精华,是一个开源的,全功能的,容易使用的WebService框架.文中所使用到的软件版本:Java 1.8.0_1 ...
- XML:使用cxf调用WebService接口时报错:编码GBK的不可映射字符(设置UTF-8字符集)
调用代码如下 JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf. ...
- cxf 调用 webservice服务时传递 服务器验证需要的用户名密码
cxf通过wsdl2java生成客户端调用webservice时,如果服务器端需要通过用户名和密码验证,则客户端必须传递验证所必须的用户名和密码,刚开始想通过url传递用户名和密码,于是在wsdl文件 ...
- 调用webservice超时问题的解决[转]
1.web.config配置,<system.web></system.web>里面增加:<httpRuntime maxRequestLength="1024 ...
- python调用函数超时设置
1.Windows中sign报错,Linux能很好的使用: https://pypi.python.org/pypi/timeout-decorator 2.Windows可以使用,Linux报错不能 ...
- 使用cxf调用webservice
1.引入maven包 <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt ...
- 使用Fiddler 4 调用WebService
Fiddler让我们这些.neter感到非常欣慰, 是用C#写出来的,它包含一个简单却功能强大的基于JScript .NET 事件脚本子系统,它的灵活性非常棒,可以支持众多的http调试任务,并且能够 ...
随机推荐
- Dictionary读取键值的快捷方法
对泛型集合Dictionary<T,T> 进行读取键值是经常的操作,一般情况下,都是通过keys 和values进行键值的读取操作: eg: foreach (var item in di ...
- 如何解决自动加载与模板中(如Smarty)的自动加载冲突的问题
function aotuman($class){ include('./'.$class.'.class.php'); } spl_autoload_register('automan'); / ...
- linux下将不同线程绑定到不同core和cpu上——pthread_setaffinity_np
=============================================================== linux下的单进程多线程的程序,要实现每个线程平均分配到多核cpu,主 ...
- android中设置控件获得焦点 (转)
android中,要使控件获得焦点,需要先setFocus,再requestFocus. 以Button为例: btn.setFocusable(true); ...
- SQL性能学习汇总 00
.在一条语句中不要重复使用相同的函数 .尽可能在存储过程中使用临时变量和临时表 如 IF (Object_ID('tempdb..#T') IS NOT NULL) DROP TABLE #T SEL ...
- Hibernate的事务处理
事务:事务就是逻辑上的一组操作,要么全都成功,要么全都失败!!! 事务特性 原子性:事务一组操作不可分割. 一致性:事务的执行前后,数据完整性要保持一致. 隔离性:一个事务在执行的过程中不应该受到其他 ...
- OpenFOAM 学习路线 【转载】
"Two weeks of playing with a CFD code will save you one afternoon of reading" 什么是OpenFOAM( ...
- python base64的加密与解密
Base64编码是一种“防君子不防小人”的编码方式.广泛应用于MIME协议,作为电子邮件的传输编码,生成的编码可逆,后一两位可能有“=”,生成的编码都是ascii字符. 优点:速度快,ascii字符, ...
- jquery.validate.js表单验证
一.用前必备官方网站:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ API: http://jquery.bassist ...
- 【转】前端工程筹建NodeJs+gulp+bower
转自:http://www.myexception.cn/javascript/1781968.html npm nodejs 安装过程中会自动安装npm,nodejs安装程序会在环境变量中添加两个变 ...