title: Convert Xml request to Object Spring Boot
body: <p>Created a spring boot rest service which accepts XML as a request and converts it into object and then inserts it into database.
  I used Jackson dataformat dependency for directly converting the xml request to object but getting an error .</p>
  
  <p>The controller class is as follows </p>
  
  <pre><code>@RequestMapping(value = "/getRequestData",method=RequestMethod.POST,
          produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE},consumes={MediaType.APPLICATION_XML_VALUE})
      public ResponseEntity&lt;?&gt; putDataIntoDatabase(@RequestBody FirstRequestorBean bean) {
  
          logger.info(bean.getId());
          return new ResponseEntity&lt;String&gt;(HttpStatus.OK);
      }
  </code></pre>
  
  <p>and bean class</p>
  
  <pre><code>public class FirstRequestorBean {
  
  
      private String name;
      private String id;
  
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public String getId() {
          return id;
      }
      public void setId(String id) {
          this.id = id;
      }
  
  
  
  }
  </code></pre>
  
  <p>the xml passed here is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;FirstRequestorBean&gt;
      &lt;name&gt;Akhil&lt;/name&gt;
      &lt;id&gt;1&lt;/id&gt;
  &lt;/FirstRequestorBean&gt;  
  </code></pre>
  
  <p>getting a Unsupported Media Type exception.</p>
  
  <p>can someone point out how to resolve the issue</p>