I am trying to post an xml request to a third party server and expecting an xml response back.
I am here by attaching the source code for configuring Cnfiguration,ga
Finally i found solution by setting header enricher out put channel to be passed as request channel to httpoutbound gateway. Find below code snippet,there i set content-type to application/xml that resolves problem.
@Bean
@Transformer(inputChannel = "RequestChannel", outputChannel = "enricherOutputChannel")
public HeaderEnricher makeEnricher() {
Map> headersToAdd = Collections
.singletonMap(HttpHeaders.CONTENT_TYPE, new StaticHeaderValueMessageProcessor<>("application/xml"));
HeaderEnricher enricher = new HeaderEnricher(headersToAdd);
enricher.setDefaultOverwrite(true);
return enricher;
}