【发布时间】:2014-03-05 14:53:17
【问题描述】:
你好!
我正在尝试学习一些Apache Camel 和Apache CXF,当然我遇到了一些问题。
我想要做什么:
从 ESB 向某个 Web 服务发送定时 SOAP 消息,等待来自 Web 服务的响应并处理它。我正在使用 Apache ServiceMix!。
我做了什么:
实现了一个 WSDL 文件,其中包含两个操作 PingOutput(我发送的内容)和 PingInput(我想从 WS 接收的内容)。
实现了一个 CXF 端点(http://127.0.0.1:8090/ping_ws 是一个用 SoapUI 模拟的 WS):
<cxf:cxfEndpoint address="http://127.0.0.1:8090/ping_ws"
id="Ping_Mocked_WS" wsdlURL="ping.wsdl">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
实施了骆驼路线:
<camelContext xmlns="http://camel.apache.org/schema/spring" streamCache="true">
<route id="ping-ws">
<from uri="timer://ping_timer?fixedRate=true&period=10000"/>
<bean ref="PingBean" method="createPingRequest" />
<to uri="cxf:bean:Ping_Mocked_WS"/>
<bean ref="PingBean" method="processPingResponse" />
</route>
</camelContext>
我不明白的地方:
- 为什么
<bean ref="PingBean" method="processPingResponse" />从 SoapUI 获得正确的响应(WSDL 中定义的PingOutput操作)? - 这是实现目标的正确方法吗?我的意思是只有一条路线?
代码可以正常工作,我这里可能有一些拼写错误,请不要介意。
谢谢!
【问题讨论】:
标签: web-services soap cxf apache-camel soapui