JAX-WS timeout properties

You can set timeout properties that configure how long Java™ API for XML-Based Web Services (JAX-WS) clients wait to read response messages, send request messages, and make connections. The timeout properties can be set in various levels of the application server for JAX-WS applications.

Timeout properties can be configured with policy sets, on the org.apache.axis2.context.MessageContext, and the Java virtual machine (JVM). This order of precedence is how the web services runtime environment reads the properties. For example, if the write timeout were set in both the policy set and on the JVM, the runtime environment uses the property value in the policy file and ignore the JVM property.

The following tables outline the read, write, and connection timeout properties. Unlike a Java API for XML-based RPC (JAX-RPC) client, timeout properties for JAX-WS clients must not be set on the client binding file, as the runtime environment ignores timeout properties set this way. The read and write timeouts are transport level timeouts that start when writing the request on the wire. The write timeout stops when the request is written. The read timeout includes time spent within the provider and stops when the response is read from the wire. The timeouts do not include the time for web services to marshal or unmarshal the request and response. These timeouts also do not take into account any time required to setup the connection.

Policy set timeout properties

The following timeout properties can be set via policy sets. The web services runtime environment honors timeout properties set at the policy set level as the highest precedence. Valid values for the timeout properties are integers, representing seconds.

Java constant name Literal name Default value
com.ibm.ws.websvcs.transport.common.TransportConstants.READ_TIMEOUT readTimeout 300
com.ibm.ws.websvcs.transport.common.TransportConstants.WRITE_TIMEOUT writeTimeout 300
com.ibm.ws.websvcs.transport.common.TransportConstants.CONN_TIMEOUT connectTimeout 180

MessageContext timeout properties

The following timeout properties can be set on the MessageContext. The web services runtime environment honors timeout properties set on the MessageContext only if the equivalent timeout properties have not also been set via policy sets. Valid values for the timeout properties are integers, representing seconds.

Java constant name Literal name Default value
com.ibm.wsspi.webservices.Constants.RESPONSE_TIMEOUT_PROPERTY timeout 300
com.ibm.wsspi.websvcs.Constants.WRITE_TIMEOUT_PROPERTY write_timeout 300
com.ibm.wsspi.websvcs.Constants.CONNECTION_TIMEOUT_PROPERTY connection_timeout 180

JVM timeout properties

The following timeout properties can be set on the JVM. The web services runtime environment honors timeout properties set on the JVM only if the equivalent timeout properties have not also been set via policy sets or on the MessageContext. Valid values for the timeout properties are integers, representing seconds.

Note: Use the property RESPONSE_TIMEOUT_PROPERTY to specify how long to wait for a response. The wait time applies to any response related action. The wait time for the response begins immediately after completion of the write operation.
Java constant name Literal name Default value
com.ibm.wsspi.webservices.Constants.RESPONSE_TIMEOUT_PROPERTY timeout 300
com.ibm.wsspi.webservices.Constants.WRITE_TIMEOUT_PROPERTY write_timeout 300
com.ibm.ws.websvcs.transport.http.WSHTTPConstants.HTTP_SOCKET_CONNECTION_TIMEOUT com.ibm.websphere.webservices.http.SocketTimeout 180