Let's go

Java WebService调用相关

1、出现错误【javax.xml.ws.WebServiceException: Could not send Message.】

 https://www.iteye.com/blog/thewangzl-2326075

设置调用超时(这儿WebService采用的wsdl2java命令生成的客户端代理)

AccessService factory =new AccessService();
AccessServicePortType s=factory.getAccessServiceHttpPort();

//设置超时 2024-06-12 待测试
((BindingProvider) s).getRequestContext().put("javax.xml.ws.client.connectionTimeout", 1200 * 1000);//设置连接超时 20min
((BindingProvider) s).getRequestContext().put("javax.xml.ws.client.receiveTimeout", 1200 * 1000);//设置响应超时 20min

String rst=s.uploadData(str);

...

posted @ 2024-08-08 11:44  chenze  阅读(63)  评论(0编辑  收藏  举报
有事您Q我