![](/img/trans.png)
[英]Cannot be cast to java.lang.String error at WrapperClassOutInterceptor when connecting SOAP endpoint through Camel cxf component
[英]Why does the Camel CXF endpoint use a part of the path string provided with the SOAP request to build the URL for the http component?
我有一个 Camel 路由,它提供一个 SOAP 服务并将请求传递给一个简单的 HTTP 服务。
我的blueprint.xml
文件中有以下设置:
<camelcxf:cxfEndpoint id="pingService"
address="http://localhost:8989/soap"
serviceClass="ch.example.PingService" />
<route id="ping">
<from uri="cxf:bean:pingService" />
<to uri="http4://destination.lo/ping?bridgeEndpoint=true"/>
</route>
PingService 看起来像这样:
@WebService(serviceName = "PingService")
public interface PingService {
String ping(String s);
}
当我向http://localhost:8989/soap发送 SOAP 请求时,一切正常,并且http://destination.lo/ping被正确调用。
但是,当我将字符串附加到 SOAP 端点 URI(例如http://localhost:8989/soap/foo )时,字符串/foo会附加到目标端点的 URI,如下所示: http://destination.lo /平/富
我尝试通过手动定义 URI 来禁用此行为,如下所示:
<setHeader headerName="CamelHttpUri">
<constant>http://destination.lo/ping</constant>
</setHeader>
但这无济于事。
如何禁用此行为?
在http4文档bridgeEndpoint
:
如果为 true,HttpProducer 将忽略 Exchange.HTTP_URI 标头,并使用端点的 URI 进行请求。
从Camel 代理概述页面,我认为如果您需要除 1:1 URL 映射之外的任何内容,您应该使用UrlRewrite 组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.