Long-Running SOAP Request Support

From ServiceNow Wiki
Home > Integrate > Web Services > SOAP Web Services > Long-Running SOAP Request Support
Jump to: navigation, search
Web Services


1 Overview

The ServiceNow platform supports long-running SOAP requests by preventing socket timeouts due to inactivity of the network connection while the requests are in process. This functionality improves the efficiency of the ODBC driver when requesting large numbers of records, doing aggregate queries, or using order by expressions that require sorting.

By default, ServiceNow provides timeout protection for Web Services clients provided by ServiceNow such as the ODBC driver and the MID Server. You can add time timeout protection to customer developed Web Services with the parameters described below.

2 Timeout Protection

Web Services clients receive a 307-Temporary Redirect to keep long sessions alive and prevent a timeout due to socket inactivity. A 307-Temporary Redirect causes Web Services clients which support the status code to repeat their last request to the location specified in the HTTP location header. The value of the location header sent by ServiceNow is the same URL that the Web Services client originally specified. The use of 307-Temporary Redirects is WS-I compliant.

A Web Service request that exceeds the timeout limit (glide.soap.request_processing_timeout) can only receive a 307-Temporary Redirect when all of these are met:

  • The value of glide.soapprocessor.allow_long_running_threads is true
  • The request includes a redirectSupported=true URL parameter
  • The Request is session-aware (supports HTTP cookies)

If any of these conditions is not met, the Web Service client receives a 408 Request Timeout error.

Note
Note: To ensure that applications experience a socket timeout rather than a 408 Request Timeout, set the glide_soap_request_processing_timeout property to a value larger than the shortest socket timeout setting in effect for the connection between the application and the ServiceNow instance (300 seconds for hosted instances).


2.1 Properties

The following properties control long-running SOAP processes:

Property Description
glide.http.connection_timeout Specify the maximum number of milliseconds an outbound HTTP request (such as Web Services) has to finish processing before the connection times out.
  • Type: integer
  • Default value: 100000 (100 seconds)
  • Location: Add to the System Properties [sys_properties] table
glide.http.timeout (Web Service Consumer Plugin) Specifies the maximum number of milliseconds to wait before an outbound transaction times out.
  • Type: integer
  • Default value: 175000 (175 seconds)
  • Location: Add to the System Properties [sys_properties] table
glide.soap.request_processing_timeout Specify the maximum number of seconds an inbound SOAP request has to finish processing before the connection times out. If undefined, this property computes a default value from the value of the property glide.http.timeout divided by 1000. You might have network infrastructure, such as proxy servers, which implement a shorter timeout. In this case, a socket timeout may occur unless this property is set to a shorter value. In general, you should set this property to a value several seconds less than the shortest socket inactivity timeout in effect anywhere in the network path between the client application and the ServiceNow instance.
  • Type: integer
  • Default value: 60 for new instances starting on the Fuji release. 175 prior to Fuji.
  • Location: System Property [sys_properties] table
glide.soapprocessor.allow_long_running_threads Enables or disables a 307-Temporary Redirect. The default setting is true (enabled).
glide.soapprocessor.max_long_running_threads Controls the maximum number of long-running SOAP threads which can run at any one time. The default value for this property is determined dynamically based on the number of SOAP semaphores configured. It should not be necessary to change this value.
Was this article helpful?
Yes, I found what I needed
No, I need more assistance