понял это. Я использую исходящий шлюз, как показано ниже:
<int-http:outbound-gateway id="get.outbound.gateway"
request-channel="postCmsChannel" url="${cms.stub.request.url}"
http-method="POST" reply-channel="zappSearchResponse"
expected-response-type="standalone.StubResponseBody">
</int-http:outbound-gateway>
'postCmsChannel' является выходным каналом активатора службы:
<int:service-activator id="zappServiceActivator"
input-channel="xappFilterChannelOutput"
output-channel="postCmsChannel"
ref="xappSearchService"
method="handleXappRequest"
send-timeout="60000"/>
'xappSearchService' похож на ниже:
@Autowired
@Qualifier("postCmsChannel")
MessageChannel postCmsChannel;
public void handleXappRequest(Message<CFIRequestBody> inMessage){
/*
* Map<String, Object> responseHeaderMap = new HashMap<String, Object>();
*
* //MessageHeaders headers = inMessage.getHeaders(); StubResponseBody
* info=inMessage.getPayload();
*
* setReturnStatusAndMessage(responseHeaderMap); Message<StubResponseBody>
* message = new GenericMessage<StubResponseBody>(info, responseHeaderMap);
* return message;
*/
inMessage.getHeaders();
Map<String,String> headerMap=new HashMap<String,String>();
headerMap.put("X-JWS-SIGNATURE", "dshdgshdgasshgdywtwtqsabh232wgd7wdyt");
headerMap.put("X-PARTICIPANT-ID", "CMDRV2112BB");
postCmsChannel.send(MessageBuilder.withPayload(inMessage.getPayload())
.copyHeadersIfAbsent(inMessage.getHeaders()).copyHeadersIfAbsent(headerMap).build());
}
}