AXIS Timeout
Par PlaceOweb le dimanche, novembre 30 2008, 13:33 - JAVA - Lien permanent
Configuration du timeout pour Axis
// http://ws.apache.org/axis/faq.html#faq17 // The default timeout in Axis 1.1 and later is 60 seconds. Axis 1.0 did not have a default timeout (i.e. it defaulted to 0). This timeout value is set on the HTTP socket and is not a connection timeout, which requires implementation we do not have as of Axis 1.1. // http://ws.apache.org/axis/java/apiDocs/org/apache/axis/client/Call.html#CONNECTION_TIMEOUT_PROPERTY // TIMEOUT - Timeout used by transport sender in milliseconds // // int timeOut = 150 * 1000; // 150s * 1000ms = 2.5min // // Solution 1 : javax.xml.rpc.Stub s = ((javax.xml.rpc.Stub) clientWs.getCreerWs()); s._setProperty(org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, timeOut); // "axis.connection.timeout" // ou // Solution 2 : org.apache.axis.client.Stub sAxis = ((org.apache.axis.client.Stub) clientWs.getCreerWs()); sAxis.setTimeout(timeOut ); // // Voir aussi : // System.setProperty("sun.net.client.defaultConnectTimeout", "3000"); // System.setProperty("sun.net.client.defaultReadTimeout", "10000"); // org.apache.axis.Constants // http://grepcode.com/file/repo1.maven.org/maven2/axis/axis/1.4/org/apache/axis/Constants.java // public static final int DEFAULT_MESSAGE_TIMEOUT = 60*1000*10; // 10min - The default timeout for messages. // org.apache.axis.client.Call // http://grepcode.com/file/repo1.maven.org/maven2/axis/axis/1.4/org/apache/axis/client/Call.java // public static final String CONNECTION_TIMEOUT_PROPERTY = "axis.connection.timeout"; // org.apache.axis.components.net.DefaultSocketFactory // http://grepcode.com/file/repo1.maven.org/maven2/axis/axis/1.4/org/apache/axis/components/net/DefaultSocketFactory.java/ // org.apache.axis.components.net.DefaultSocketFactory.CONNECT_TIMEOUT = "axis.client.connect.timeout"; // java.net.Socket // http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/net/Socket.java#Socket// // Connects this socket to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs. // Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.
Ressources
- How do I set a timeout when using WSDL2Java stubs?
- org.apache.axis Constant Field Values
- org.apache.axis.Constants.DEFAULT_MESSAGE_TIMEOUT = 600000
- The default timeout for messages.
- org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY = "axis.connection.timeout"
- Timeout property: should be accompanies by an integer
- org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY = "axis.http.client.connection.default.connection.timeout"
- the key for the Axis Property that sets the default connection timeout for the httpclient, can be overriden by the MessageContext
- org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY = "axis.http.client.connection.default.so.timeout"
- the key for the Axis Property that sets the read timeout for the httpclient
- org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_POOL_TIMEOUT_KEY = "axis.http.client.connection.pool.timeout"
- the key for the Axis Property that sets the connection pool timeout for the httpclient pool
- org.apache.axis.Constants.DEFAULT_MESSAGE_TIMEOUT = 600000
- org.apache.axis.Constants et code source : org.apache.axis.Constants
- public static final int DEFAULT_MESSAGE_TIMEOUT = 60*1000*10; // 10min - The default timeout for messages.
- org.apache.axis.client.Call et code source : org.apache.axis.client.Call
- public static final String CONNECTION_TIMEOUT_PROPERTY = "axis.connection.timeout";
- org.apache.axis.components.net.DefaultSocketFactory et code source : org.apache.axis.components.net.DefaultSocketFactory
- org.apache.axis.components.net.DefaultSocketFactory.CONNECT_TIMEOUT = "axis.client.connect.timeout";
- java.net.Socket et code source : java.net.Socket
- Connects this socket to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.
- Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.
- org.apache.commons.httpclient.params.HttpConnectionParams
- CONNECTION_TIMEOUT Determines the timeout until a connection is etablished. (Détermine le délai d'attente jusqu'à ce qu'une connexion est établie.)
- SO_TIMEOUT Defines the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. (Définit le délai d'attente socket par défaut (SO_TIMEOUT) en millisecondes, ce qui est le délai d'attente pour les données.)