Aller au contenu | Aller au menu | Aller à la recherche


AXIS Timeout

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

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

Fil des commentaires de ce billet