为jax-ws客户端设置连接超时

问题描述:

我正在尝试为jax-ws-webservice-client设置连接超时。 当部署在Glassfish的应用程序,它没有采取通过设置超时:为jax-ws客户端设置连接超时

((BindingProvider) port).getRequestContext().put(BindingProviderProperties.CONNECT_TIMEOUT, timeoutInMillisecs); 

我设置timeoutInMillisecs至60000但我发现了一个连接的time out异常约30秒。

有人能帮助我吗?

尝试设置JAXWSProperties.REQUEST_TIMEOUT为值timeoutInMillisecs(参见How to define connection and request timeouts for the client?)。