title: wsimport and WSDL with duplicate variables
body: <p>I'm trying to run wsimport against a WSDL file that I cannot modify.  A portion of the WSDL looks like this:</p>
  
  <pre><code>&lt;xsd:complexType name="Bapiitemex"&gt;
      &lt;xsd:sequence&gt;
          &lt;xsd:element name="ItmNumber" type="n0:numeric6"/&gt;
          &lt;xsd:element name="PoItmNo" type="n0:char6"/&gt;
          &lt;xsd:element name="Material" type="n0:char18"/&gt;
          &lt;xsd:element name="MatEntrd" type="n0:char18"/&gt;
          &lt;xsd:element name="ShortText" type="n0:char40"/&gt;
          &lt;xsd:element name="NetValue" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Currency" type="n0:cuky5"/&gt;
          &lt;xsd:element name="Subtotal1" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Subtotal2" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Subtotal3" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Subtotal4" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Subtotal5" type="n0:numeric15"/&gt;
          &lt;xsd:element name="Subtotal6" type="n0:numeric15"/&gt;
          &lt;xsd:element name="SUBTOTAL1" type="n0:decimal23.4"/&gt;
          &lt;xsd:element name="SUBTOTAL2" type="n0:decimal23.4"/&gt;
          &lt;xsd:element name="SUBTOTAL3" type="n0:decimal23.4"/&gt;
          &lt;xsd:element name="SUBTOTAL4" type="n0:decimal23.4"/&gt;
          &lt;xsd:element name="SUBTOTAL5" type="n0:decimal23.4"/&gt;
          &lt;xsd:element name="SUBTOTAL6" type="n0:decimal23.4"/&gt;
      &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p>wsimport is unhappy due to the inclusion of multiple elements which differ only in case ('Subtotal1' versus 'SUBTOTAL1', etc.).  The specific error is</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: trying to create the same field twice: subtotal1</p>
  </blockquote>
  
  <p>In researching a solution to this problem, I tried running wsimport with the '-B-XautoNameResolution' option, but that had no effect.  It seems the only other possible solution is to use an external binding file to explicitly tell wsimport how to name the variables.  However, I'm having difficulty making that work as well.  Here is the binding file I'm attempting to use just for one of the duplicate variables:</p>
  
  <pre><code>&lt;jxb:bindings version="1.0"
  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;jxb:bindings node="//xsd:complexType[@name='Bapiitemex']//xsd:element[@name='Subtotal1']"&gt;
      &lt;jxb:property name="testSubtotal1"/&gt;
  &lt;/jxb:bindings&gt;
  </code></pre>
  
  <p></p>
  
  <p>Try as I might, wsimport doesn't seem to understand what I'm asking it to do.  It's unhappy with the XPath syntax I'm using for the 'node' attribute, returning the error:</p>
  
  <blockquote>
    <p>XPath evaluation of "//xsd:complexType[@name='Bapiitemex']//xsd:element[@name='Subtotal1']" results in empty target node</p>
  </blockquote>
  
  <p>Suggestions as to how I can persuade wsimport to generate my Java classes for me?</p>