3

I'm putting in place a webservice in a "bottom-to-top" (contract-last) style.

I have the following web method:

@WebMethod
void addPerson(Person person);

Where Person is a simple POJO :

class Person {
   String firstName;
   String lastName;
   // Getters and setters
}

Everything works fine. Question : why in many tutorials many people add the XmlRootElement annotation and implements the Serializable interface ? Why my model works out of the box without having to write it like this ?

@XmlRootElement
class Person implements Serializable {
   String firstName;
   String lastName;
   // Getters and setters
}

Regards

Pato
  • 41
  • 2

0 Answers0