【发布时间】:2014-02-20 18:52:10
【问题描述】:
我还是 Spring Integration 的新手,我没有几个问题。
我在 tomcat 服务器中部署了一个带有 WSDL 的服务。
我想将参数从我的 spring 集成流发送到该服务并接收 响应返回以执行流程中的下一步操作。
我应该使用出站 WS 网关来执行此操作,对吗? 以及如何配置xml来做到这一点?
我尝试了温度示例,但仍然不明白。
谢谢。
/////////////////////////////////////// ///////////////
这是我的配置:
<int:gateway service-interface="com.app.service.IRequester" id="IRequester"
default-request-channel="requestChannel"
default-reply-channel="responseChannel"
error-channel="errorChannel" >
</int:gateway>
<int:service-activator input-channel="requestChannel" id="bu1"
ref="BU1" method="bu1Method"
output-channel="buChannel">
</int:service-activator>
<int:service-activator input-channel="errorChannel"
ref="handlerError" method="errorReturnToGateway"
output-channel="responseChannel" >
</int:service-activator>
<int:router id="routingChannel" input-channel="buChannel" ref="RoutingChannel" method="routingChannel">
<int:mapping value="firstChannel" channel="channelFirst" />
<int:mapping value="otherChannel" channel="channelOther" />
</int:router>
<int:service-activator id="firstBU" input-channel="channelFirst"
ref="FirstBU" method="doSomething" output-channel="responseChannel">
</int:service-activator>
<int:service-activator id="otherBU" input-channel="channelOther"
ref="OtherBU" method="doSomething" output-channel="responseChannel">
</int:service-activator>
我需要更改 firstBU 和 otherBU 激活器的输出通道以调用 Web 服务,该服务将参数发送到该服务(参数类型为 Hashmap)并接收相同类型的响应。
我不知道如何使用 ws:outbound-gateway 调用 web 服务。因为我只知道通过生成客户端 java 类使用 java 方式调用 web 服务,我可能会在方法 doSomething 中调用服务。
就我而言,您认为哪种方式更好? 我仍然想知道如何通过使用 ws:outbound-gateway 来解决这个问题。
谢谢。
【问题讨论】: