title: C#.NET Generating web service reference using WSDL (from XML schema) problem
body: <p>I am using VS2010 and using the "add service reference" feature, to generate client classes from my WSDL. I am having a problem with one of my elements, which is defined in the WSDL as follows:</p>
  
  <pre><code>&lt;xs:simpleType name="NumberType"&gt;
      &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="ONE" /&gt; 
          &lt;xs:enumeration value="TWO" /&gt; 
          &lt;xs:enumeration value="THREE" /&gt; 
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>This type is used in one of my elements like this:</p>
  
  <pre><code>&lt;xs:element name="NumberTypes"&gt;
      &lt;xs:simpleType&gt;
          &lt;xs:list itemType="tns:NumberType" /&gt; 
      &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>The problem is that VS is converting this particular element to a string type, when it should be an enumeration. so it converts it to a string NumberTypes which has a get method returning numberTypesField also of type string.</p>
  
  <p>I think the problem is related to the fact that my schema NumberTypes element uses the xs:list, with 'itemType' attribute. if I change this to xs:element with type="tns:NumberType" attribute instead then the enumeration is generated as it should be.</p>
  
  <p>So how can I make the enumeration work with xs:list? Why is it not converting correctly in the first place?</p>
  
  <p>Thanks for any help.</p>