如何在POJO模式下从apache camel cxf端点解析apache camel处理器中的SOAP标头:
<cxf:cxfEndpoint id="MyWS" address="http://localhost:8080/services/MyWS" serviceClass="tmp.MyWS" />
<route>
<from uri="cxf:bean:MyWS" />
<process ref="MyProcessor" />
</route>在apache camel cxf官方网站上,我找到了一个如何设置头部的示例,但没有关于获取它们的示例。如何获取messageId值。我的SOAP请求看起来像这样:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://inv.org">
<soapenv:Header>
<inv:messageId>111</inv:messageId>
</soapenv:Header>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope>发布于 2015-04-20 12:43:57
在Camel Route builder中,我们将使用简单组件获取SOAP标头,在下面的示例中,我将使用SOAP操作名称应用cbr。
from("cxf:bean:xyz-ws?dataFormat=POJO").routeId("xyz-ws").log(“这是${in.header.operationName}操作,名为....”) .log(“进入带有操作的选择....${in.header.operationName}”) .when(simple("${in.header.operationName} == 'getDataFromDictionary'"))
希望这能帮上忙。
https://stackoverflow.com/questions/23984520
复制相似问题