title: Setting Timeout for Axis SOAP Webservice
body: <p>I'm using an Axis 1.4 webservice like this:</p>
  
  <pre><code>FooServiceLocator fooLocator = new FooServiceLocator();
  fooLocator.getEngine().setOption("sendMultiRefs", false);
  Foo foo = fooLocator.getFooService(new URL(soapServiceUrl));
  </code></pre>
  
  <p>How can I set a timeout for the connection establishment and for the opened connection?
  (Similar to <code>org.apache.commons.net.SocketClient</code> <code>setTimeout()</code> and <code>setSoTimeout()</code>)?</p>
  
  <p>I found a hint that suggested setting a timeout like this:</p>
  
  <pre><code>((Stub) sPcspService).setTimeout(soapTimeoutSecs * 1000);
  </code></pre>
  
  <p>but the explicit cast looks more like a hack than on official API usage.</p>
  
  <p>Grepping the source code I found references to </p>
  
  <blockquote>
    <p><code>DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY</code></p>
  </blockquote>
  
  <p>but neither do I know if I use the <code>Commons HTTP Client</code> or another, nor how to apply this option.</p>