WebService / java.net.SocketTimeoutException:读取超时 [英] WebService / java.net.SocketTimeoutException: Read timed out
问题描述
我在WebService中遇到一个问题,详情如下:
I am facing an issue in WebService, in details :
Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:171)
... 26 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1000)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1900)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1828)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:590)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 31 more
当我尝试向目标发送请求时服务,它需要30-60秒,并抛出上面的例外。我正在使用Tomcat 5,我想问有没有办法增加超时值?
此外,我想访问的WSDL和WebService正在运行且可用。
When I try to send a request to the target service, it takes 30-60 seconds and than the exception above is thrown. I am using Tomcat 5,and I would like to ask is there any way of increasing the timeout value ? Also the WSDL and WebService which I want to access is running and available.
我非常感谢任何帮助,
亲切的问候,
P。
Kind regards, P.
推荐答案
你需要为此设置ReceiveTimeout请求。
You need to set "ReceiveTimeout" for this request.
此页面详细介绍了如何将此属性添加到请求上下文中:
This page has details on adding this property to request context:
http://cxf.apache.org/docs/developing-a-consumer.html
这篇关于WebService / java.net.SocketTimeoutException:读取超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!