需要sharepoint socialdataservice.asmx的项目URL格式

时间:2013-03-27 20:18:26

标签: 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>

1 个答案:

答案 0 :(得分:0)

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