title: 500 Internal Server Error When I try to execute web method from different Server IIS
body: <p>I am trying to call a Webmethod by ajax call.The webmethod has been implemented in to a .asmx file.When I publish the project and deploy in my local server IIS. Then the webmethod successfully executed from my local IIS .But when I deploy the same published version into different server IIS and try to access the Webmethod then I am getting "500 Internal Server Error".</p>
  
  <p>I Cannot not understand why the same code behaving different.What mistake I am doing please suggest.</p>
  
  <p>The code has been written as follows -</p>
  
  <p>Code in .cshtml file </p>
  
  <pre><code>$.ajax({
    type: "POST",
    url: "/Root/Shared/CommonServices.asmx/SubmitRequestInterface2",
    data: 
      { 'fromDate': $("#txtBeginData").val(), 
        'toDate':$("#txtEndDate").val()
      },
    contentType: 'application/json; charset=utf-8',
    dataType: "json",
    success: function (res) {
      alert(res.children[0].innerHTML);
    }
  });
  </code></pre>
  
  <p>Code in CommonServices.asmx</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = true)]
  public string SubmitRequestInterface2(string fromDate, string toDate)
      {
          try
          {
              //string fromDate = 
  Convert.ToString(System.Web.HttpContext.Current.Request.Params["fromDate"]);
              //string toDate = 
  Convert.ToString(System.Web.HttpContext.Current.Request.Params["toDate"]);
              ClsProcess objProcess = new ClsProcess();
              objProcess.Process(fromDate, toDate);
          }
          catch (Exception ex)
          {
  
              throw;
          }
  
          return "Hello World";
      }
  </code></pre>
  
  <p>Thanks</p>