socket读取超时异常。增加阅读时间

时间:2017-03-17 03:56:09

标签: java web-services spring-mvc cxf

我在点击webservice时收到套接字超时错误。我在客户端收到错误。我想增加阅读时间。我已阅读各种帖子,但不知道在哪里添加这段代码。

https://d1wgio6yfhqlw1.cloudfront.net/sysimages/product/resized6/Interior_St_Pauls_Cathedral_132_12992.jpg

https://d1kioxk2jrdjp.cloudfront.net/resized/486x324/48-st_pauls_ctahedral_millenirm_bridge.jpg

http://i4.mirror.co.uk/incoming/article8299330.ece/ALTERNATES/s615b/LOND-2016-052-HMQ-St-Pauls-Thanks-Giving-704JPG.jpg

这是我打电话给我的网络服务的地方。

这是我得到的例外......响应已经形成但是需要时间才能形成。

@Service
public class ManageQuoteRequestWSImpl implements ManageQuoteRequestWS {

    @Autowired
    private ManageQuoteRequestResourceInventory manageQuoteRequestClientWS ;


    @Override
    public ResultsViewResponse findAndGetQuoteRequest(FilterCriteriaForFindAndGetQuoteRequest filterCriteriaForFindAndGetQuoteRequest) throws FunctionalException, FindAndGetQuoteRequestFault {
       return manageQuoteRequestClientWS.findAndGetQuoteRequest(filterCriteriaForFindAndGetQuoteRequest);
    }
}

我有一个soapConsumerContext.xml,它有一个http声明 -

Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking http://vs30-oqtprodback-go/BackEnd/services/quoteRequest: Read timed out
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_25]
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_25]
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_25]
                at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_25]
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1338) ~[cxf-rt-transports-http-2.7.7.jar:2.7.7]
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1322) ~[cxf-rt-transports-http-2.7.7.jar:2.7.7]
                at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:50) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627) ~[cxf-rt-transports-http-2.7.7.jar:2.7.7]
                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330) ~[cxf-api-2.7.7.jar:2.7.7]
                at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) ~[cxf-rt-frontend-simple-2.7.7.jar:2.7.7]
                at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135) ~[cxf-rt-frontend-jaxws-2.7.7.jar:2.7.7]
                ... 37 common frames omitted
Caused by: java.net.SocketTimeoutException: Read timed out

我添加了这段代码 -

?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

    <!-- ManageQuoteRequest -->
    <jaxws:server
            serviceClass="com.orange.oqt.interfaces.managequoterequest.resourceinventory.v1.ManageQuoteRequestResourceInventory" address="/quoteRequest"
            serviceBean="#quoteRequestWs">
        <jaxws:features>
            <bean class="org.apache.cxf.feature.LoggingFeature"/>
        </jaxws:features>
        <jaxws:properties>
            <!-- schema validation should be enabled -->
            <entry key="schema-validation-enabled" value="true" />
            <entry key="mtom-enabled" value="true" />
        </jaxws:properties>
    </jaxws:server>

但它不起作用

0 个答案:

没有答案
相关问题