Spring Integration WS入站网关删除Soap空标头

时间:2015-10-15 10:13:19

标签: spring soap spring-integration

我的项目使用Spring集成ws-inbound-gateway。

<int-ws:inbound-gateway id="shop-inbound-gateway"           
            error-channel="shopCoreErrorChannel" 
            request-channel="shopRequestChannel" 
            reply-channel="shopResponseChannel" />

响应:

<SOAP-ENV:Envelope xmlns:SOAP-     ENV="http://schemas.xmlsoap.org/soap/envelope/">
           <SOAP-ENV:Header/>
           <SOAP-ENV:Body>
           <shop:RailShopAPIResponse>
            ......
            ......
           </shop:RailShopAPIResponse>
           </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

即使我没有映射任何mapped-reply-headers / mapped-request-headers,但响应始终会有空的soap标题。

  • 为什么这个肥皂空头来了?
  • 这是默认行为吗?
  • 如果是,那么如何删除空肥皂头?

1 个答案:

答案 0 :(得分:0)

考虑向EndpointInterceptor添加一些自定义EndpointMapping,并在handleResponse中实施清理逻辑:

/**
 * Processes the outgoing response message. Called after {@link EndpointAdapter} actually invoked the endpoint. Can
 * manipulate the response, if any, by adding new headers, etc.
相关问题