Setting Connection and Read time outs for SOAPConnection
Below is the code I am using to connect to a web service. I need to set connection timeout and read timeout for the SOAP Connection. I have the solution with using system properties. But my project demands the solution without using system properties. I have gone through google and found the below page
http://forums.sun.com/thread.jspa?threadID=5117465&messageID=9404850
which is useful but I am confused to implement. So help me out in solving this issue.
protected SOAPMessage sendSOAPRequest(SOAPMessage message, String recipient) throws Exception {
URL urlEndpoint = new URL(recipient);
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection con = scf.createConnection();
SOAPMessage replyMessage = con.call(message, urlEndpoint);
return replyMessage;
}