Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes Webservice timeouts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice timeouts" Watch "Webservice timeouts" New topic
Author

Webservice timeouts

John Dalenson
Greenhorn

Joined: Feb 07, 2012
Posts: 8

Hi All,
I have a web-service to download a file. I am setting the timeouts like the following, but I think they are not working. I set very small value to request timeout and the webservice was downloading a huge document for long time without timing out.

How can test connect and request timeout?

port.getRequestContext().put("com.sun.xml.internal.ws.request.timeout", webserviceInfoProperties.getProperty("request_timeout")); // Timeout in millis
port.getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", webserviceInfoProperties.getProperty("connect_timeout"));

Thanks.
John Dalenson
Greenhorn

Joined: Feb 07, 2012
Posts: 8

John Dalenson wrote:Hi All,
I have a web-service to download a file. I am setting the timeouts like the following, but I think they are not working. I set very small value to request timeout and the webservice was downloading a huge document for long time without timing out.

How can test connect and request timeout?

port.getRequestContext().put("com.sun.xml.internal.ws.request.timeout", webserviceInfoProperties.getProperty("request_timeout")); // Timeout in millis
port.getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", webserviceInfoProperties.getProperty("connect_timeout"));

Thanks.


any help would be appreciated.
John Dalenson
Greenhorn

Joined: Feb 07, 2012
Posts: 8

Anybody?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The timeouts you have set are associated with the time it takes to establish a (socket) connection and the maximum time between establishing a connection and receiving data from the connection.
Since you say that the client has already started receiving data, then none of the above timeouts apply.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
John Dalenson
Greenhorn

Joined: Feb 07, 2012
Posts: 8

Ivan Krizsan wrote:Hi!
The timeouts you have set are associated with the time it takes to establish a (socket) connection and the maximum time between establishing a connection and receiving data from the connection.
Since you say that the client has already started receiving data, then none of the above timeouts apply.
Best wishes!


Thanks for reply Ivan. But, i have set a very small request timeout and have tried downloading a bigger file. The total time to transfer the file is more than the request timeout value. I was expecting to timeout because of this, but it didn't.

How can I simulate the connect timeout error? I tried changing the endpoint location to the unreachable IP, it fails to connect, but it doesn't say that the request timed out.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Webservice timeouts
 
Similar Threads
How to specify WebService operation timeout
Setting the Transaction Time
Lock timeout
ejb transaction times out
Setting Request - Response Time Out Programatically