title: Setting socket read timeout with javax.xml.soap.SOAPConnection
body: <p>I am using the <code>javax.xml.soap</code> API (<code>javax.xml.soap.SOAPConnectionFactory</code>, <code>javax.xml.soap.SOAPConnection</code>, and friends) to make a web service call to a remote server, for the most part with great success.</p>
  
  <p>However, sometimes there is a problem and the program gets stuck reading forever.</p>
  
  <p>To address this, I'd like to add a read timeout.</p>
  
  <p>I found several ways it might be possible to achieve this, but they all seemed pretty bad.</p>
  
  <p>So my question to the community is: What is the best way to implement a read timeout behaviour when using the javax.xml.soap API to make a call?</p>