title: Web services: method cannot be reflected exception
body: <p>When trying to create an instance of a service, I'm getting a </p>
  
  <blockquote>
    <p>"Method cannot be reflected"</p>
  </blockquote>
  
  <p>exception. Digging deeper down in the inner exceptions reveals:</p>
  
  <blockquote>
    <p>"Types 'WebServiceClient.com.compamy.string1' and
    'WebServiceClient.com.company.string' both use the XML type name,
    'string', from namespace 'http://www.w3.org/2001/XMLSchema'. Use XML
    attributes to specify a unique XML name and/or namespace for the
    type."</p>
  </blockquote>
  
  <p>What does the damn thing want from me? It is code auto generated by VS2010...why do I have to fiddle with it?</p>
  
  <p>Here are the two types:</p>
  
  <pre><code>[GeneratedCode( "System.Xml", "4.0.30319.233" )]
  [Serializable]
  [DebuggerStepThrough]
  [DesignerCategory("code")]
  [XmlType(TypeName = "string", Namespace = "http://www.w3.org/2001/XMLSchema")]
  [XmlRoot("FileName", Namespace = "http://company.com/api3/Content/Download/", IsNullable = true)]
  public partial class string1 : SoapHeader
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[GeneratedCode("System.Xml", "4.0.30319.233" )]
  [Serializable]
  [DebuggerStepThrougt]
  [DesignerCategory("code")]
  [XmlTypeAttribute(Namespace = "http://www.w3.org/2001/XMLSchema")]
  [XmlRootAttribute("SessionKey", Namespace = "ns", IsNullable = true)]
  public partial class @string : SoapHeader
  </code></pre>