I'm trying to retrieve a user's profile picture from the hidden User Information List within Silverlight. I can't use the UserProfileService.asmx because I don't have the login name nor the GUID of the user. I do have the user's ID (matching the ID field of this list) and the user's display name (as: "FirstName LastName"), because I have this data from a FieldUserValue (blog author). I have tried to rewrite this function by passing the ID, by using Linq, by calling Load() on every intermediary object (which should be unnecessary), by calling GetItemByID(int ID), by pulling the list by name (GetListByName("User Information List")) as opposed to using Web.SiteUserInfoList... and I'm stuck. None are working.
ListItemCollection licAuthors; //<=== Global, should only return 1 user, but
// the query returns a collection anyhow
private void GetUserLogin(string strUserName)
{
ClientContext ctx = new ClientContext("http://mydevsite/");
CamlQuery cqUserName = new CamlQuery();
cqUserName.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' />" +
"<Value Type='String'>" + strUserName + "</Value></Eq></Where></Query>" +
"<ViewFields><FieldRef Name='Title'/><FieldRef Name='Picture'/>" +
"</ViewFields></View>";
licAuthors = ctx.Web.SiteUserInfoList.GetItems(cqUserName);
ctx.Load(licAuthors);
ctx.ExecuteQueryAsync((s, e) => { getbloginfoFinished.Set(); },
(s, e) => { getbloginfoFinished.Set(); });
}
Is this some kind of permissions issue because it's Silverlight? My user login has all permissions possible to access this list.
Should I be using the /_vti_bin/Lists.asmx web service?
Is pulling this information from this list going to cause permissions issues for users without full permissions?
Any help would be appreciated.
The information sources I've used thus far to try to achieve this are:
http://www.zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list
To summarize:
My end goal is to retrieve the url to a user's profile picture, given a FieldUserValue ("Created By") of a blog post, from a blog site, which is pulled from the "Posts" list.