riftsaw SVN: r1360 - trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-04-21 12:47:30 -0400 (Thu, 21 Apr 2011)
New Revision: 1360
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
Log:
RIFTSAW-376 - added timeout property, but only used for jbossws-native/cxf 3.4.0.GA or above.
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2011-04-21 10:11:16 UTC (rev 1359)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2011-04-21 16:47:30 UTC (rev 1360)
@@ -46,6 +46,7 @@
import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.Scheduler;
import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.Properties;
import org.jboss.soa.bpel.runtime.engine.EndpointReference;
import org.jboss.soa.bpel.runtime.engine.PartnerChannel;
import org.jboss.soa.bpel.runtime.engine.ode.BPELEngineImpl;
@@ -96,6 +97,8 @@
private ExecutionEnvironment executionEnvironment;
private java.net.URI baseURI;
+ private long timeout=Properties.DEFAULT_MEX_TIMEOUT;
+
public WebServiceClient(EndpointMetaData metaData, ExecutionEnvironment env,
BPELEngineImpl engine, ProcessConf pconf)
{
@@ -110,6 +113,17 @@
this.baseURI = pconf.getBaseURI();
log.debug("Web Service Client: Base URI="+pconf.getBaseURI());
+
+ String mextimeout = pconf.getEndpointProperties(serviceName, metaData.getPortName()).get(Properties.PROP_MEX_TIMEOUT);
+
+ if (mextimeout != null) {
+ try {
+ this.timeout = Long.parseLong(mextimeout);
+ log.debug("Web Service Client: Timeout="+timeout);
+ } catch (NumberFormatException e) {
+ if(log.isWarnEnabled()) log.warn("Mal-formatted Property: ["+ Properties.PROP_MEX_TIMEOUT+"="+mextimeout+"] Default value ("+Properties.DEFAULT_MEX_TIMEOUT+") will be used");
+ }
+ }
}
private synchronized void initialize() {
@@ -284,6 +298,9 @@
} else if (log.isDebugEnabled()) {
log.debug("SOAPAction not set");
}
+
+ // Set client side timeout for the invocation
+ proxy.getRequestContext().put("javax.xml.ws.client.receiveTimeout", Long.toString(timeout));
SOAPMessage soapResponseMessage = (SOAPMessage)proxy.invoke(soapRequestMessage);