SocketTimeoutException when calling a web service
 Technote (troubleshooting)
 
Problem(Abstract)
A client makes a call to a Web Service that takes more than 5 minutes (300 seconds) to respond. The client receives the following exception when the timeout is exceeded:

[1/31/06 23:56:41:672 CST] 56457dda enterprise I com.ibm.ws.webservices.engine.enterprise TRAS0014I: The following exception was logged WebServicesFault
faultCode: Server.generalException
faultString: java.net.SocketTimeoutException: Read timed out
faultActor: null
faultDetail:

java.net.SocketTimeoutException: Read timed out
 
Cause
A Web Service client using the IBM® WebServices engine has a default synchronization (request) timeout of 5 minutes. If the target service does not respond within this time period, the client receives the java.net.SocketTimoutException
 
Resolving the problem
For versions 5 and 5.1, the timeout should be set during development using WebSphere® Studio Application Developer, Rational® Application Developer, or post-development using ASTK. The following URLs contain instructions on how to modify the SyncTimeout property (Step 10 in the instructions) using this approach:


V5.0

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/topic/
com.ibm.websphere.base.doc/info/aes/ae/twbs_configibmclientdd.html

V5.1
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1/topic/
com.ibm.websphere.base.doc/info/aes/ae/twbs_configibmclientdd.html

V6.0
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/
com.ibm.websphere.base.doc/info/aes/ae/twbs_configibmclientdd.html

In V6, you have the option of modifying the SyncTimeout property through the Administrative Console or through wsadmin after the application has been deployed. You can still set the timeout in the tooling, but this gives the Administrator the flexibility of changing the value without having to edit the EAR file:

Administrative Console V6.0

1) Select Applications -> Enterprise Applications -> <APP_NAME> -> Web Modules -> <WS_WEB_MODULE> -> Web Services Client Bindings

2) Click "Edit..." under Port Information

3) From this page, you can set the Request Timeout (SyncTimeout) to any value in seconds

4) Click OK and Save changes

Note: Saving the changes restarts the application

Wsadmin v6.0

1) Start Wsadmin and issue the following commands:

wsadmin>$AdminApp edit <APP_NAME> {-WebServicesClientBindPortInfo {{<MODULE_NAME> <EJB_MODULE_NAME> <SERVICE_NAME> <PORT_NAME> <TIMEOUT_VALUE>}}}
wsadmin>$AdminConfig save

Note: If you are using a web client, you can omit the <EJB_MODULE_NAME> parameter by passing {} in its place.

For more information on using Wsadmin, see the link below:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/
com.ibm.websphere.nd.doc/info/ae/ae/rxml_commandline.html

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


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Web Services (for example: SOAP or UDDI or WSGW or WSIF)
Operating system(s): Windows
Software version: 6.0
Software edition:
Reference #: 1231500
IBM Group: Software Group
Modified date: Sep 14, 2007