title: How do you marshall a parameterized type with JAX-WS / JAXB?
body: <p>Consider the following classes (please assume public getter and setter methods for the private fields).</p>
  
  <pre><code>// contains a bunch of properties
  public abstract class Person { private String name; }
  
  // adds some properties specific to teachers
  public class Teacher extends Person { private int salary; }
  
  // adds some properties specific to students
  public class Student extends Person { private String course; }
  
  // adds some properties that apply to an entire group of people
  public class Result&lt;T extends Person&gt; {
     private List&lt;T&gt; group;
  
     private String city;
     // ...
  }
  </code></pre>
  
  <p>We might have the following web service implementation annotated as follows:</p>
  
  <pre><code>@WebService
  public class PersonService {
  
      @WebMethod
      public Result&lt;Teacher&gt; getTeachers() { ... }
  
      @WebMethod
      public Result&lt;Student&gt; getStudents() { ... }
  }
  </code></pre>
  
  <p>The problem is that JAXB appears to marshall the Result object as a <code>Result&lt;Person&gt;</code> instead of the concrete type. So the Result returned by getTeachers() is serialized as containing a <code>List&lt;Person&gt;</code> instead of <code>List&lt;Teacher&gt;</code>, and the same for getStudents(), mutatis mutandis.</p>
  
  <p>Is this the expected behavior? Do I need to use @XmlSeeAlso on Person?</p>
  
  <p>Thanks!</p>
  
  <p>LES</p>