Hi All,
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
Jayaseelan.
-
Send millions of record as soap response for single request.. (2 messages)
- Posted by: Jayaseelan Vaiyapuri
- Posted on: August 30 2010 22:58 EDT
Threaded Messages (2)
- Don't write to the file by Drew Liscomb on September 14 2010 15:51 EDT
- whoops... sorry by Drew Liscomb on September 14 2010 16:07 EDT
-
Don't write to the file[ Go to top ]
- Posted by: Drew Liscomb
- Posted on: September 14 2010 15:51 EDT
- in response to Jayaseelan Vaiyapuri
Why bother writing to a file, when you can start streaming the results immediately via ServletResponse.getOutputStream()?
-
whoops... sorry[ Go to top ]
- Posted by: Drew Liscomb
- Posted on: September 14 2010 16:07 EDT
- in response to Drew Liscomb
... 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.setRequestProperty("Content-Type", "text/xml");
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setConnectionTimeout(600*1000); // 10 minutes
connection.setDoInput(true);
connection.connect();
Setting the connection timeout to zero will cause it to wait indefinitely.