Spring 集成 WS 入站网关 Remove Soap empty header
Spring Integration WS inbound gateway Remove Soap empty header
我的项目使用 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
,但响应总是空肥皂 header。
- 为什么这个肥皂是空的header来了?
- 这是默认行为吗?
- 如果是,那么如何去除空肥皂header?
考虑向您的 EndpointMapping
添加一些自定义 EndpointInterceptor
并在 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.
我的项目使用 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
,但响应总是空肥皂 header。
- 为什么这个肥皂是空的header来了?
- 这是默认行为吗?
- 如果是,那么如何去除空肥皂header?
考虑向您的 EndpointMapping
添加一些自定义 EndpointInterceptor
并在 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.