title: Cannot set service name attribute in web.config for WCF web service
body: <p>I have a WCF web service I wrote which works fine, I then copied the contents of the web service from another application and created a new WCF file which created a new  in web.config but the name attribute says the namespace cannot be found.</p>
  
  <p>Here is an example of the first few lines of my WCF:</p>
  
  <pre><code>namespace Testing.ws.mainGrid
  {
      [WebService(Namespace = "")]
      [ScriptService]
      [ToolboxItem(false)]
      [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
      public class Test : WebService
      {
          [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
          [WebMethod]
          public void GetRecords()
          {
              ((NameValueCollection)new WebClient().Headers).Add("accept", "text/xml");
              string str1 = "1";
              string str2 = "1";
              string str3 = "1";
  </code></pre>
  
  <p>Here is my web.config:</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
          &lt;services&gt;
              &lt;service name="Testing.ws.getStaffTree"&gt;
                  &lt;endpoint address="" behaviorConfiguration="Testing.ws.getStaffTreeAspNetAjaxBehavior"
                      binding="webHttpBinding" contract="Testing.ws.getStaffTree" /&gt;
              &lt;/service&gt;
              &lt;service name="Testing.ws.mainGrid.Test"&gt;
                  &lt;endpoint address="" behaviorConfiguration="Testing.ws.mainGridAspNetAjaxBehavior"
                      binding="webHttpBinding" contract="Testing.ws.mainGrid" /&gt;
              &lt;/service&gt;
          &lt;/services&gt;
  </code></pre>
  
  <p>Basically <code>name="Testing.ws.mainGrid.Test"</code> does not work and it cannot find it.</p>
  
  <p>I'm not sure what i'm doing wrong but i've spent ages on this! This first  works fine but its the second one with the issue.</p>
  
  <p>The actual error is:</p>
  
  <blockquote>
    <p>the 'name' attribute is invalid - The value Testing.ws.mainGrid.Test is invalid according to its datatype 'serviceNameType' - The enumeration constraint failed</p>
  </blockquote>
  
  <p>If you let intellisense do its work then it displays the first web service but not my new one!</p>