Vadzim
Vadzim

Reputation: 26160

Separate connect and read timeouts for JBossWS

Can anyone give a hint how to set separate connect and read timeouts when calling external webservice from JBossWS-Native client?

All I've found so far is how to set a single timeout:

bindingProvider.getRequestContext().put("org.jboss.ws.timeout", 1000);

The same question (unanswered for a long time) on JBoss forum: http://community.jboss.org/thread/103582

Vesions in use: jbossws-native-2.0.1.SP2 and jbossws-native-3.1.1.GA on JBoss 4.2.x.

Upvotes: 1

Views: 3039

Answers (1)

Vadzim
Vadzim

Reputation: 26160

Examined the source - it's not possible at all. There's single timeout.

Went to jbossws jira willing to file a feature request. But found JBWS-3114 and this message:

I've added this two properties "javax.xml.ws.client.connectionTimeout", "javax.xml.ws.client.receiveTimeout" to cxf and native stack for the stack agnostic timeout configuration:

public void testConfigureTimeout() throws Exception   
{ 
  //Set timeout until a connection is established 
  ((BindingProvider) port).getRequestContext().
          put("javax.xml.ws.client.connectionTimeout", "6000");
  //Set timeout until the response is received       
  ((BindingProvider) port).getRequestContext().
          put("javax.xml.ws.client.receiveTimeout", "1000"); 
   String response = port.echo("testTimeout"); 
   System.out.prinltn("Received response : response");  
}

This should be included in the 3.4.0 release.

Rechecked the source - it's there!

Unfortunately, according to compatibility matrix, jbossws-3.4.0 is supported only since JBoss AS 5.0.1.

Upvotes: 2

Related Questions