【发布时间】:2017-07-05 13:51:53
【问题描述】:
我正在尝试编写一个 ajax 调用以使用 Lists.asmx 从 SharePoint 检索列表项
即使我正确地遵循了格式,我仍然收到302 错误。我错过了什么吗?
代码
function makeSoapCall(listName){
var soapEnv =
"<?xml version='1.0' encoding='utf-8'?> " +
"<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'> " +
"<soap12:Body> " +
"<GetList xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
"<listName>Webpostings Approvers</listName> " +
"</GetList> " +
"</soap12:Body> " +
"</soap12:Envelope>";
$.ajax({
url: "http://webpub.ex.com/_vti_bin/Lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
contentType: "application/soap+xml; charset=utf-8"
});
}
回应
http://webpub.ex.com/_layouts/error.aspx?ErrorText=Request format is unrecognized.
【问题讨论】:
标签: jquery ajax web-services sharepoint sharepoint-2010