title: JAXB Customizations With a Poorly Formed WSDL
body: <p>This is driving me insane. I have a schema embedded within a WSDL that needs customization because WSIMPORT is throwing the following error</p>
  
  <pre><code>[ERROR] Complex type and its child element share the same name "DomainsMap".
  Use a class customization to resolve this conflict.
  line 878 of file:/C:/jaxws-ri/bin/ArtesiaWebServices.wsdl
  </code></pre>
  
  <p>1) I have no control over this WSDL as I am building a WSDL first client and I expect it to go over revisions w/o any formal consultation or release to me.
  2) It is not acceptable any longer to manually fix this naming collision because I need to include the construction of stubs into an automated build chain. </p>
  
  <p>I must use an external customization file. I just can't seem to figure out how to get the customization to work.</p>
  
  <p>Here is the offending WSDL fragment:</p>
  
  <pre><code>&lt;wsdl:definitions&gt;
      &lt;wsdl:types&gt;
         &lt;xs:schema&gt;
          .
          .
          .
         &lt;xs:complexType final="extension restriction" name="domainsMap"&gt;
           &lt;xs:sequence&gt;
             &lt;xs:element name="domainsMap"&gt;
               &lt;xs:complexType&gt;
                 &lt;xs:sequence&gt;
                   &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="entry"&gt;
                     &lt;xs:complexType&gt;
                       &lt;xs:sequence&gt;
                         &lt;xs:element minOccurs="0" name="key" type="xs:string"/&gt;
                          &lt;xs:element minOccurs="0" name="value" type="tns:domainValueMap"/&gt;
                       &lt;/xs:sequence&gt;
                     &lt;/xs:complexType&gt;
                   &lt;/xs:element&gt;
                 &lt;/xs:sequence&gt;
               &lt;/xs:complexType&gt;
             &lt;/xs:element&gt;
           &lt;/xs:sequence&gt;
         &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>This would be a great chance for you to flex your JAXB skills. Any help would be greatly appreciated.</p>
  
  <p>I've been staring at the jaxb documentation for hours and still no luck. I can offer the entire WSDL if need be. Can anyone help? </p>