I am trying to upload a multipart form-data with an attached xml file to integration server.
I am using a HttpRequestHandlingMessagingGateway
with a RequestMapping
bean.
@Bean("Inbound_GATEWAY_in")
public MessageChannel Inbound_GATEWAY_in() { return new DirectChannel(); }
@Bean
public HttpRequestHandlingMessagingGateway selerixInboundRequest() {
HttpRequestHandlingMessagingGateway gateway =
new HttpRequestHandlingMessagingGateway(true);
gateway.setRequestMapping(selerixMapping());
gateway.setMessageConverters( messageConverter() );
gateway.setMultipartResolver(multipartResolverBean());
gateway.setRequestTimeout(3000); // 3s
gateway.setReplyTimeout(5000); // 5s
gateway.setRequestChannelName("Inbound_GATEWAY_in");
gateway.setReplyChannelName("Outbound_GATEWAY_out");
return gateway;
}
@Bean
public RequestMapping selerixMapping() {
RequestMapping requestMapping = new RequestMapping();
requestMapping.setPathPatterns("/path");
requestMapping.setMethods(HttpMethod.POST);
requestMapping.setConsumes(MediaType.MULTIPART_FORM_DATA_VALUE);
return requestMapping;
}
@Bean
public MultipartResolver multipartResolverBean(){
return new CommonsMultipartResolver();
}
@ServiceActivator(inputChannel = "Inbound_GATEWAY_in")
public Message<?> headerEnrich_Inbound_GATEWAY_in(Message<?> message){
Message<?> outmessage = null;
LOGGER.info("message ", message); // returns blank message
But when I am trying to upload the xml file the message is coming as blank.
How can I find the xml file in the Message<?> or how can I check the Request object ?