Hi. I am attempting to create a simple account enumeration C# program,
using the v201402 code sample "GetAccountHierarchy.cs" as a base.
My code looks like this:
var uzer = new AdWordsUser();
var config = uzer.Config as AdWordsAppConfig;
config.Email = {comes from db - not config file}
config.EnableGzipCompression = true;
config.OAuth2Mode = OAuth2Flow.SERVICE_ACCOUNT;
config.OAuth2AccessToken = {comes from db - not config file}
config.OAuth2CertificatePassword = {comes from db - not config file}
config.OAuth2ClientId = {comes from db - not config file}
config.OAuth2ClientSecret = {comes from db - not config file}
config.OAuth2PrnEmail = {comes from db - not config file}
config.OAuth2CertificatePath = {comes from db - not config file}
config.OAuth2ServiceAccountEmail = {comes from db - not config file}
config.DeveloperToken = {comes from db - not config file}
var custSvc = (ManagedCustomerService)uzer.GetService(
AdWordsService.v201402.ManagedCustomerService );
custSvc.RequestHeader = new RequestHeader();
custSvc.RequestHeader.Version = "v20412";
custSvc.RequestHeader.GroupName = "mcm";
custSvc.RequestHeader.clientCustomerId = {comes from db - not config file}
custSvc.RequestHeader.userAgent = {comes from db - not config file} + "
(AwApi-DotNet/16.7.0, Common-Dotnet/2.2.0, .NET CLR/4.0.30319.18444, gzip)";
custSvc.RequestHeader.developerToken = {comes from db - not config file}
var childSelector = new Selector { fields = new[] { "Login" , "CustomerId"
, "Name" } };
var managedCustomerPage = custSvc.get( childSelector );
When run in the debugger, the Adwords code throws an Exception:
c:.................\Common\Lib\AdsSoapClient.cs Line 220
This page says to check the developer token for a typo (no typo found),
which leaves the namespace of the headers - how do I set that?
*https://developers.google.com/adwords/api/docs/common-errors#QuotaCheckError.INVALID_TOKEN_HEADER*
My app.config looks like this. Note that I do not have all of the stuff in
the app.config, as I am using values that come from a database. Only the
custom Google SoapExtension stuff is added/referenced:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"
/>
</startup>
<connectionStrings>
</connectionStrings>
<appSettings>
</appSettings>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="Google.Api.Ads.Common.Lib.SoapListenerExtension,
Google.Ads.Common" priority="1" group="0"/>
</soapExtensionTypes>
</webServices>
</system.web>
<system.net>
<settings>
<httpWebRequest maximumErrorResponseLength="-1"/>
</settings>
</system.net>
</configuration>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" 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/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.