C# 对asmx服务的AJAX请求出现错误500“;处理请求时出错。”;

C# 对asmx服务的AJAX请求出现错误500“;处理请求时出错。”;,c#,jquery,ajax,sharepoint-2010,asmx,C#,Jquery,Ajax,Sharepoint 2010,Asmx,我对下面的ajax请求有一个问题,它工作得很好,但是在另一个虚拟机上。由于简单的原因,我将示例保持简单 这是我的带有GetData方法的asmx Web服务: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.Toolb

我对下面的ajax请求有一个问题,它工作得很好,但是在另一个虚拟机上。由于简单的原因,我将示例保持简单

这是我的带有GetData方法的asmx Web服务:

        [WebService(Namespace = "http://tempuri.org/")]
            [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
            [System.ComponentModel.ToolboxItem(false)]
            [ScriptService]
            class CpmService
            {
                [WebMethod]
                [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
                public object GetData(string WebId)
                {  return new{Result = result};   }
            }
还有AJAX请求:

 $.ajax({
                type: "POST",
                url: serviceURL + "/GetData",
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                data:  '{"":""}', //'{"WebId":"'  + curWeb.get_id() +'"}',
                success: doFirst,
                error: doSecond
    });
只执行错误处理程序doSecond,但从不执行doFirst方法。错误消息是:

{Message: "There was an error processing the request.", StackTrace: "", ExceptionType: ""}
我的尝试(没有成功):

  • 重新格式化AJAX请求“{”“:”“}”或{“WebId”:“+curWeb.get_id()+”}”或“{}”等的数据参数
  • 从web服务方法GetData中删除
    UseHttpGet=false
    属性
  • 在Stackoverflow中搜索解决方案

已经有一段时间了,但我认为webMethods必须是静态的。感谢Scott,我发现了这个DiskUsion,根据它,静态方法在ASMX Web服务中不可用@user615993如果您登录到web服务器,您应该能够在应用程序日志(在服务器管理器的“诊断”下)中找到相应的ASP.NET错误。感谢您的建议。遗憾的是,SharePoint ULS日志查看器和服务器管理器事件查看器中都没有错误消息。