title: Altering the timeout setting of an Axis 1.4 generated SOAP Java client
body: <p>I have a problem with changing the standard options used by an Axis 1.4 generated web service client code.
  We consume a certain web service of a partner who is using the old RPC/Encoded style, which basically means we're not able to go for Axis 2 but are limited to Axis 1.4.</p>
  
  <p>The service client is retrieving data from the remote server through our proxy which actually runs quite nicely.</p>
  
  <p>Our application is deployed as a servlet. The retrieved response of the foreign web service is inserted into a (XML) document we provide to our internal systems/CMS.
  But if the external service is not responding - which didn't happen yet but might happen at anytime - we want to degrade nicely and return our produced XML document without the calculated web service information within a resonable time.
  The data retrieved is optional (if this specific calculation is missing it isn't a big issue at all).</p>
  
  <p>So I tried to change the timeout settings. I did apply/use all methods and keys I could find in the documentation of axis to alter the connection and socket timeouts by searching the web.
  None of these seems to influence the connection timeouts.</p>
  
  <p>Can anyone give me advice how to alter the settings for an axis stub/service/port based on version 1.4?</p>
  
  <p>Here's an example for the several configurations I tried:</p>
  
  <pre><code>MyService service = new MyServiceLocator();
  MyServicePort port = null;
  
  try {
      port = service.getMyServicePort();
      javax.xml.rpc.Stub stub = (javax.xml.rpc.Stub) port;
      stub._setProperty("axis.connection.timeout", 10);
      stub._setProperty(org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, 10);
      stub._setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, 10);
      stub._setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY, 10);
  
      AxisProperties.setProperty("axis.connection.timeout", "10");
      AxisProperties.setProperty(org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, "10");
      AxisProperties.setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, "10");
      AxisProperties.setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY, "10");
  
      logger.error(AxisProperties.getProperties());
  
      service = new MyClimateServiceLocator();
      port = service.getMyServicePort();
  }
  </code></pre>
  
  <p>I assigned the property changes before the generation of the service and after, I set the properties during initialisation, I tried several other timeout keys I found, ...
  I think I'm getting mad about that and start to forget what I tried already!</p>
  
  <p>What am I doing wrong? I mean there must be an option, mustn't it?</p>
  
  <p>If I don't find a proper solution I thought about setting up a synchronized thread with a timeout within our code which actually feels quite awkward and somehow silly.
  Can you imagine anything else?</p>
  
  <p>Thanks in advance</p>
  
  <p>Jens</p>
  
  <hr>
  
  <p>axis1.4 java client soap wsdl2java rpc/encoded xml servlet generated alter change setup stub timeout connection socket keys methods </p>