HTTP transport custom properties for Web services applications


 

+

Search Tips   |   Advanced Search

 

Use HTTP transport properties for JAX-WS and JAX-RPC Web services to...

Establishing a connection is an expensive operation. Connection pooling improves performance by avoiding the overhead of creating and disconnecting connections. When an application invokes a Web service over an HTTP transport, the HTTP outbound connector for the Web service locates and uses an existing connection from a pool of connections.

When the response is received, the connector returns the connection to the connection pool for reuse. The overhead to create and disconnect the connection is avoided.

 

com.ibm.websphere.webservices.http.connectionTimeout

Interval, in seconds, that a connection request times-out and the WebServicesFault( "Connection timed out" ) error occurs.

The value affects all of the HTTP connection requests made by the HTTP outbound connector. The wait time is needed when the maximum number of connections in the connection pool is reached. For example, if the property is set to 300 and the maximum number of connections is reached, the connector waits for 300 seconds until a connection is available. After 300 seconds, the WebServicesFault( "Connection timed out" ) error occurs if a connection is not available. If the property is set to 0 (zero), the connector waits until a connection is available.

If the WebServicesFault( "Connection timed out") error occurs in the application, set the property...

com.ibm.websphere.webservices.http.connectionTimeout

...value higher. Also, review the application usage. If...

com.ibm.websphere.webservices.http.maxConnection

...value is set to 0 (zero), and is enabled for an unlimited number of connections, the property...

com.ibm.websphere.webservices.http.connectionTimeout

...value is ignored.

Data type Integer
Units Seconds
Default 300
Range 0 (zero) to the maximum integer

We can only configure this property as a JVM custom property for Web services applications.

For information about how to configure this property, see Configuring additional HTTP transport properties .

 

com.ibm.websphere.webservices.http.maxConnection

Maximum number of connections that are created in the HTTP outbound connector connection pool.

This property affects all of the Web services HTTP connections that are made within one JVM. When the maximum number of connections is reached, no new connection are created and the HTTP connector waits for a current connection to return to the connection pool. If the HTTP connector does not wait for a current connection because of a connection request timeout, the error occurs...

WebServicesFault( "Connection timed out" )

For example, if the property is set to 5, and there are 5 connections in use, the HTTP connector waits for the specified time set in the property...

com.ibm.websphere.webservices.http.connectionTimeout

...for a connection to become available.

Best practice: For performance reasons, verify the maximum number of threads is equal or greater than twice the value of custom property...

com.ibm.websphere.webservices.http.maxConnection

The default size for the Web container thread pool is 50. As a result, the default size of the property...

com.ibm.websphere.webservices.http.maxConnection

...is set to 25 by the Web services runtime

Data type Integer
Default

25 for JAX-RPC applications

50 for JAX-WS applications

Range 5 to the maximum integer, which is less than or equal to half of the size of Web container thread pool

This property only can be configured as a JVM custom property for Web services applications.

 

com.ibm.websphere.webservices.http.connectionPoolCleanUpTime

Interval, in seconds, between runs of the connection pool maintenance thread.

This property affects all HTTP connections for Web Services made within one JVM. For example, if the property is set to 180, the pool maintenance thread runs every 180 seconds. When the pool maintenance thread runs, the connector discards any connections in the clean up queue.

Data type Integer
Units Seconds
Default 180
Range 0 (zero) to the maximum integer

This property only can be configured as a JVM custom property for Web services applications.

 

com.ibm.websphere.webservices.http.connectionIdleTimeout

Interval, in seconds, after an idle connection is discarded.

The connection is added to the clean up queue only after a new connection is formed. Configure the property only as a JVM custom property. For example, if the property is set to 120, the pool maintenance thread discards any connection that remains idle for 2 minutes. This property affects all Web services HTTP connections made within one JVM.

Data type Integer
Units Seconds
Default 5
Range 0 (zero) to the maximum integer

This property only can be configured as a JVM custom property for Web services applications.

 

com.ibm.websphere.webservices.http.SocketTimeout

Amount of time, in seconds, to wait for the outbound socket to be established with the remote server.

This property affects all Web services HTTP connections made within one JVM. If an invalid value is provided, the default value overrides the invalid value.

Data type Integer
Units Seconds
Default 180

If an invalid value is specified, the default value overrides the invalid value.

Range 0 (zero) to 2147482 (the maximum integer)

This property only can be configured as a JVM custom property for Web services applications.

 

com.ibm.websphere.webservices.http.requestContentEncoding

Type of encoding to use in the message of each HTTP outbound request. It is an HTTP transport property we can configure for Web services applications.

