title: asmx service operation results in document not found
body: <p>So I am pulling my hair out over this. Environment: ASP.net web form C# 2008.
  I already have <a href="https://stackoverflow.com/questions/5438693/asmx-operation-404s-but-asmx-service-description-doesnt-url-routing-issue">this</a> solution in place.
  I created an asmx webservice like the following (see code) and I am trying to access it via the browser. Basically when I point to <a href="http://localhost/service.asmx" rel="nofollow noreferrer">http://localhost/service.asmx</a> it works fine and I can see the available operations and stuff.. I can also see operation in detail at the url <a href="http://localhost/service.asmx?op=MethodName" rel="nofollow noreferrer">http://localhost/service.asmx?op=MethodName</a> but the problem comes when I actually try the service or invoke. I get <a href="http://localhost/service.asmx/MethodName" rel="nofollow noreferrer">http://localhost/service.asmx/MethodName</a> is not found.
  Any idea what could be going wrong?</p>
  
  <pre><code>[WebService(Namespace = "http://locahost/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.ComponentModel.ToolboxItem(false)]
  // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
  [System.Web.Script.Services.ScriptService]
  public class WellnessService : System.Web.Services.WebService
  {
  
      [WebMethod]
      public string MethodName()
      {
          return ViewManager.RenderView("~/Modules/CouponsPromotions/CouponCenter.ascx");
      }
  }
  public class ViewManager
  {
      public static string RenderView(string path)
      {
          return RenderView(path, null);
      }
  
      public static string RenderView(string path, object data)
      {
          Page pageHolder = new Page();
          UserControl viewControl = (UserControl)pageHolder.LoadControl(path);
  
          if (data != null)
          {
              Type viewControlType = viewControl.GetType();
              FieldInfo field = viewControlType.GetField("Data");
  
              if (field != null)
              {
                  field.SetValue(viewControl, data);
              }
              else
              {
                  throw new Exception("View file: " + path + " does not have a public Data property");
              }
          }
  
          pageHolder.Controls.Add(viewControl);
  
          StringWriter output = new StringWriter();
          HttpContext.Current.Server.Execute(pageHolder, output, false);
  
          return output.ToString();
      }
  }
  </code></pre>
  
  <p>This is how I am calling via JS</p>
  
  <pre><code>$(document).ready(function() {
  $('#liCoupons').click(function() {
          $.ajax({
              type: "POST",
              url: "/services.asmx/MethodName",
              data: "", 
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
                  $('#result').html(msg.d);
              },
              error: ajaxFailed
              //error
  
          });
      });
  
      function ajaxFailed(xmlRequest) {
          alert(xmlRequest.status + ' \n\r ' +
                xmlRequest.statusText + '\n\r' +
                xmlRequest.responseText);
      }
  });  
  </code></pre>