javascript - 需要 sharepoint Socialdataservice.asmx 的项目 URL 格式

标签 javascript web-services sharepoint

我正在尝试使用 SocialDataService.asmx 设置列表项的评级。 POST响应表示成功;然而,实际上没有任何更新。我的猜测是,我尝试更新的项目的 URL 格式在某种程度上不是 Web 服务所期望的。有人成功使用此网络服务/操作吗?

我的代码:

尝试1:

var payload = "<url>" + WebFullUrl 
+ "_api/Web/Lists/GetByTitle('Posts')/Items(" + id + ")</url><rating>" 
+ rating + "</rating><title></title><analysisDataEntry></analysisDataEntry>";

尝试2:

var payload = "<url>" + WebFullUrl 
+ "Lists/Posts/DispForm.aspx?ID=" + id + "</url><rating>" 
+ rating + "</rating><title></title><analysisDataEntry></analysisDataEntry>";

调用最终看起来像:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SetRating xmlns="http://microsoft.com/webservices/SharePointPortalServer/SocialDataService">
<url>https:// (site url) /Lists/Posts/DispForm.aspx?ID=2</url>
<rating>4</rating>
<title></title>
<analysisDataEntry></analysisDataEntry>
</SetRating>
</soap:Body>
</soap:Envelope>

响应是:

<?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>
<SetRatingResponse
xmlns="http://microsoft.com/webservices/SharePointPortalServer/SocialDataService">
SetRatingResult>2013-03-27T20:03:33.55</SetRatingResult>
</SetRatingResponse>
</soap:Body>
</soap:Envelope>

最佳答案

我刚刚在类似情况下所做的是使用 FiddlerFirebug并单击 SharePoint 列表中的评级。然后您可以看到 Microsoft 使用的确切 URL。

关于javascript - 需要 sharepoint Socialdataservice.asmx 的项目 URL 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15668589/

相关文章:

javascript - Magento 当价格 = 0 时显示其他消息

javascript - SquishIt : How to minfy CSS files inside asp. 网络默认主题和来自 asp :ScriptManager? 的 Javascript 文件

javascript - 如何通过 Ajax 请求从服务器重定向网站

.net - .Net 4.5 是否支持 XML 1.1(对于 XML 1.0 中无效的字符)?

r - 在 R 中访问共享点文件夹

.net - 在sharepoint中使用SPListCollection.Add方法(字符串,字符串,字符串,字符串,Int32,字符串,SPListTemplate.QuickLaunchOptions)

javascript - 将装饰器转换为 DOJO 中的自定义小部件?

c# - 为什么我会收到 XML 文档中有错误的错误消息?

c# - Xamarin Forms 没有从 Web 服务创建预期的返回类型

javascript - 更改<标签>