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 <adcha...@googlemail.com> 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="mym...@gmail.com"/> > <add key="password" value="mypasswordXX"/> > <add key="useragent" value="demotest"/> > <add key="developerToken" value="awapi.d...@gmail.com++eur"/> > <add key="applicationToken" value="1234567890123456789012"/> > <!-- Use either clientEmail or clientCustomerId (optional) --> > <add key="clientEmail" value="client_1+mym...@gmail.com"/> > <!-- <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 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 -~----------~----~----~----~------~----~------~--~---