title: maven-jaxb plugin - Two classes have the same XML type name
body: <p>Following problem, I have 2 WSDL files which from I have to generate Stubs. But both WSDL files contains same XML type names (second WSDL is a further stage of first WSDL).</p>
  
  <p>I generate the stubs with following configuration:</p>
  
  <pre><code>    &lt;plugins&gt;
      ..
          &lt;plugin&gt;
              &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.7.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;ws-source-gen-phase1&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;removeOldOutput&gt;true&lt;/removeOldOutput&gt;
                          &lt;extension&gt;true&lt;/extension&gt;
                          &lt;schemaDirectory&gt;src/main/resources/META-INF/schema/xyz/&lt;/schemaDirectory&gt;
                          &lt;args&gt;
                              &lt;arg&gt;-wsdl&lt;/arg&gt;
                              &lt;schemaFiles&gt;src/main/resources/META-INF/schema/xyz/Service1.wsdl&lt;/schemaFiles&gt;
                              &lt;arg&gt;-XautoNameResolution&lt;/arg&gt;
                          &lt;/args&gt;
                          &lt;generatePackage&gt;com.xyz.ws&lt;/generatePackage&gt;
                          &lt;generateDirectory&gt;${project.build.directory}/generated-sources/xjc1&lt;/generateDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;ws-source-gen-phase2&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;removeOldOutput&gt;true&lt;/removeOldOutput&gt;
                          &lt;extension&gt;true&lt;/extension&gt;
                          &lt;schemaDirectory&gt;src/main/resources/META-INF/schema/xyz/&lt;/schemaDirectory&gt;
                          &lt;args&gt;
                              &lt;arg&gt;-wsdl&lt;/arg&gt;
                              &lt;schemaFiles&gt;src/main/resources/META-INF/schema/xyz/Service2.wsdl&lt;/schemaFiles&gt;
                              &lt;arg&gt;-XautoNameResolution&lt;/arg&gt;
                          &lt;/args&gt;
                          &lt;generatePackage&gt;com.xyz.ws.phase2&lt;/generatePackage&gt;
                          &lt;generateDirectory&gt;${project.build.directory}/generated-sources/xjc2&lt;/generateDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>This really generates my stubs but if I try to use them with spring-ws I get the error below.</p>
  
  <p>applicationContext.xml:</p>
  
  <pre><code>&lt;bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" /&gt;
  
  &lt;bean id="xyzMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt;
      &lt;property name="contextPath"
          value="com.xyz.ws:com.xyz.ws.phase2" /&gt;
  &lt;/bean&gt;
  &lt;bean id="xyzUnmarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt;
      &lt;property name="contextPath"
          value="com.xyz.ws:com.xyz.phase2" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="xyzServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"&gt;
      &lt;constructor-arg ref="messageFactory" /&gt;
      &lt;property name="marshaller" ref="xyzMarshaller"&gt;&lt;/property&gt;
      &lt;property name="unmarshaller" ref="xyzUnmarshaller"&gt;&lt;/property&gt;
      &lt;property name="defaultUri" value="${ThiemeRightAccessService.URI}" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="XyzServiceClient"
      class="com.ebcont.gtv.radbase.business.service.impl.XyzServiceClientImpl"&gt;
      &lt;constructor-arg ref="xyzServiceTemplate"&gt;&lt;/constructor-arg&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Two classes have the same XML type name "{http://status.ws.xyz.com/}GetXyzObject1". Use 
  @XmlType.name and @XmlType.namespace to assign different names to them.
  ...
  </code></pre>