Hi
Im getting an "authToken is missing in SoapHeader", simple project,
downloaed the dll and referenced them, c# below. Firstly had one or
two issues with the app config not pulling in the authentication
correctly, fixed that then this which i dont see a hell of a lot
about.
Have set the properties to log the soap which worked for the
authentication errors but not for this one which is a bit strange
any ideas?
c# class
AdWordsUser user = new AdWordsUser();
TargetingIdeaService service =
(TargetingIdeaService)user.GetService(AdWordsService.v200909.TargetingIdeaService);
TargetingIdeaSelector selector = new
TargetingIdeaSelector();
Keyword[] keyword = new Keyword[1];
keyword[0] = new Keyword();
keyword[0].text = "data recovery";
RelatedToKeywordSearchParameter related = new
RelatedToKeywordSearchParameter();
related.keywords = keyword;
CountryTargetSearchParameter countries = new
CountryTargetSearchParameter();
CountryTarget[] country = new CountryTarget[1];
country[0] = new CountryTarget();
country[0].countryCode = "GB";
countries.countryTargets = country;
TargetingIdeaSelector targetidea = new
TargetingIdeaSelector();
SearchParameter[] parms = new SearchParameter[1];
parms[0] = related;
targetidea.ideaType = IdeaType.KEYWORD;
targetidea.requestType = RequestType.STATS;
targetidea.searchParameters = parms;
AttributeType[] attributes = new AttributeType[2];
attributes[0] = new AttributeType();
attributes[1] = new AttributeType();
attributes[0] = AttributeType.TARGETED_MONTHLY_SEARCHES;
attributes[1] = AttributeType.KEYWORD;
targetidea.requestedAttributeTypes = attributes;
Paging paging = new Paging();
paging.numberResults=150;
targetidea.paging = paging;
TargetingIdeaPage page = service.get(targetidea);
app config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="AdWordsApi"
type="com.google.api.adwords.lib.ApplicationConfiguration,google-api-
adwords-dotnet"/>
</configSections>
<AdWordsApi>
<!-- Change the appropriate flags to turn on SOAP logging. -->
<add key="LogPath" value="C:\Logs\"/>
<add key="LogToConsole" value="false"/>
<add key="LogToFile" value="true"/>
<add key="MaskCredentials" value="true"/>
<!-- Uncomment this key if you want to disable gzip compression in
SOAP requests.-->
<!--<add key="EnableGzipCompression" value="false"/>-->
<!-- Fill the header values. -->
<add key="CompanyName" value="X"/>
<add key="Email" value="X"/>
<add key="Password" value="X"/>
<!-- <add key="ClientEmail" value="X"/>-->
<add key="DeveloperToken" value="X"/>
<!-- Application token is now optional and will be ignored by the
server.-->
<!-- <add key="ApplicationToken"
value="ENTER_YOUR_APPLICATION_TOKEN_HERE"/> -->
<!-- Uncomment this key and comment ClientEmail if you want to
specify
customer id instead of customer email. -->
<add key="ClientCustomerId"
value="X"/> -->
<!-- Uncomment this if you want to reuse an authToken multiple
times. -->
<!--<add key="AuthToken" value="ENTER_YOUR_AUTH_TOKEN_HERE"/> -->
<!-- Uncomment this key if you want to use v13 sandbox. -->
<!-- <add key="LegacyAdWordsApi.Url" value="https://
sandbox.google.com"/>-->
<!-- Uncomment this key if you want to use AdWords API sandbox. --
>
<add key="AdWordsApi.Url" value="https://adwords-
sandbox.google.com"/>
</AdWordsApi>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="com.google.api.adwords.lib.TraceExtension,
google-api-adwords-dotnet" priority="1" group="0"/>
<add type="com.google.api.adwords.lib.ApiUnitsExtension,
google-api-adwords-dotnet" priority="1" group="0"/>
</soapExtensionTypes>
</webServices>
</system.web>
<system.net>
<settings>
<httpWebRequest maximumErrorResponseLength="-1" />
</settings>
</system.net>
</configuration>
error i get on debug
authToken is missing in SoapHeader. while invoking public abstract
com.google.ads.api.services.targetingideas.v200909.jaxbgen.TargetingIdeaPage
com.google.ads.api.services.targetingideas.v200909.jaxbgen.TargetingIdeaServiceInterface.get(com.google.ads.api.services.targetingideas.v200909.jaxbgen.TargetingIdeaSelector)
throws
com.google.ads.api.services.targetingideas.v200909.jaxbgen.ApiException_Exception
with params
[com.google.ads.api.services.targetingideas.v200909.jaxbgen.targetingideaselec...@96a05b].
which then causes a null reference in line 46 of adwordsapiservice.cs
"XmlNamespaceManager xmlns = new
XmlNamespaceManager(ex.Detail.OwnerDocument.NameTable);" because
ex.Detail is null
any help much appreciated!
thanks!
Cheers
Louis
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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