Camel CXF:肥皂客户端超时 [英] Camel CXF: Soap client timeout

查看:32
本文介绍了Camel CXF:肥皂客户端超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Camel CXF 端点连接到我的肥皂服务器.我想为来自客户的请求添加超时.我为此使用 continuationTimeout 选项.但它不起作用.请求超时,没有等待我配置的时间.

下面是我的端点配置.

解决方案

你的问题不是很清楚,因为没有骆驼路线,所以我看不出你是在骆驼内部创建 SOAP 服务还是从骆驼作为客户.根据您发送的少量信息,您似乎正在创建一个客户端.

根据骆驼CXF文档

  • continuationTimeout: 该选项用于设置 CXF 的延续超时时间,默认可以在 CxfConsumer 中使用当 CXF 服务器使用 Jetty 或 Servlet 传输时.(前Camel 2.14.0,CxfConsumer 只是将延续超时设置为0,表示继续挂起操作永不超时.)

请注意,这与 CXF 服务器设置而非客户端设置有关.您正在使用此属性,但我认为这不是您要寻找的.

如果您参考 Apache CXF 客户端设置文档 页面,您将在那里找到以下注释:

  • ConnectionTimeout: 指定客户端在它之前尝试建立连接的时间量(以毫秒为单位)超时.默认值为 30000(30 秒).0 指定客户端将继续无限期地尝试打开连接.
  • ReceiveTimeout: 指定客户端在超时前等待响应的时间量(以毫秒为单位).这默认为 60000.0 指定客户端将无限期等待.

如果您访问 CXF 文档页面,那里有很多示例.

I am using Camel CXF endpoint to connect to my soap server. I wanted to add timeout for my request from client. I am using continuationTimeout option for that. But it's not working. The request is timeout without waiting for the time that I've configured.

Below is my endpoint configuration.

<camel-cxf:cxfEndpoint id="tmAPIWSEndpoint" address="http://IN2NPDCEDB01:8088/webservices/services/TransportationManager"
            wsdlURL="/wsdl/TransportationManager.wsdl"
            endpointName="cis:TransportationManagerPort"
            serviceName="cis:TransportationManagerService"
            xmlns:cis="http://www.i2.com/cis"
            continuationTimeout="60000">
        <camel-cxf:properties>
            <entry key="dataFormat" value="MESSAGE"/>
            <entry key="username" value="XXX"/>
            <entry key="password" value="XXX"/>
        </camel-cxf:properties>
    </camel-cxf:cxfEndpoint>

解决方案

Your question is not very clear since there is no camel route so I cant see if you are creating a SOAP service inside Camel or you are calling a SOAP service from Camel as the client. Based on the little bit information you sent it seems you are creating a client.

According to the camel CXF documentation

  • continuationTimeout: This option is used to set the CXF continuation timeout which could be used in CxfConsumer by default when the CXF server is using Jetty or Servlet transport. (Before Camel 2.14.0, CxfConsumer just set the continuation timeout to be 0, which means the continuation suspend operation never timeout.)

Notice that this is related to CXF server settings not client settings. You are using this property but I dont think this is what you are looking for.

If you reference the Apache CXF Client Settings Documentation page you will find the following notes there:

  • ConnectionTimeout: Specifies the amount of time, in milliseconds, that the client will attempt to establish a connection before it times out. The default is 30000 (30 seconds). 0 specifies that the client will continue to attempt to open a connection indefinitely.
  • ReceiveTimeout: Specifies the amount of time, in milliseconds, that the client will wait for a response before it times out. The default is 60000. 0 specifies that the client will wait indefinitely.

If you visit the CXF documentation page there is a lot examples there.

这篇关于Camel CXF:肥皂客户端超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