AXIS2设置超时不起作用

时间:2017-06-13 20:52:33

标签: java timeout axis2

当我尝试将时间更改为我的轴2客户端时,它无法正常工作

documentation

    Options options = new Options();
    options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(timeOutInMilliSeconds));
    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(timeOutInMilliSeconds));

    // or
    options.setTimeOutInMilliSeconds(timeOutInMilliSeconds);

和我的工厂

String urlWS = MyProperties.getProperties().getProperty("infstatus.url");
InformarResultadoAprovWSStub ws = new InformarResultadoAprovWSStub(urlWS);
ws._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
Integer time=Integer.valueOf(MyProperties.getProperties().getProperty("infstatus.timeout"))*60*1000;
Options options = ws._getServiceClient().getOptions(); 
logger.debug("Timeout is "+time);
options.setProperty(HTTPConstants.SO_TIMEOUT, time);
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, time);
return ws;

可以肯定的是,我在调用WS

之前打印了这些值
        logger.debug("Before WS");
        Map<String, Object> mapp = ws._getServiceClient().getOptions().getProperties();
        for(Map.Entry entry:mapp.entrySet()){
            logger.debug(" option "+entry.getKey()+" = ["+String.valueOf(entry.getValue())+"]");
        }

        ws.informar(req);

    } catch (RemoteException e) {
        throw new ServiceDependencyException("Error with WS",e);
    } finally {
        logger.debug("After WS");
    }

我将时间设置为10分钟或600000毫秒,但是在90秒后apsxs将时间提高了

2017-06-13 16:14:44 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG InformaStatusDelegate:53 - Before WS
2017-06-13 16:14:44 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG InformaStatusDelegate:56 -  option __CHUNKED__ = [false]
2017-06-13 16:14:44 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG InformaStatusDelegate:56 -  option SO_TIMEOUT = [600000]
2017-06-13 16:14:44 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG InformaStatusDelegate:56 -  option CONNECTION_TIMEOUT = [600000]

2017-06-13 16:16:08 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG InformaStatusDelegate:64 - After WS

StackTrace

Caused by: org.apache.axis2.AxisFault: Connection timed out: connect
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:216)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
    ... 23 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at ja

客户端是使用Axis2 1.7.5数据绑定方法ADB

创建的

有什么问题?

我也试过

options.setTimeOutInMilliSeconds(timeOutInMilliSeconds);

0 个答案:

没有答案