One more problem with this, I've tried to use the client Library. but before I can run: (user.OAuthProvider as AdsOAuthNetProvider).AccessToken = new OAuthToken(TokenType.Access, "ACCESS_TOKEN_HERE", "ACCESS_SECRET_HERE", "CONSUMER_KEY_HERE");
I must create an Instance of user.OAuthProvider, so I tried to do: user.OAuthProvider = new AdsOAuthNetProvider(config.OAuthConsumerKey, config.OAuthConsumerSecret, AdWordsService.GetOAuthScope(user.Config as AdWordsAppConfig), "www.CallBackURL"); which trow exception because in a inner function there is: protected AdsOAuthNetProvider(OAuthService service, string callbackUrl) : base(new EndPoint("http://localhost", "POST"), service, null, service.ComponentLocator.GetInstance<IRequestStateStore>(), new RequestStateKey(service, HttpContext.Current.Session.SessionID)) but HttpContext.Current == null What am I missing ? Thanks. On Dec 18, 12:10 pm, "Dr.g." <roeegavr...@gmail.com> wrote: > Dear Anash, > > Thanks for the help. > > I've seen this example but unfortunately it's not applicable for my > situation. > I'm working in C# and I use the WSDL structure to create the SOAP > request manually since using the Client Library have some over head > I'm trying to avoid. > So far, when I needed a service, what I have to do is this: > > RequestHeader requestHeader = new RequestHeader(); > > requestHeader.developerToken = MY_DEVELOPER_TOKEN; > requestHeader.userAgent = "C# Client Library"; > > > /////////////////////////////////////////////////////////////////////////// > /////////////////////////////////////////////////////////////////////////// > ///////////////// > //I BELIEVE I NEED TO REPLACE THE NEXT TWO LINES. I'M JUST NOT SURE > WITH WHAT. > AuthToken token = new AuthToken(USER-EMAIL, USER-PASSWORD, "C# Client > Library"); > requestHeader.authToken = token.GetToken(); > > /////////////////////////////////////////////////////////////////////////// > /////////////////////////////////////////////////////////////////////////// > ///////////////// > > if (headerValues.ContainsKey("clientCustomerId")) > { > requestHeader.clientCustomerId = > headerValues["clientCustomerId"]; > } > //Set request header > PropertyInfo requestHeaderProperty = > serviceType.GetProperty("RequestHeader"); > requestHeaderProperty.SetValue(service, requestHeader, null); > > Saying I have the Token and the Secret already, > Any Idea how I get the correct token to there? > > Thanks! > > On Dec 13, 3:29 pm, "Anash P. Oommen" <anash.p.oommen > > > > > > > > +fo...@google.com> wrote: > > Hi R.g, > > > Yes, you can load an existing OAuth accesstoken. > > Seehttp://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuthfor > > details. > > > Cheers, > > Anash P. Oommen, > > AdWords API Advisor. -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en