title: WCF generated proxy throws InvalidOperationException due to multiple types with same name in WSDL
body: <p>I'm using Visual Studio 2013 to generate a WCF service proxy from <a href="http://services.hotschedules.com/api/services/SalesService?wsdl">this WSDL file</a>. However, as soon as I try to call the <code>setSalesItemsV3</code> method, WCF throws an <code>InvalidOperationException</code> from deep in <code>System.Xml.dll</code>.</p>
  
  <p>This sample project demonstrates the problem: <a href="https://github.com/jennings/WsdlDuplicateNameProblem">https://github.com/jennings/WsdlDuplicateNameProblem</a></p>
  
  <p>This is the inner exception:</p>
  
  <blockquote>
    <p><strong>Message:</strong> The top XML element 'start' from namespace '' references distinct types WsdlDuplicateName.SalesItemService.hsSimpleDate and System.DateTime. Use XML attributes to specify another XML name or namespace for the element or types.</p>
  </blockquote>
  
  <p>I'm no expert at reading WSDL, but I've looked at it and the only sections that reference the name "start" are a few <code>&lt;wsdl:part&gt;</code> elements with <code>name="start"</code>:</p>
  
  <pre><code>&lt;wsdl:message name="setSalesItems"&gt;
    &lt;wsdl:part name="start" type="xsd:dateTime"&gt;&lt;/wsdl:part&gt;
  &lt;/wsdl:message&gt;
  
  &lt;wsdl:message name="setSalesItemsV3"&gt;
    &lt;wsdl:part name="start" type="tns:hsSimpleDate"&gt;&lt;/wsdl:part&gt;
  &lt;/wsdl:message&gt;
  </code></pre>
  
  <p>But, the parts are in completely different messages, so I don't see why there should be any confusion. I've run the WSDL file through several online WSDL validators and they seem to be okay with it.</p>
  
  <p>Below is the only code in the project necessary to reproduce the problem (besides the generated proxy).</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          SalesServiceClient client = new SalesServiceClient();
          var date = ToSimpleDate(new DateTime());
  
          // throws InvalidOperationException
          // Message == "There was an error reflecting 'start'."
          client.setSalesItemsV3(1, 1, null, date, date);
      }
  
      static hsSimpleDate ToSimpleDate(DateTime time)
      {
          return new hsSimpleDate
          {
              year = time.Year,
              month = time.Month,
              day = time.Day,
          };
      }
  }
  </code></pre>