【问题标题】:How to invoke a SOA Webservice operation (method) in spring integration如何在spring集成中调用一个SOAP Web Service操作(方法)
【发布时间】:2021-06-23 00:42:58
【问题描述】:

不幸的是,关于如何调用 SOAP Web 服务的示例并不多。文档中的示例非常模糊,尤其是对于新学习者。

这就是场景。 我有一个有很多操作的网络服务。 在 xml 配置中,我有一个转换器,它从消息的有效负载中提取信息并将数据存储在 POJO 中。目前,转换器正在使用来自 POJO 的数据构建肥皂请求。最后,转换器返回并在 requestChannel 中放置一条消息,该消息只是作为字符串的肥皂请求。

我正在调用文档中的示例中的 Web 服务;像这样的。

<int-ws:outbound-gateway id="invokeService"
                 request-channel="requestChannel"
                 reply-channel="responseChannel"
                 uri="http://[host]:[port]/app/service" />

我收到此错误:SoapFaultClientException: Unknown method

我想知道如何调用soap webservice 操作,将POJO 数据传递给soap 请求。 webservice操作(或方法)有字符串参数。

也在寻找关于 Spring Integration 的优秀教程或书籍。

提前致谢。

【问题讨论】:

    标签: spring-integration spring-ws


    【解决方案1】:

    Spring Integration WebServices 支持只不过是 Spring WS 之上的消息传递通道适配器实现。因此,如果您对如何构建和接收 SOAP 消息有疑问,请咨询该项目:https://docs.spring.io/spring-ws/docs/current/reference/html/。您可能需要提供一个 SOAP Action 标头:https://docs.spring.io/spring-integration/docs/current/reference/html/ws.html#ws-message-headers

    另见相应示例:https://github.com/spring-projects/spring-integration-samples/tree/main/basic/ws-outbound-gateway

    对于现有的 POJO,您可以考虑使用Marshaller 方法。 JAXB 是一个很好的基于 WSDL 进行注释和生成的工具。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多