0
HttpHeaders reqheaders= new HttpHeaders();
reqheaders.set(HttpHeaders.Accept,MediaType.Application_xml)
reqheaders.set(HttpHeaders.Content_type,MediaType.Application Json)
HttpEntity XML= new HttpEntity (json,reqheaders)
ResponseEntity<Map> xmlfile= restTemplate.exchange(url,HttpMethod.POST,XML, Map.class)

I am getting no suitable HttpMessageConverter found for response type[interface java.util.Map] and content type [application/xml;charset=UTF-8]

1 Answers1

0

it looks like no suitable HttpMessageConverter is registered with the RestTemplate can convert xml content to a Map object.

There some HttpMessageConverters which are pre-enabled and can be checked here. You need to make sure that the suitable HttpMessageConverter is on your classpath.

amdg
  • 2,211
  • 1
  • 14
  • 25