I am using the javax.xml.soap
API (javax.xml.soap.SOAPConnectionFactory
, javax.xml.soap.SOAPConnection
, and friends) to make a web service call to a remote server, for the most part with great success.
However, sometimes there is a problem and the program gets stuck reading forever.
To address this, I'd like to add a read timeout.
I found several ways it might be possible to achieve this, but they all seemed pretty bad.
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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…