SPServices: SocialDataService Web Service and Anonymous Access
Today is “SPServices and anonymous mode” day around these parts, it seems. I figure I’ll keep the posts coming on these topics today because for some reason I’ve gotten a string of questions about it.
Here’s another question, edited a little bit to work here on the blog:
We have built a web part that pulls back user comments based on a SP2010 URL using SPServices 0.5.8 GetCommentsOnUrl method [SPServices documentation page and the MSDN SDK page].
It has been working great with authenticated users but now we are looking at providing anonymous access comments are no longer returned.
Looking in fiddler I can see a 500 error on the call to the webservice /_vti_bin/SocialDataService.asmx and the soap envelope returned contains the following:
<?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> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. ---> Attempted to perform an unauthorized operation.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>I have read the blog with regards anonymous users and the changes put into 0.5.3 release which seems to suggest that read only webservice calls should work ok with anonymous users but…
Any help would be appreciated.
While I’m doing everything I can to make these calls work in anonymous mode, I don’t “own” the underlying Web Services. I just checked the SPServices code, and I’ve got GetCommentsOnUrl set up correctly based on the stuff I explained in my blog post about anonymous access with SPServices.
Unfortunately, I’ve never been able to get any validation from Microsoft that this approach is even valid. Maybe I can parlay my new MVP status into some answers, but I’m not hopeful. There are so many things about the Web Services which are an enigma wrapped in a puzzle. It may well be that the SocialDataService isn’t *supposed* to work anonymously, but I doubt that there’s anything in the SDK which states that.
If there’s anyone at Microsoft reading this who can put me in touch with someone who has answers about the Web Services, I would love to open that channel! I’ll probably also try the MVP discussions that I now have available to me. Hopefully I’ll have some info sometime by going that route, but I have no idea if it’ll work.