Spring集成WS入站网关删除Soap空标题

问题描述:

我的项目使用Spring集成ws-inbound-gateway。Spring集成WS入站网关删除Soap空标题

<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但响应总会有空的肥皂头。

  • 这是什么肥皂为空的标题来了?
  • 这是默认行为吗?
  • 如果是这样然后如何删除空的肥皂头?

考虑到一些自定义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. 
+0

谢谢@Artem比兰您的快速反应。我会尝试你的建议。 – chaitu