【发布时间】:2018-12-05 22:42:19
【问题描述】:
我需要 Sharepoint 方面的帮助。我尝试了多种方法从列表中检索数据,但几乎没有成功,经过大量阅读和搜索,我仍然没有进一步的进展。
我正在使用另一个用户制作的列表,我可以从中添加、编辑和删除项目。使用 SPServices 调用此列表时,我似乎碰壁了。这是我第三次尝试访问该列表,现在我收到了404 响应,responsetext 为空。
URL 是正确的,因为它实际上加载了值列表。
如果我有一个空的 webURL 参数,responsetext 的参数有一个有用的 SOAP 响应,说明如下:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
List does not exist.
The page you selected contains a list that does not exist. It may have been deleted by another user.
</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode></detail></soap:Fault></soap:Body></soap:Envelope>
这是我的调用,当我将 webURL 定义为指向列表时,无论 URL 是什么,它总是返回带有 responseText=null 的 http 404。这不是很有帮助。我指向的 URL 会加载列表。
function getListItems_RFC(){
var url = $().SPServices.SPGetCurrentSite() +
"/_vti_bin/listdata.svc/RFCExtract";
console.log("getListItems_RFC() "+ url);
$().SPServices({
operation: "GetListItems",
webURL: url,
async: false,
listName: "RFC Extract",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc:
function (xData, Status) {
console.log(Status); //outputs error
console.log(xData); //outputs array responseText:null and status:404
$(xData.responseXML).SPFilterNode("m:properties").each(function() {
var liHtml = "<li>" + $(this).attr("d:Title") + "</li>";
$("#debug").append(liHtml);
});
}
});
};
我已经以各种可能的方式修改了网址:
var url = $().SPServices.SPGetCurrentSite() +
"/_vti_bin/listdata.svc/"; //responseText=null, status:404
var url = $().SPServices.SPGetCurrentSite();//responseText=null, status:404
var url = "" //responseText=soapresponse above, status:500
为什么这不起作用???我做错了什么???
【问题讨论】:
标签: sharepoint permissions sharepoint-2010 spservices