title: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/xml;charset=UTF-8' not supported
body: <p>I am getting below exception when I am calling rest service.</p>
  
  <blockquote>
    <p>org.springframework.web.HttpMediaTypeNotSupportedException: Content
    type 'application/xml;charset=UTF-8' not supported
                  at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:152)
    [spring-webmvc-4.1.1.RELEASE.jar:4.1.1.RELEASE]
                  at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:181)
    [spring-webmvc-4.1.1.RELEASE.jar:4.1.1.RELEASE]
                  at</p>
  </blockquote>
  
  <p><strong>Code</strong> </p>
  
  <pre><code>    //    This method calls the rest service
  
  
          @Override
          public TransactionSearchResults callSearchTransactions(TransactionSearchCriteria criteria, int page, int size) {
  
          HttpEntity&lt;TransactionSearchCriteria&gt; requestEntity = new HttpEntity&lt;TransactionSearchCriteria&gt;(criteria, getCommonHeaders(new HttpHeaders()));
  
          Map&lt;String, Integer&gt; params = new HashMap&lt;String, Integer&gt;();
          params.put("size", size);
          params.put("page", page);
  
          return restTemplate.exchange(urlBase + "/transaction?size={size}&amp;page={page}", HttpMethod.POST, requestEntity, TransactionSearchResults.class, params).getBody();
  
          }
  
      // Api which caters to rest call
  
          @Controller
          @RequestMapping("/transaction")
          public class TransactionStatusController extends BaseController { ... }
  
      //Controller method for rest call 
          @ResponseBody
          @RequestMapping(produces = { MediaType.APPLICATION_JSON_VALUE }, method = RequestMethod.POST , consumes = MediaType.APPLICATION_JSON_VALUE)
              public com.rest.TransactionSearchResults searchTransactions(@RequestParam(value = "page", required = false) Integer page,
  // Using request Param to retireve criteria                         
  @RequestParam(value = "size", required = false) Integer size, @Valid     @RequestBody com.rest.TransactionSearchCriteria criteria) {
  // This gets relevant results and return it to rest call
      return convert(transactionService.search(convert(criteria), page, size));
  
  }
  </code></pre>