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)
我没有找到适合响应类型 [interface java.util.Map] 和内容类型 [application/xml;charset=UTF-8] 的 HttpMessageConverter