【发布时间】:2014-08-29 00:45:09
【问题描述】:
我被 Apache Camel 困住了。我需要通过 JBOSS FUSE 公开一个 Web 服务,但我必须返回的有效负载取决于对两个外部 Web 服务的调用。
所以,第一个外部网络服务有这个 URL:
http://someip/externalWSOne
这会接收一个名为 A 的参数,并返回三个值 X、Y 和 Z。
第二个,接收三个名为 B、X 和 Y 的参数。请注意,X 和 Y 是第一个外部 Web 服务的返回值。
http://someip/externalWSTwo
第二个外部 Web 服务返回 N1...Nn 个值,它们是最终的有效负载
最终用户只使用一个Web服务,也就是我将通过JBOSS FUSE公开的内部we服务。出于这个原因,我需要公开一个接收两个参数的 Web 服务
在 Apache camel 中对该流程建模的正确方法是什么?我写了下面的配置但是最后的payload是空的:
<cxf:cxfEndpoint id="epInterno" address="/ep-interno/" serviceClass="somePackage.MyWebServiceInterface">
<cxf:cxfEndpoint id="epExterno1" address="http://someip/externalWSOne" serviceClass="somePackage.ExternalWSOneServiceInterface">
<cxf:cxfEndpoint id="epExterno2" address="http://someip/externalWSTwo" serviceClass="somePackage.ExternalWSTwoServiceInterface">
<camelContext id="blueprintContext" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
<route id="ruta1">
<from uri="cxf:bean:epInterno"/>
<process ref="proccesorOne" />
<to uri="cxf:bean:epExterno1" />
<process ref="processorTwo" />
<to uri="cxf:bean:epExterno2" />
</route>
</camelContext>
外部网络服务的所有工件都是使用 Maven 插件生成的。
【问题讨论】:
-
最后一段XML无效,因为你有
-
你有没有尝试调试过每一步都记录body内容等路由?
-
是的,我在 cxf 入口点中使用了拦截器,我看到了 epExterno2 根据这个例子返回的 SOAP 消息,但是由于任何原因,这不能作为最终的 SOAP 消息被骆驼拉出来.我看到与“意外元素”相关的错误。到目前为止,我发布这个问题的目的是了解编排多个 Web 服务的正确方法是上面提出的解决方案。
标签: web-services apache-camel fuseesb jbossfuse