Hello Jeff,
yes. AdUser and AdWordsUser is in fact identical. I just had to change
the header retrival to
-------
// Reads headers from App.config file
this.headers = (Hashtable)
System.Web.Configuration.WebConfigurationManager.GetSection
("adwordsHeaders");
-------
As ASP.NET is using a web.config file instead of an App.config.
Everything else is the same..
On Dec 18, 12:11 am, AdWords API Advisor
<[email protected]> wrote:
> Hello,
>
> Are you sure that that's the exact code you're running? You make
> reference to an AdUser object, for instance, but the name of the class
> in the .NET Client Library is AdWordsUser.
>
> Cheers,
> -Jeff Posnick, AdWords API Team
>
> On Dec 17, 5:45 pm, adchased <[email protected]> wrote:
>
> > Hello,
>
> > I'm using C# (within ASP.NET) for the Adwords API, this is how far I
> > am until now:
>
> > ------------------------------------------------------------------------------------------
> > using com.google.api.adwords.lib;
> > using com.google.api.adwords.v12;
> > ...
>
> > void AdApiTesting()
> > {
> > AdUser user = new AdUser();
> > user.useSandbox(); // use sandbox
> > CampaignService campaignService = (CampaignService)
> > user.getService("CampaignService");}
>
> > ------------------------------------------------------------------------------------------
>
> > It is crashing when I try to execute this line:
> > CampaignService campaignService = (CampaignService)user.getService
> > ("CampaignService");
>
> > Specificly here:
> > ------------------------------------------------------------------------------------------
> > public object getService(String name)
> > {
> > object o = services[name];
> > if (null != o)
> > {
> > return o;
> > }
> > Type t = Type.GetType(PACKAGE_PREFIX + version + "." +
> > name);
> > o = Activator.CreateInstance(t);
> > ------------------------------------------------------------------------------------------
>
> > t is null which is leading to an exception.
>
> > ------------------------------------------------------------------------------------------
> > PACKAGE_PREFIX = "com.google.api.adwords."
> > version = v12
> > name = CampaignService
> > ------------------------------------------------------------------------------------------
>
> > These are my settings for the adwordsHeader:
> > ------------------------------------------------------------------------------------------
> > <adwordsHeaders>
> > <add key="email" value="[email protected]"/>
> > <add key="password" value="mypasswordXX"/>
> > <add key="useragent" value="demotest"/>
> > <add key="developerToken" value="[email protected]++eur"/>
> > <add key="applicationToken" value="1234567890123456789012"/>
> > <!-- Use either clientEmail or clientCustomerId (optional) -->
> > <add key="clientEmail" value="[email protected]"/>
> > <!-- <add key="clientCustomerId"
> > value="INSERT_CLIENT_CUSTOMER_ID_HERE"/> -->
> > <!-- Use alternateUrl to make calls against Sandbox (optional) -->
> > <add key="alternateUrl" value="https://sandbox.google.com/"/>
> > <!-- Specify absolute path of the directory to which SOAP logs
> > should be
> > saved (optional) -->
> > <add key="logPath" value="C:\\Temp"/>
> > </adwordsHeaders>
> > ------------------------------------------------------------------------------------------
>
> > Could anyone help me out and tell me why t is NULL?
>
> > Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---