xfire 客户端超时设置不起作用

代码如下
service = (T) new XFireProxyFactory().create(serviceModel, url);
       
int TIMEOUT = 10000;

HttpClientParams params = new HttpClientParams();
params
        .setParameter(HttpClientParams.USE_EXPECT_CONTINUE,
                Boolean.FALSE);

params.setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT,
        Long.parseLong(TIMEOUT+""));
params.setParameter(HttpClientParams.SO_TIMEOUT, TIMEOUT);

Client client = Client.getInstance(service);

client.setTimeout(TIMEOUT);
client.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS, params);
client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, TIMEOUT+"");
client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE,
        "true");
client.setProperty(CommonsHttpMessageSender.DISABLE_KEEP_ALIVE, "true");

但是 超时不起作用

页面上仍然长时间的载入中 且控制台日志如下:

2011-01-24 15:55:11,361 INFO  [HttpMethodDirector.java:434] : I/O exception caught when processing request: Connection timed out
2011-01-24 15:55:11,362 INFO  [HttpMethodDirector.java:440] : Retrying request
2011-01-24 15:58:20,350 INFO  [HttpMethodDirector.java:434] : I/O exception caught when processing request: Connection timed out
2011-01-24 15:58:20,351 INFO  [HttpMethodDirector.java:440] : Retrying request
2011-01-24 16:01:29,338 INFO  [HttpMethodDirector.java:434] : I/O exception caught when processing request: Connection timed out
2011-01-24 16:01:29,339 INFO  [HttpMethodDirector.java:440] : Retrying request
2011-01-24 16:04:38,327 ERROR [HttpChannel.java:144] : java.net.ConnectException: Connection timed out
org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn't send message.
org.codehaus.xfire.fault.XFireFault: Couldn't send message.


似乎隔三分钟 就去连接一下 第四次终于放弃了

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值