Hi Fred,
To be able to reuse a cached token, you need to modify the AppsService
by adding the following constructor:
public AppsService(string domain, string authenticationToken)
{
this.domain = domain;
this.applicationName = "apps-" + domain;
emailListRecipientService = new EmailListRecipientService
(applicationName);
emailListRecipientService.SetAuthenticationToken
(authenticationToken);
((GDataRequestFactory)
emailListRecipientService.RequestFactory).KeepAlive = false;
emailListService = new EmailListService(applicationName);
emailListService.SetAuthenticationToken
(authenticationToken);
((GDataRequestFactory)
emailListService.RequestFactory).KeepAlive = false;
nicknameService = new NicknameService(applicationName);
nicknameService.SetAuthenticationToken
(authenticationToken);
((GDataRequestFactory)
nicknameService.RequestFactory).KeepAlive = false;
userAccountService = new UserService(applicationName);
userAccountService.SetAuthenticationToken
(authenticationToken);
((GDataRequestFactory)
userAccountService.RequestFactory).KeepAlive = false;
}
This will allow you to specify a Authentication Token instead of
username and password.
If you need to perform many operations I recommend using Threads, for
example 10 running instances of AppService will help you speed up the
process, you would need to make few modifications to the client to be
able to use Threads.
The number of users is usually updated every 24 hours, I ran a fix
script and it should be back to normal at the moment.
Cheers,
Julian
On Dec 1, 5:06 pm, NCCFred <[EMAIL PROTECTED]> wrote:
> Hi Julian,
>
> Thanks for the response. I can verify that I’m only using one object
> throughout my application. I might have a very poor work around for
> this issue. Before I run my C# application I go
> tohttps://www.google.com/a/students.ncc.edu/UnlockCaptchaand manually
> unlock the Captcha. After I manually unlock the Captcha, I run my
> application and was able to delete 500+ users with no problem.
>
> Also I'd like to add that I don't know if there's a way via the .NET
> API to isolate the Token that's "inside" of the AppsService object.
> Many suggestions in the Help and FAQ make it sound simple to cache or
> save this token but I think it’s geared more towards a Java developer
> and that framework, not the .NET API. Would you or your team be able
> to provide a sample C# application that isolates the AppsService
> token?
>
> Thanks in advance.
>
> Fred
>
> P.S. I have another issue of my “Dashboard” showing a negative number
> of users, -1636 to be exact. I don’t know if there two issues are
> related but I wanted to let you know. I have already opened up a
> ticket for the negative user issue.
>
> On Dec 1, 10:17 am, "Julian (Google)" <[EMAIL PROTECTED]> wrote:
>
> > Hi Fred,
>
> > I will investigate further this issue. Can you confirm that you are
> > not re-authenticating by creating many instances of the AppsService?
>
> > From your code snippet, it seems you are creating only one instance,
> > but I want to double check.
>
> > Cheers,
> > Julian.
>
> > On Nov 28, 4:29 pm, NCCFred <[EMAIL PROTECTED]> wrote:
>
> > > Hi Frank,
>
> > > Thanks for the response. I hope that's not the case because having to
> > > create 20,000 nicknames will take a long time.
>
> > > Hopefully someone from Google will be able to respond. I'm going to
> > > try and figure this out tonight.
>
> > > Fred
>
> > > On Nov 27, 6:56 am, Frank Mantek <[EMAIL PROTECTED]> wrote:
>
> > > > Guessing: you have reached an API limit on the server side that looks
> > > > the account after a certain amount of api activity in a certain amount
> > > > of time.....
>
> > > > Someone from the apps team will probably be able to clarify
>
> > > > Frank Mantek
> > > > Google
> > > > On Nov 26, 2008, at 8:13 PM, NCCFred wrote:
>
> > > > > Hello,
>
> > > > > I’ve been working with the .NET Google API for several weeks
> > > > > developing a front end application for Administration of our new
> > > > > student email. I have made great success using the API.
>
> > > > > Today I came across a situation that confused me with the DeleteUser
> > > > > function. My application reads in a text file of usernames into an
> > > > > Array. I then use a for loop and access the data in the ArrayList. I
> > > > > pass this String to the DeleteUser Function and for some strange
> > > > > reason ALWAYS receive a “CaptchaRequiredException” error on the 201st
> > > > > record. The data is clean and contains no errors.
>
> > > > > I was thinking a possible time-out value is reached, but looking at
> > > > > time between the first record (1:05:54) and the 200th record (1:13:15)
> > > > > seems to have no significant pattern to me.
>
> > > > > Does anyone have any idea why I would always be getting a
> > > > > CaptchaRequiredException error on the 201st record every time? Does
> > > > > the token expire? The DeleteUser function returns VOID so I really
> > > > > don’t have anything to go on except my Print out on the “Output” and
> > > > > by refreshing the Google Administrators Console for our domain.
>
> > > > > Here’s a sample of the code below.
>
> > > > > ArrayList CreateList = new ArrayList(); // Holds the User Names
>
> > > > > AppsService service = new AppsService(DOMAIN, USERNAME, PASSWORD);
>
> > > > > for( int i=0; i < CreateList.Length; i++)
> > > > > {
> > > > > service.DeleteUser( CreateList[i].ToString() );
>
> > > > > System.Console.WriteLine(“Deleted “ + CreateList[0].ToString() + “
> > > > > Record # “ + i);
>
> > > > > }
>
> > > > > Any help is apperciated, thanks.
> > > > > Fred- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---