Specifying a timeout for a web service

The timeout property is used to specify the amount of time to wait for a web service response when invoking an outbound request.

Important: As with other customization changes, do not modify the 99Local.xml file directly. Instead, use the appropriate 100Custom.xml file to your topology to override the default settings. For information, see Creating a 100Custom.xml configuration file. For more information about the location of the 100Custom.xml file that must be updated, see the topic Location of 100Custom configuration files.

The timeout property specifies the maximum time (in seconds) to wait for a response to be returned. The value minus one (-1) is the default value. The -1 value causes the property to be ignored, and the underlying web service engine's default value of 300 seconds will be used for the request timeout.

If the system does not respond in the required time, an exception is generated and the request fails.

Specify a value that is reasonable for your web service application. If the timeout value is set to an unrealistically short time, an exception might result even in a case where the web service invocation is successful. If the timeout value is set excessively long, performance might suffer because the system will be waiting too long before generating an exception.

The 99Local.xml stanza for the timeout property looks like this example:
<--Timeout in seconds to wait when invoking WebService using SOAPConnector. 
   Use -1 to disable. -->
<server>
   <webservices>
      <timeout merge="replace">-1</timeout>
   </webservices>
</server>

Controlling the timeout for loading a web service's WSDL definition

The WSDL definition is loaded during discovery of a web service and in some situations during runtime. You can control the connection and socket timeout of the loading of the WSDL definition by setting enable-wsdl-discovery-timeouts.
  • Use the value -1 to use the default of the underlying infrastructure.
  • Use the value 0 to disable the timeouts.
  • Use a positive integer to specify a timeout in milliseconds.
<server>
   <webservices>   
      <enable-wsdl-discovery-timeouts merge="replace">-1</enable-wsdl-discovery-timeouts>
   </webservices>
</server>