How do I set a timeout when using WSDL2Java stubs?    There is a setTimeout method on the org.apache.axis.client.Stub class, which is the class all emitted stubs extend.    Here is how to set the timeout given a service named Foo:     FooServiceLocator loc = new FooServiceLocator();
     FooService binding = loc.getFooService();
     org.apache.axis.client.Stub s = (Stub) binding;
     s.setTimeout(1000);  // 1 second, in miliseconds
         The default timeout in Axis 1.1 and later is 60 seconds. Axis 1.0 did not have a default timeout (i.e. it defaulted to 0). This timeout value is set on the HTTP socket and is not a connection timeout, which requires implementation we do not have as of Axis 1.1.
根据经验,你的设置的长一点

解决方案 »

  1.   

    我的问题同上,老紫竹帮下忙,我的应该是接收数据时超时,不是http连接超时
      

  2.   

    我用的axis1.4,我出现的问题是:不设置timeout能够正常返回值,但是需要5分钟左右时间。之前设置了timeout位15秒,一直报上面的错误,以为是代码有问题调用不成功。经过调试,发现问题在org.apache.axis.encoding.DeserializationContext中的方法parse()的parser.parse(inputSource, this);执行了很长时间,不知道是什么原因。(执行parse()已经调用了web service)
    请大虾指教。