Spring集成调用Web服务

Spring集成调用Web服务,spring,spring-integration,Spring,Spring Integration,我对Spring集成还是新手,没有什么问题 我在tomcat服务器中部署了一个带有WSDL的服务 我希望将参数从spring集成流发送到该服务并接收 响应返回以执行流程中的下一步操作 我应该使用出站WS-gateway来完成这项工作,对吗? 如何配置xml来实现这一点 我试过温度的例子,但还是不明白 多谢各位 /////////////////////////////////////////////////////////////// 这是我的配置: <int:gateway s

我对Spring集成还是新手,没有什么问题

我在tomcat服务器中部署了一个带有WSDL的服务

我希望将参数从spring集成流发送到该服务并接收 响应返回以执行流程中的下一步操作

我应该使用出站WS-gateway来完成这项工作,对吗? 如何配置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 activator的输出通道,以调用web服务,该服务向该服务发送参数(参数类型为Hashmap)并接收相同类型的响应

我不知道如何使用ws:outbound-gateway调用web服务。因为我只知道通过生成客户机java类使用java方式调用web服务,可能是,我将在方法doSomething中调用服务

就我而言,你认为哪种方式更好? 我还想知道如何使用ws:outboundgateway来解决这个问题


多谢各位

就SOAP而言,您可以使用XML。您的WSDL为您提供了一个契约——一个XSD,XML应该被发送到服务,并作为响应返回

因此,您的任务是配置
,并将正确的XML作为消息
有效负载
提供给该组件的
请求通道

响应也是如此:您将得到一个XML作为
有效负载

但是,它适用于简单的WS出站网关。您可以使用
marshaller
对其进行配置,并将其发送到
请求通道
某个域POJO,
marshaller
负责将该POJO转换为SOAP请求的XML表示


请展示您的配置,也许我们可以为您的具体问题提供更多帮助。

感谢您的回复。我已经在我的主题帖子中完成了更新配置。如果你没有足够的时间,你可以继续生成代码并使用generic
。否则,您需要先研究什么是
契约
,以及SpringWS如何实现它。SpringIntegrationWS模块完全基于SpringWS项目。再次感谢您,代码生成方式运行良好,我将按照您的建议研究SpringWS。