使用xFire调用Webservice接口
2016-01-28 14:31
363 查看
使用xFire调用Webservice接口有几个参数后台封装了不过大家看下流程应该也知道怎么用xFire来调用Webservice了public static IMicroPage invokeMicroPage() throws MalformedURLException {Service serviceModel = new ObjectServiceFactory().create(IMicroPage.class);// //参数设置HttpClientParams params = new HttpClientParams();params.setParameter(HttpClientParams.USE_EXPECT_CONTINUE,Boolean.FALSE);params.setSoTimeout(20000);//
单位是毫秒serviceModel.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS,params);PropertiesConfiguration config = ConfigUtil.getPropertiesConfiguration();String MICROPAGE_WS_HREF = config.getString("MICROPAGE_WS_HREF");IMicroPage service = (IMicroPage) new
XFireProxyFactory().create(serviceModel, MICROPAGE_WS_HREF);// 为了防止Socket连接池满 -- addClient client = Client.getInstance(service);client.setTimeout(20000);client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, String.valueOf(20000));client.setProperty(CommonsHttpMessageSender.DISABLE_KEEP_ALIVE,
"true");client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE,"true");// 为了防止Socket连接池满return service;}
4000
单位是毫秒serviceModel.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS,params);PropertiesConfiguration config = ConfigUtil.getPropertiesConfiguration();String MICROPAGE_WS_HREF = config.getString("MICROPAGE_WS_HREF");IMicroPage service = (IMicroPage) new
XFireProxyFactory().create(serviceModel, MICROPAGE_WS_HREF);// 为了防止Socket连接池满 -- addClient client = Client.getInstance(service);client.setTimeout(20000);client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, String.valueOf(20000));client.setProperty(CommonsHttpMessageSender.DISABLE_KEEP_ALIVE,
"true");client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE,"true");// 为了防止Socket连接池满return service;}
4000
相关文章推荐
- 【Linux】【驱动】MTD分区表信息解析方法分析
- 给 App 提速:Android 性能优化总结
- C++面试(七)
- safari打不开该网页,因为网址无效
- bat批处理笔记——删除指定类型文件示例
- Android Design Support Library常用控件(下)
- Spring MVC +Mybatis + Maven 配置之pom.xml配置
- Spark Sql性能测试及调优
- webuploader 实现大文件 分片上传
- hive的insert
- AutoTile 自动拼接(五) 学习与实践
- 在Bonobo服务器里创建Repository(库)
- maven setting配置
- 从布局动画引入ListView滑动时,每一Item项的显示动画
- 谓词
- 探讨JavaScript语句的执行过程
- MySQL性能优化的最佳经验
- MySQL分组数据
- Best Quality Bluetooth Version VXSCAN H90 J2534
- maven项目部署到Repository(Nexus)