0

我有以下内容cxf.xml

<?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:jaxws="http://cxf.apache.org/jaxws"
      xmlns:http="http://cxf.apache.org/transports/http/configuration"
      xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
              http://cxf.apache.org/transports/http/configuration
      http://cxf.apache.org/schemas/configuration/http-conf.xsd">
    <http:conduit name="http://localhost:8080/mockInterfaceSoap">
        <http:client ReceiveTimeout="5000" />
    </http:conduit>
</beans>

有什么方法可以ReceiveTimeout用弹簧替换硬编码的参数值?

编辑:
我想在运行时动态更改它。更改非常罕见,因此应用程序可以更改现有端点或创建新端点。

4

2 回答 2

0

也许 org.apache.cxf.jaxrs.client.WebClient 有帮助。我前段时间找到了对它的引用,并在以下示例中使用了它:

String endpointAddress = "*";
WebClient client = WebClient.create(endpointAddress);
HTTPConduit httpConduit = WebClient.getConfig(client).getHttpConduit();
httpConduit.setTlsClientParameters(new TLSClientParameters());
httpConduit.getTlsClientParameters().setUseHttpsURLConnectionDefaultHostnameVerifier(true);
httpConduit.getTlsClientParameters().setUseHttpsURLConnectionDefaultSslSocketFactory(true);
return httpConduit;
于 2014-04-07T22:01:19.923 回答
0

您可以按如下方式使用它。

<jaxrs-client:client id="clientId" serviceName="clientServiceName"
                 address="${urlService}" >
</<jaxrs-client:client>

<http-conf:conduit  name="*clientServiceName*.http-conduit" >
     <http-conf:client ReceiveTimeout="1"/>
</http-conf:conduit>   
于 2018-12-17T11:36:24.093 回答