Update user password fails

57 views
Skip to first unread message

Steven Robertson

unread,
Jun 21, 2011, 10:38:01 AM6/21/11
to google-app...@googlegroups.com
I have a custom (C#) SharePoint Web Part that updates the user's password when it is changed. My code is as follows:

using Google.GData.Apps;
using Google.GData.Client;

AppsService service = new AppsService(domain, GAdminusername, GAdminpassword);
UserEntry targetUser = service.RetrieveUser(username);
targetUser.Login.Password = password;
service.UpdateUser(targetUser);

I get the following error:

System.NullReferenceException: Object reference not set to an instance of an object. at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter) at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, String etag, Int64& contentLength) at Google.GData.Client.Service.Query(Uri queryUri) at Google.GData.Apps.UserService.Query(UserQuery feedQuery) at Google.GData.Apps.AppsService.RetrieveUser(String username)

The AppsService domain and credentials are correct. The username is my own, so it exists. In fact, if I put this code in a desktop application, it works perfectly.

What would cause this to fail in ASP.NET (SharePoint) and work in a Windows Forms Application on the desktop?

I appreciate your help, and I apologize if I've missed a previous post addressing this issue. I've searched but found nothing so far.

Claudio Cherubino

unread,
Jun 21, 2011, 10:59:05 AM6/21/11
to google-app...@googlegroups.com
The exception is telling you that an object in GDataGAuthRequest.Execute() is not defined, can you debug your code to understand which object is null?
Are you using the latest version of the .NET client library?

Claudio

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/MgoxiNlyHjgJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Steven Robertson

unread,
Jun 21, 2011, 11:10:25 AM6/21/11
to google-app...@googlegroups.com
The Google.GData.Client DLL is version 1.8.0.0, which is the latest I could find. I did have version 1.6.0.0, but got a different error with the older library.

I'll see if I can debug the library.

Thanks.

Steven Robertson

unread,
Jun 21, 2011, 11:36:43 AM6/21/11
to google-app...@googlegroups.com
Would this (http://code.google.com/p/google-gdata/issues/detail?id=502) be related? If so, how do I install the .patch file?

Claudio Cherubino

unread,
Jun 21, 2011, 11:39:15 AM6/21/11
to google-app...@googlegroups.com
To get the latest version of the code you have to checkout the source from the Subversion repository:


If you can't do that, then you may want to wait for the next release of the installer which should come out in the next 1-2 weeks.
Thanks

Claudio

On Tue, Jun 21, 2011 at 4:36 PM, Steven Robertson <otisrob...@gmail.com> wrote:
Would this (http://code.google.com/p/google-gdata/issues/detail?id=502) be related? If so, how do I install the .patch file?

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages