accept input xml with namespace into jaxb using Pojo in SpringBoot

I am posing an xml to my springboot application and receiving it into a Pojo Jaxb and returning a response . I am able to do this successfully , however if i pass xml with namespace i am getting response code as 406 and response body as no content . I tried various ways to add namespace in my Pojo and even tried adding it in package-info but i am unable to find a way to get it working , Please advice . Below is the working example with a simple xml without namespace


package com.stack.overflow.myapp.POJOs;

import javax.xml.bind.annotation.XmlAttribute;  
import javax.xml.bind.annotation.XmlElement;  
import javax.xml.bind.annotation.XmlRootElement;  

@XmlRootElement(name = "Employee")
public class Employee {  
    private int id;  
    private String name;  
    private float salary;  

public Employee() {}  
public Employee(int id, String name, float salary) {  
super(); = id; = name;  
this.salary = salary;  
public int getId() {  
    return id;  
public void setId(int id) { = id;  
@XmlElement  //(namespace="")
public String getName() {  
    return name;  
public void setName(String name) { = name;  
public float getSalary() {  
    return salary;  
public void setSalary(float salary) {  
         this.salary = salary;  

Below is my Controller method which is getting values from the xml via POJO

@RequestMapping(value = { "/myURL" }, method = RequestMethod.POST, consumes = { "application/xml" })

public ResponseEntity<?> postMethodXMLreturnXML(@RequestBody Employee list) {  
    try {

        Employee FirstValue=list;
        System.out.println("SOP : post Method started . Name " + FirstValue.getName());     

        return new ResponseEntity<Object>(Employee , HttpStatus.CREATED);
    } catch (Exception e) {
        return (new ResponseEntity<String>(ErrorCodes.SERVER_ERROR.getDescription(),

Below is the xml which i post to this and get desired output with valid response code and response message

Input post xml

<?xml version="1.0"?>

But i want now to pass below xml , and when i pass below xml to this code i get response code 406 and no content , Tried adding namespace in pojo and even tried adding code to package info, Please advice
Thanks in advance

<?xml version="1.0"?>