加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

webservice 报错 提示超时错误

发布时间:2020-12-16 23:58:45 所属栏目:安全 来源:网络整理
导读:应用场景: 电子称 上传数据到电子称监控软件上,监控软件(该监控软件不能直接访问域名,奇怪!)调用 PC1上的webservice,PC1上的webservice在再访问后台服务提供的webservice 在电子称连续快速上传3次数据后会提示连接超时。 ? ? ? ??Properties pro = ne

应用场景:

电子称 上传数据到电子称监控软件上,监控软件(该监控软件不能直接访问域名,奇怪!)调用 PC1上的webservice,PC1上的webservice在再访问后台服务提供的webservice

在电子称连续快速上传3次数据后会提示连接超时。

? ? ? ??Properties pro = new Properties();
pro.load(getClass().getResourceAsStream("/util.properties"));
String url = new String(pro.getProperty("web_url").getBytes("ISO8859-1"),"UTF-8");
System.out.println(url);
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(url);
options.setTo(targetEPR);
options.setManageSession(true);
options.setProperty("REUSE_HTTP_CLIENT",Boolean.TRUE);

options.setAction("upLoad");
QName opName = new QName("http://impl.webService.com","upLoad");
Object args[] = {
xmlData //上传的数据
};
Class classes[] = {
java/lang/String
};
results = serviceClient.invokeBlocking(opName,args,classes);
serviceClient.cleanupTransport();


? ? ? ? ? ? 红色标记的代码可以解决描述的问题

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读