Could not write request: no suitable HttpMessageConverter found for request type and content type [application/x-java-serialized-object]

爷,独闯天下 提交于 2019-12-01 13:58:23
Yalamanda

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<String, ? extends HeaderValueMessageProcessor<?>> headersToAdd = Collections
        .singletonMap(HttpHeaders.CONTENT_TYPE, new StaticHeaderValueMessageProcessor<>("application/xml"));

    HeaderEnricher enricher = new HeaderEnricher(headersToAdd);
    enricher.setDefaultOverwrite(true);

    return enricher;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!