SharePoint Web Services. Using UserPofileService.GetUserProfileByName. After SP upgrade... failing.

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2010-05-21T18:34:44Z Indexed on 2010/05/24 18:01 UTC
Read the original article Hit count: 763

Filed under:
|

The below web services code has worked properly for me for over a year. We have updated our SharePoint servers, and now the below code throws an exception (at the bottom line of code) "Object reference not set to an instance of an object"

UserProfileWS.UserProfileService userProfileService = new UserProfileWS.UserProfileService();

userProfileService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

string serviceloc = "/_vti_bin/UserProfileService.asmx";
userProfileService.Url = _webUrl +  serviceloc;

UserProfileWS.PropertyData[] info = userProfileService.GetUserProfileByName(null);

EDIT: The service is still there. I browse http:///_vti_bin/UserProfileService.asmx, and the information for the service is still there, including the full description of the GetUserProfileByName call.

EDIT2: This does appear to be due to a change in SharePoint. I loaded a previous version of my software (known to be working), and it exhibits the same erroneous behavior.

© Stack Overflow or respective owner

Related posts about web-services

Related posts about sharepoint