title: WebResult vs RequestWrapper Annotations with Polymophism
body: <p>I have a class such as the following:</p>
  
  <pre><code>@XmlRootElement(namespace = "http://foo.com/model", name = "Person")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(namespace = "http://foo.com/model", name = "Person"
  public abstract Person {
  }
  </code></pre>
  
  <p>And two classes that inherit from that:</p>
  
  <pre><code>@XmlRootElement(namespace = "http://foo.com/model", name = "ShortPerson")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(namespace = "http://foo.com/model", name = "ShortPerson"
  public ShortPerson extends Person {
  }
  
  @XmlRootElement(namespace = "http://foo.com/model", name = "TallPerson")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(namespace = "http://foo.com/model", name = "TallPerson"
  public TallPerson extends Person {
  }
  </code></pre>
  
  <p>Then I have an SEI as such:</p>
  
  <pre><code>@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED, use = SOAPBinding.Use.LITERAL, style = SOAPBinding.Style.DOCUMENT)
  @WebService(targetNamespace = "http://foo.com/services")
  public interface PersonService {
      @RequestWrapper(localName = "getPersonById", className = "com.foo.services.personService.GetPersonById", targetNamespace = "http://foo.com/services")
      @ResponseWrapper(localName = "getPersonByIdResponse", className = "com.foo.services.personService.GetPersonByUidResponse", targetNamespace = "http://foo.com/services")
      @WebResult(targetNamespace = "http://foo.com/model", name = "Person")
      Person getPersonById(
          @WebParam(targetNamespace = "http://foo.com/services", name = "PersonId") Long personId);
  
  }
  </code></pre>
  
  <p>And my response wrapper class looks as such:</p>
  
  <pre><code>@XmlRootElement(name = "getPersonByIdResponse", namespace = "http://foo.com/services")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "getPersonByIdResponse", namespace = "http://foo.com/services", propOrder = { "person" })
  public class GetPersonByIdResponse {
  
     @XmlElementRefs( {
          @XmlElementRef(name = "TallPerson", type = TallPerson.class, namespace = "http://foo.com/model"),
          @XmlElementRef(name = "SmallPerson", type = SmallPerson.class, namespace = "http://foo.com/model")
  
     })
     private Person person;
  
     public Person getPerson() {
        return person;
     }
  
     public void setPerson(Person person) {
        this.person = person;
     }
  </code></pre>
  
  <p>}</p>
  
  <p>So the issue here is that if I test the ResponseWrapper via JAXB directly and populate a TallPerson object, I correctly marshal that object into the XML that is specific to TallPerson (and the same works for SmallPerson).</p>
  
  <p>The problem is when I deploy this in a war and service enable it, when a result is returned for TallPerson, I receive nothing from the web service call except an empty message.  In fact, I don't even receive the response wrapper root XML element of &lt;getPersonByIdResponse&gt;.</p>
  
  <p>So my issue is if I have a polymorphic request or response object (in this case a response object), how does the WebResult name/targetnamespace effect the params within the ResponseWrapper.  Because in my case I am utilizing the XmlElementRefs to correctly marshal my base object Person into either TallPerson or SmallPerson, but how does this relate to the namespace/name of the parent class Person on the WebResult?  I am not sure if a conflict is causing the XML response to not get produced.</p>
  
  <p>Thanks</p>