How to set timeout in Spring WebServiceTemplate

前端 未结 9 1088
一整个雨季
一整个雨季 2020-12-05 06:45

I am using org.springframework.ws.client.core.WebServiceTemplate for making Web Service calls. How can i configure timeout for the call.

9条回答
  •  忘掉有多难
    2020-12-05 07:20

    If you want that kind of control, you can

    • either switch to CommonsHttpMessageSender, which uses the Jakarta Commons HttpClient
    • or subclass HttpUrlConnectionMessageSender and in the prepareConnection(HttpURLConnection) method call UrlConnection.setReadTimeOut(int)

提交回复
热议问题