I have implemented one SOAP API which wil fetch data from database (It may contain 1 million rec or high..) and write all records into one file and send the file path as soap response.
If data is too high then the time out exception occurs in client side.
I want to make it wait until whole data to be written into the file.
How wil I increase the client timeout?
Data size wil vary according to the request parameters.
So how wil I set the fixed timeout for this particular SOAP API.
waiting for the reply ASAP.
Thanks & Regards
XML & Web services: Send millions of record as soap response for single request..
- Posted by: Jayaseelan Vaiyapuri
- Posted on: August 30 2010 22:58 EDT
Why bother writing to a file, when you can start streaming the results immediately via ServletResponse.getOutputStream()?
... I missed the part about "returning a path to the file".
Your client will have to set the timeout before making the request, as in HttpURLConnection.setConnectionTimeout():
connection = (HttpURLConnection) url.openConnection();
connection.setConnectionTimeout(600*1000); // 10 minutes
Setting the connection timeout to zero will cause it to wait indefinitely.