IBM Support

Setting the timeout value for a JAX-RPC Web Service client

Technote (troubleshooting)


Sometimes it is necessary to control how long a Web Service client waits for a response after sending a request. This document discusses Java API for XML-based Remote Procedure Call (JAX-RPC) clients only and not SOAP with Attachments API for Java (SAAJ) or Dynamic Invocation Interface (DII) clients.


In IBM WebSphere Application Server Version the following error occurs if a JAX-RPC Web service client times out: Socket operation timed out before it could be completed

Resolving the problem

For a JSR 109-compliant JAX-RPC client, there are Web service client deployment descriptors that are packaged with the application. Specifically, the ibm-webservicesclient-bnd.xmi deployment descriptor is used to control the client timeout. This deployment descriptor has a syncTimeout property. The default for this timeout value is 5 seconds. To set the syncTimeout property, see the following directions in the product documentation for WebSphere Application Server:

Configuring the JAX-RPC web services client bindings in the ibm-webservicesclient-bnd.xmi deployment descriptor

Some JAX-RPC clients do not have this deployment descriptor. These clients are not JSR 109-compliant. You can alternatively set the timeout value on the stub using the setTimeout method. Here is sample code to set the timeout value on a stub:

package mypackage;

public class J2SEClient {
public static void main(String[] args) {
HelloWorldServiceLocator hwsl = new HelloWorldServiceLocator();
HelloWorld hw = hwsl.getHelloWorld();
((Stub) hw).setTimeout(60000);
catch(Exception e)

In the previous sample code, the parameter for the setTimeout method is the number of milliseconds the client should wait for a response from the provider.

To ensure that this timeout is set properly in WebSphere Application Server V6.0, the following trace specification can be used:*=all

In the trace, the HttpOutboundChannelConnection class will output the following:

WSWS3494I: syncTimeout value is 420 seconds to wait for response to the current SOAP over HTTP request.


  • The operating system timeouts might cause the connection to time out before the syncTimeout length.
  • Setting the time-out to 0 will prevent the readTimeout from happening (for example, the client will not time out)
  • If the timeout is less than 1000 milliseconds, WebSphere JAX-RPC Web Services engine we will treat it as an invalid timeout setting and try to convert its to timeout*1000.
  • WebSphere JAX-RPC Web Services engine does not support to set the timeout less than 1000 milliseconds.

Cross reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK

Document information

More support for: WebSphere Application Server
Web Services (for example: SOAP or UDDI or WSGW or WSIF)

Software version: 6.0, 6.1, 7.0, 8.0, 8.5, 8.5.5

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Software edition: Base, Network Deployment

Reference #: 1224016

Modified date: 13 October 2006

Translate this page: