[英]Setting Java web service timeout at server side
I'm new to java web services and I'm facing some problems to configure my Java server side application with web services. 我是Java Web服务的新手,在使用Web服务配置Java服务器端应用程序时遇到了一些问题。 I'll try to explain it with detail:
我将尝试详细解释:
I have two questions: was I right when I said all those parts have a timeout that should be checked and configured? 我有两个问题:我说所有这些部分都有超时应该检查和配置时,对吗? If affirmative, I would like to know where can I modify the timeout value in my web service implementation (I've taken a look to web.xml and sun-jaxws.xml files, but don't know what and where to touch...).
如果是,我想知道在哪里可以修改Web服务实现中的超时值(我看过了web.xml和sun-jaxws.xml文件,但是不知道要触摸什么和在哪里触摸。 ..)。
Thank you very much !! 非常感谢你 !!
In Tomcat's server.xml you find a "connectionTimeout" attribute in the "Connector" element, which defines tomcat's timeout range in miliseconds. 在Tomcat的server.xml中,您可以在“ Connector”元素中找到一个“ connectionTimeout”属性,该属性以毫秒为单位定义tomcat的超时范围。
But there are cleaner ways of handling resource-consuming tasks for a web service than to just increase timeouts. 但是,除了增加超时之外,还有更干净的方法来处理Web服务的资源消耗任务。 Think about doing your exhausting stuff in a seperate thread and provide your client a possibility to check whether the thread has finished or not.
考虑在一个单独的线程中完成您的工作,并为客户提供检查线程是否已完成的可能性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.