您的位置:首页 > 其它

Xfire开发的webservice客户端超时问题解决

2010-06-12 10:22 537 查看
最近某电信ISAG升级后我们的客户端出现大量超时提示,并且下发很慢[MeChannelGw]2010-06-10 06:00:05 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request[MeChannelGw]2010-06-10 06:00:08 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request[MeChannelGw]2010-06-10 06:00:11 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request[MeChannelGw]2010-06-10 06:00:14 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request[MeChannelGw]2010-06-10 06:00:17 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request每隔3-4秒才下发一次数据。
曾以为是对方服务器问题,网络的问题等等,就是换台机器部署,还是会有这个问题。实际,上因为Xfire默认的机制下,会不断的去和服务端握手造成的。 调用下面的代码即可解决问题。

//----------
HttpClientParams params = new HttpClientParams();
params.setParameter(HttpClientParams.USE_EXPECT_CONTINUE,Boolean.FALSE);
params.setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, 10*1000L);
Client.getInstance(service).setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS,params);
//------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: