title: How to set a timeout to a SOAP call
body: <p>I need to set a timeout to a SOAP call using javax.xml.soap over HTTPS
  However I don't know how to do that, there must be a trick to do it but I could not find it.</p>
  
  <pre><code>SOAPMessage sm = null;
  SOAPMessage response = null;
  
  SOAPConnectionFactory sfc = SOAPConnectionFactory.newInstance();
  SOAPConnection connection = sfc.createConnection();
  
  MessageFactory mf = MessageFactory.newInstance();
  sm = mf.createMessage();
  ...
  ...
  URL url = new URL("https://server:XXXX/blablabla);
  response = connection.call(sm, url);
  </code></pre>
  
  <p>I saw someone doing:</p>
  
  <pre><code>if (xxxSoapService instanceof Stub)
              ((Stub) xxxSoapService).setTimeout(10000);
  </code></pre>
  
  <p>xxxSoapService extends java.rmi.Remote and Stub is from import org.apache.axis.client.Stub;</p>
  
  <p>There is probably something I am missing there.</p>