Supported encoding formats follow the HTTP 1.1 protocol specification including gzip, x-gzip, and deflate. If this property is configured, the headers "Content-Encoding" and "Accept-Encoding" in the HTTP request are also set to the same value. For example, if the property is set to gzip, the headers become Content-Encoding: gzip and Accept-Encoding: gzip. However, if the property is not set, the HTTP request message is not encoded. The default is no encoding.

You should check if the target Web server is capable of decoding the configured coding format. For example, if the property is set to gzip, the target Web server must also support the gzip encoding.

Otherwise, a failure can occur and a status code of 415 Unsupported Media Type might display.

The compress encoding format is not supported and x-gzip encoding is equivalent to gzip encoding.

Data type String
Valid values gzip, x-gzip, and deflate

For information about how to configure this property, see...

 

com.ibm.websphere.webservices.http.responseContentEncoding

Type of encoding to be used in the message of each HTTP response. It is an HTTP transport property we can configure for Web services applications.

Supported encoding formats follow the HTTP 1.1 protocol specification including gzip, x-gzip, and deflate. If this property is configured, the headers "Content-Encoding" in the HTTP response is set to the same value. If the property is not set, the HTTP response message content is not encoded. The default value is no encoding.

If the property is set, the request client must also support the same encoding. Otherwise, a failure can occur and a WebServicesFault() error displays.

The compress encoding format is not supported and x-gzip encoding is equivalent to gzip encoding.

Data type String
Valid values gzip, x-gzip, or deflate

For information about how to configure this property, see...

 

com.ibm.websphere.webservices.http.connectionKeepAlive

Whether the connector should maintain a live or persistent HTTP connection. It is an HTTP transport property we can configure for Web services applications.

If the property is set to true, the connector keeps the connection in the connection pool and reuses the connection for subsequent HTTP requests. However, the connection is closed if syncTimeout(Read timeout) is reached or the server has dropped the connection. Also, an idle connection is closed by the pool maintenance thread if the idle time has passed the connection idle time out value. If the property is set to false, the connection is closed after the HTTP request is sent. If a new request is ready to send and the connection does not exist, the HTTP connector creates one.

Data type String
Default True
Valid values True, false

For information about how to configure this property, see...

 

com.ibm.websphere.webservices.http.requestResendEnabled

Tells the HTTP connector to resend the SOAP message over HTTP request after a java.net.ConnectException: read timed out error is logged. It is an HTTP transport property we can configure for Web services applications.

This property tells the HTTP connector to resend the SOAP message over HTTP request after a java.net.ConnectException: read timed out error is logged. The java.net.ConnectException is caused by a socket time out, or when a server shuts down while the request is being sent. If the property is enabled, the connector tries to reconnect one time only and resends the same SOAP message over HTTP. Otherwise, the connector stops sending the SOAP message and a WebServicesFault error is logged.

Problems can occur with the application this property is enabled.

The HTTP request that is resent can be received twice by the server and can cause an unexpected result.

Data type String
Default False
Valid values True, false

For information about how to configure this property, see...

 

com.ibm.ws.webservices.enableHTTPPrefix

Whether the hosthame:port value that is defined as a custom HTTP URL prefix in the Provide HTTP endpoint URL panel in the admin console is populated to the URL field in the copy of the WSDL file that is returned from the service to the client. It is an HTTP transport property we can configure for Web services applications.

Set this property with the value of true so the specified custom HTTP URL prefix is correctly specified in the WSDL file that is returned to the client. If this property is not configured with the value of true, then the specified custom hosthame:port of the server node that responds to the request is not populated in the URL field in the copy of the WSDL file that is returned to the client.

Data type String
Default False
Valid values True, false

This property only can be configured as a JVM custom property for Web services applications.

Restart the appserver after this custom property has been defined so that this property is used by the system.

 

enableMultiThreadedSession

Whether to allow a client to share HTTP session information across threads for the same client instance.

To enable this behavior, configure this property with the value of true by calling the _setProperty method on the client stub. If this property is not enabled, the default behavior is to make sessions local to the thread on which the client was invoked.

Is only applicable for JAX-RPC Web services.

The following code demonstrates how to configure the enableMultiThreadedSession property programmatically:

Properties prop = new Properties();
InitialContext ctx = new InitialContext(prop);
Service service = (Service)ctx.lookup("java:comp/env/service/StockQuoteService");
QName portQname = new QName("http://httpchannel.test.wsfvt.ws.ibm.com", "StockQuoteHttp");
StockQuote sq = (StockQuote)service.getPort(portQname, StockQuote.class);
((javax.xml.rpc.Stub) sq)._setProperty(com.ibm.wsspi.webservices.Constants.ENABLE_MULTITHREADED_SESSION, "true");

