微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

webservice 报错 提示超时错误

应用场景:

电子称 上传数据到电子称监控软件上,监控软件(该监控软件不能直接访问域名,奇怪!)调用 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");
Sy@R_404[email protected](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();


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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