Wednesday, September 21, 2011

SharePoint 2010 Page Rating using Social Data Service (SocialDataService.asmx)

To retrieve social data stored in SharePoint we can use Social Data Service. The web services are located at ISAPI folder found under {Sharepoint Root}. If you site url is http://anmol-pc/ then the SocialDataService url would be http://anmol-pc/_vti_bin/socialdataservice.asmx









You can see lot of functionality exposed, but in this Post I will explain "GetRatingOnUrl". First create Console Application project in Visual Studio. Add reference to socialdataservice.asmx service and add code as mentioned below.


ServiceReference1.SocialDataService _SocialDataService =
            new ServiceReference1.SocialDataService();


_SocialDataService.Credentials =
            System.Net.CredentialCache.DefaultCredentials;


_SocialDataService.Url =  "http://anmol-pc/_vti_bin/socialdataservice.asmx";

SocialRatingDetail _SocialRatingDetail =
           _SocialDataService.GetRatingOnUrl(
http://anmol-pc/Pages/MyPage.aspx);

string rating = _SocialRatingDetail.Rating.ToString();



No comments:

Post a Comment

Popular Posts