1
我想使用SocialDataService.asmx設置列表項目的評級。 POST迴應表明成功;然而,實際上沒有更新。我的猜測是,我嘗試更新的項目的URL格式不知道Web服務期望的是什麼。有沒有人通過這個Web服務/操作獲得成功?需要SharePoint項目的URL格式socialdataservice.asmx
我的代碼:
嘗試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>