1

I am trying to set a list item's rating using SocialDataService.asmx. The POST response indicates success; however, nothing has actually been updated. My guess is that the URL format of the item I am trying to update is somehow not what the web service is expecting. Has anyone had success with this web service/operation?

My code:

attempt 1:

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

attempt 2:

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

The call ends up looking like:

<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>

and the response is:

<?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>
4

1 回答 1

0

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

于 2013-04-16T00:39:03.663 回答