【问题标题】:How to add a file as attachment in Spring integraion Webservices outbound gateway如何在 Spring 集成 Web 服务出站网关中添加文件作为附件
【发布时间】:2014-10-17 22:23:50
【问题描述】:

我有一个用于 Web 服务的 Spring 集成出站网关。到目前为止,我以 xml 格式将请求发送到 Web 服务。 现在,我需要将文件作为请求的一部分发送到 Web 服务。 我将如何做到这一点? 下面是spring集成链现有配置:

<!--  Chain to Process requests for XXXXX-->
    <int:chain id="psTestChain" input-channel="psTestInputChannel" >
        <!-- Set up transformer for input message -->
        <int:transformer method="transform"  ref="testRequestXformer"/>

        <!-- This Spring Integration chain first adds the service name and the 
            service operation headers to the Spring Integration message using the header 
    <int:header-enricher>
            <int:header name="#{XXXXXXXXX}"
                value="TestSearch" />
            <int:header
                name="#{XXXXXX}"
                value="searchByTestIdentifier" />
        </int:header-enricher>

        <!-- The WS outbound gateway is used to make an outgoing SOAP call. -->
        <int-ws:outbound-gateway id="simpleGateway"
            destination-provider="testDestinationProvider"
            message-sender="testHttpsMessageSender"
            interceptor="test_wss4jInterceptor"
            header-mapper="testSoapHeaderMapper"/>

        <!-- Set up transformer for output message -->
        <int:transformer method="transform" ref="testResponseXformer"/> 

    </int:chain>

【问题讨论】:

    标签: attachment spring-integration


    【解决方案1】:

    请查看 Spring WS 项目的 MTOM sample

    由于 Spring Integration WS 模块完全基于 Spring WS,我认为构建带有附件作为消息 payload 的 JaxB 对象并使用 marshaller 注入将其发送到 &lt;int-ws:outbound-gateway&gt; 不会有太大区别.

    我们有一个关于此事的公开issue,但我没有足够的时间来看看我们应该在那里做什么。

    我刚刚为 Spring Integration Samples 提出了ticket,以跟踪 MTOM 在 Spring Integration 中的能力。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多