【发布时间】:2019-03-02 06:04:32
【问题描述】:
我正在尝试通过 ajax 调用调用 WCF 服务。这是我的 ajax 调用:
$j.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
context: this,
async: false,
url: appServicePath + "Student/GetRolesByUserId",
data: JSON.stringify({ "userId": userId }),
success: this.getRolesByIdResponse,
error: this.getRolesByIdFailure
}
);
当我使用 Fiddler 测试我的服务时,我能够获取我从 ajax 传递其值的用户角色,但是当我从我的应用程序调用服务时,我得到一个错误:405 Method Not Allowed。 我做错了什么?
【问题讨论】:
标签: asp.net ajax rest wcf webforms