Data type Boolean
Default False
Valid values True, false

Restart the appserver after this custom property has been defined so that this property is used by the system.

 

http.proxyHost

Host name of an HTTP proxy.

It is an HTTP transport property we can configure for Web services applications.

Data type String

For information about how to configure this property, see...

 

http.proxyPort

Port of an HTTP proxy. It is an HTTP transport property we can configure for Web services applications.

Data type String

For information about how to configure this property, see...

 

https.proxyHost

Host name of an HTTPS proxy.

It is an HTTP transport property we can configure for Web services applications.

Data type String

For information about how to configure this property, see...

 

https.proxyPort

Port of an HTTPS proxy. It is an HTTP transport property we can configure for Web services applications.

Data type String

For information about how to configure this property, see...

 

http.nonProxyHosts

This JVM system property acts as an override to the http.proxyHost and https.proxyHost properties and specifies the host names of machines to which requests will not be sent through the proxy server. It is an HTTP transport property we can configure for Web services applications.

Any requests invoked by the client application that are sent to a host whose name is contained in this property will not pass through the proxy server. Separate each host name in the list with a vertical bar ("|"). We can optionally use an asterisk (*) as a wildcard character.

The http.nonProxyHosts property applies for both HTTP and HTTPS connections.

In the following example,

http.proxyHost="myproxy.mycompany.com"
http.nonProxyHosts="host1.company1.com|host*.company2.com|*.company3.com"

...all requests will be routed through the proxy server, myproxy.mycompany.com, except for the HTTP requests destined for the following hosts:

Processing the settings for http.nonProxyHosts is performed as pure pattern matching. Host names are not expanded to their fully-qualified form before being matched to the pattern.

For example, with http.nonProxyHosts specified in the above example, the string host1 will not match any of the settings specified, and as such, the Web services engine will send the request through the proxy server. In order for the host1 request to not be sent through the proxy server, the http.nonProxyHosts specification would have to include host1 somewhere in the specification.

An illustration of this spec follows.

http.nonProxyHosts="host1.company1.com|host*.company2.com|*.company3.com|host1"

Best practice: When using a Web services client through a web proxy, it is a best practice to set the http.nonProxyHosts property to include the local host if any Web services are hosted on the same system. For example, if the local host is named myHost.myCorp.com, then set the http.nonProxyHosts property to localhost|myHost.myCorp.com or localhost|*.myCorp.com.

If we do not set the http.nonProxyHosts property to include the local host, then Web services requests made to the local host will go out to the Web proxy and then return back to the local host

Data type String

This property only can be configured as a JVM custom property for Web services applications.

 

timeout

Amount of time, in seconds, before the read time out occurs.

When reading a large Web services message, we might receive WSWS3228E messages along with SocketTimeoutExceptions errors when Web services calls are made.

The value affects all of the HTTP connection requests made by the HTTP inbound connector. Use this read time out property when we are reading large data or at times when the network is slow and it takes more than the default time of 300 seconds to read the data. If SocketTimeoutExceptions errors occur when the message is read, increase the value of the timeout property.

Data type Integer
Units Seconds
Default 300
Range 0 (zero) to the maximum integer

Configure this property as a JVM custom property for Web services applications.

For JAX-WS applications, we can also configure this property by customizing the HTTP transport policy or by using JAX-WS bindings.

See:

 

write_timeout

Length of time, in seconds, for the write to time out action to occur when a message is sent.

When writing a large Web services message, we might receive WSWS3228E messages along with SocketTimeoutExceptions errors when Web services calls are made.

The value affects all of the HTTP connection requests made by the HTTP outbound connector. Use this write time out property when we are sending large amounts of data or at times when the network is slow and it takes more than the default time of 300 seconds to write the data. If the SocketTimeoutExceptions errors occur when the message is written, increase the value of the write_timeout property.

Data type Integer
Units Seconds
Default 300
Range 0 (zero) to the maximum integer

Configure this property as a JVM custom property for Web services applications.

For JAX-WS applications, we can also configure this property by customizing the HTTP transport policy or by using JAX-WS bindings.



 

Related tasks

Secure Web services applications at the transport level
Set additional HTTP transport properties using the wsadmin command-line tool
Set additional HTTP transport properties for JAX-RPC Web services with an assembly tool
Set additional HTTP transport properties using the JVM custom property panel in the admin console
Set the HTTP transport policy
Set endpoint URL information for HTTP bindings

 

Related

HTTPTransport policy and binding properties
Java virtual machine custom properties