SocialDataService Confused

Oct 19, 2011 at 3:47 PM

I am working with the social data service and the user profile service. The calls to these services are happening asynchronously, but it seems the SocialDataService gets confused if there is still an outgoing request. Here's the javascript code I'm using:

	function GetUserProfileData(loginName, target){
	    var name = loginName;
	    var profile = {};
	    if (name.indexOf("\\") > 0) {
	        var loginParts = loginName.split("\\");
	        name = loginParts[1];
	    	AccountName: name,
	    	async: true,
	    	completefunc: function (data,status){
	    			var $val = $(val);
	    			var name = $val.find("Name").text();
	    			var value = $val.find("Value").text();
	    			profile[name] = value;
                        // calls a function to setup my profile details
    			setProfile(profile, target);

	function getRating(url) {
		var rating = 0;
			operation: "GetRatingOnUrl",
			url: url,
			async: false,
			completefunc: function (data, status) {
				if(status == "success") {
					rating = $(data.responseXML).find("Rating").text();
		return rating;

These two calls happen pretty quickly behind one another, and the response I see in firebug is:

<?xml version="1.0" encoding="utf-8"?>
   <soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
            <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring>
            <detail />

And here is the post sent via SPServices:

<envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<getuserprofilebyname xmlns="">
Any ideas?

Oct 19, 2011 at 4:01 PM

Odd, this behavior only shows up in FireFox. IE8 works fine.

Oct 23, 2011 at 3:01 AM


Have you tried this asynchronously just to make sure it will work that way? Also, in the post you show above, it looks like you're passing the url to GetUserProfileByName rather than the account. It doesn't seem to match what your code is doing, so I'm not sure what's going on.


Oct 24, 2011 at 2:32 PM


I know it appears that way, but I am not passing the url to the GetUserProfileByName method - it appears that a race condition is resetting the configuration object -- I changed the order of the various calls I'm doing where all the synchronous calls occur prior to any asynch operation and they execute fine without resetting any variables. It only appears to occur when an asynch operation is in process and then a synchronous operation occurs before the asynch one completes.