title: Spring 4 RestController not mapping xml request correctly
body: <p><a href="https://i.stack.imgur.com/LN7jh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LN7jh.jpg" alt="enter image description here"></a>I am trying to make a restful Webservice that takes XML request and produces xml response and I am using spring 4.3.5 for it...</p>
  
  <p>The issue is that when I am posting a post request using postman and add a debug on in my service method than I found that xml request attributes is not mapping/deserialize with player POJO.</p>
  
  <p>Any help would be appreciated..Thanks</p>
  
  <pre><code>@RestController
  public class SyncRestfulService {
  
  LoggerManager loggerManager = new LoggerManager();
  
  @RequestMapping(value = RestURIConstants.SAMPLE_POST_PLAYER, method = RequestMethod.POST, headers = {
          "Content-type=application/xml" })
  public Player getPlayer(Player requestEntity) {
  
      loggerManager.info(LoggerConstantEnum.SyncRestfulService ,
              "| &lt;AbilitySyncRestfulService&gt; Method: getPlayer " + requestEntity);
  
      loggerManager.info(LoggerConstantEnum.SyncRestfulService , "Id : ", requestEntity.getId());
  
      return requestEntity;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Request xml data</p>
  
  <pre><code>//Request 
  &lt;player&gt;
      &lt;id&gt;1&lt;/id&gt;
      &lt;matches&gt;251&lt;/matches&gt;
      &lt;name&gt;Anand&lt;/name&gt;
  &lt;/player&gt;
  
  //response xml data
  &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
   &lt;player&gt;
      &lt;id&gt;0&lt;/id&gt;
   &lt;/player&gt;
  </code></pre>
  
  <p>//jaxb pojo</p>
  
  <pre><code>@XmlRootElement(name = "player")
  @XmlAccessorType(XmlAccessType.NONE)
  public class Player {
  
      private int id;
  
      private String name;
  
      private String matches;
  
      public int getId() {
          return id;
      }
      @XmlElement(name = "id")
      public void setId(int id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
      @XmlElement(name = "name")
      public void setName(String name) {
          this.name = name;
      }
  
      public String getMatches() {
          return matches;
      }
      @XmlElement(name = "matches")
      public void setMatches(String matches) {
          this.matches = matches;
      }
  }
  </code></pre>