title: SOAP with Entity class
body: <p>I have this Entity class:</p>
  <pre><code>package com.model;
  
  import javax.persistence.Column;
  import javax.persistence.EmbeddedId;
  import javax.persistence.Entity
  import com.model.BaseEntity;
  import com.model.CustomerPK;
  
  @Entity
  @Table(name = &quot;CUSTOMER&quot;)
  public class Customer extends BaseEntity {
      
      private static final long serialVersionUID = -625869124375935833L;
      
      @EmbeddedId
      private CustomerPK id;
      
      @Column(name = &quot;NAME&quot;, length = 70, nullable = true)
      private String name;
      
      @Column(name = &quot;PHONE&quot;, length = 20, nullable = true)
      private String phone;
      
      @Column(name = &quot;ADDRESS&quot;, length = 40, nullable = true)
      private String address;
      
      @Column(name = &quot;CITY&quot;, length = 30, nullable = true)
      private String city;
      
      ....
      
  }
  </code></pre>
  <p>And I have this Web Service class:</p>
  <pre><code>package com.ws;
  
  import javax.inject.Inject;
  import javax.jws.WebMethod;
  import javax.jws.WebService;
  import javax.xml.bind.annotation.XmlElement;
  import com.servico.WSService;
  
  import com.model.Customer;
  
  
  @WebService(serviceName = &quot;customerWS&quot;)
  public class CustomerWS {
  
      @Inject
      private WSService wss;
  
      @WebMethod(operationName = &quot;validateCustomer&quot;)
      public List&lt;String&gt; validateCustomer(
              @XmlElement(name = &quot;customer&quot;, required = true) Customer customer) {
          return wss.validateCustomer(customer);
      }
  }
  </code></pre>
  <p>When I try to start the service this error is shown:</p>
  <pre><code>Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
  Two classes have the same XML type name &quot;{http://--.--.-----.-----.-----.----.----.--/}baseEntity&quot;. Use @XmlType.name and @XmlType.namespace to assign different names to them.
      this problem is related to the following location:
          at ------.BaseEntity
          at ------.model.BaseEntity
  
      this problem is related to the following location:
          at ------.model.BaseEntity
      
  </code></pre>
  <p>I cannot edit the BaseEntity class. Is there a way to create the Web Service without annotate the BaseEntity class?</p>
  <h2><strong>EDIT:</strong></h2>
  <p>I don't want to use MOXy framework because I already have the Web Service online. My througs is if I can marshaller only the Customer class, without her BaseEntity class.
  Additional info: My client and my Web Service have access to the same package where Customer class is located.</p>