SOAPMessage.getMessageBody() prints null

Members, I am not able to understand if message.getSOAPBody() is printed as null, then how come unmarshaller.unmarshal(message.getSOAPBody(), Person.class); returns a value to variable jb. Please help me to understand.

String example="<SOAP:Envelope 
xmlns:SOAP=/"http://schemas.xmlsoap.org/soap/envelope//">"
    + "<SOAP:Body>"        
    + "<firstName>Jane</firstName>"
    + "<lastName>Doe</lastName>"        
    + "</SOAP:Body>"
    + "</SOAP:Envelope>";

ByteArrayInputStream  bas=new ByteArrayInputStream(example.getBytes());

try {
  SOAPMessage message = MessageFactory.newInstance().createMessage(null,bas);
  System.out.println(message.getSOAPBody().toString());
  JAXBContext jc = JAXBContext.newInstance(Person.class);
  Unmarshaller unmarshaller = jc.createUnmarshaller();

  System.out.println(message.getSOAPBody()); // this prints null
  System.out.println(message.getSOAPBody().toString()); // this prints null
  JAXBElement<Person> jb = unmarshaller.unmarshal(message.getSOAPBody(), Person.class); // I am not able to undestand if above lines return null, then how come this line populates jb

  Person p = jb.getValue();
  System.out.println(p.firstName); // prints Jane
  System.out.println(p.lastName); // prints Doe
} catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
} catch (SOAPException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}

Here is the output of the program:

[SOAP:Body: null]
[SOAP:Body: null]
[SOAP:Body: null]
Jane
Doe

You are checking wrong method, you should try changing message.getSOAPBody().toString() to message.getSOAPBody().getTextContent() or getChildNodes() etc to validate the message content.

Following is the output with message.getSOAPBody().getTextContent()

[SOAP:Body: null]
[SOAP:Body: null]
JaneDoe
Jane
Doe