Hi Minh,
Could you turn on logging and send me the log that causes this error to be
thrown to [email protected]? I'll look into it and provide a fix
for the null pointer exception.
Cheers,
Anash P. Oommen,
AdWords API Advisor.
On Tuesday, 24 April 2012 00:36:28 UTC+5:30, Minh Le wrote:
>
> I've got this error in 3 days since April 20:
>
> System.NullReferenceException: Object reference not set to an instance of
> an object.
> at
> Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.IsCookieInvalidError(AdWordsApiException
>
> awapiException)
> at Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.ShouldRetry(Exception ex)
> at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String methodName,
> Object[] parameters)
> at Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.MakeApiCall(String
> methodName, Object[] parameters)
> at Google.Api.Ads.Common.Lib.AdsSoapClient.Invoke(String methodName,
> Object[] parameters) at
> Google.Api.Ads.AdWords.v201109.CampaignCriterionService.mutate(CampaignCriterionOperation[]
>
> operations)
> at SemUpdateBiz.SEMUtils.addCampaignCriteria(AdWordsUser user, Int64
> campaignId, List`1 criteria, CampaignCriterionService
> campaignCriterionService, googleNameAndID googleCampaign)
>
> Here is the method which is being used:
>
> public static void addCampaignCriteria(AdWordsUser user, long campaignId,
>
> List<CampaignCriterion> criteria,
>
> CampaignCriterionService campaignCriterionService,
> googleNameAndID
> googleCampaign)
> {
> List<CampaignCriterionOperation> operations = new
> List<CampaignCriterionOperation>();
>
> foreach (CampaignCriterion criterion in criteria)
> {
> CampaignCriterionOperation operation = new
> CampaignCriterionOperation();
> operation.@operator = Operator.ADD;
> operation.operand = criterion;
> operations.Add(operation);
> }
>
> try
> {
> if (operations.Count > 0)
> {
> CampaignCriterionReturnValue retVal =
> campaignCriterionService.mutate(operations.ToArray());
>
> //display added criteria
> if (retVal != null && retVal.value != null &&
> retVal.value.Length > 0)
> {
> foreach (CampaignCriterion temp in retVal.value)
> {
> Console.WriteLine("Campaign criterion with
> campaign id = \"{0}\", criterion id = " +
> "\"{1}\" and type =
> \"{2}\" was added.",
> temp.campaignId,
> temp.criterion.id,
>
> temp.criterion.CriterionType);
> }
> }
> else
> {
> Console.WriteLine("No campaign criteria were
> added.");
> }
> }
> }
> catch (AdWordsApiException ex)
> {
> // This block will be hit if there is a validation error
> from the server.
> Console.WriteLine("There were validation error(s) while
> adding campaigns.");
>
> if (ex.ApiException != null)
> {
> foreach (ApiError error in
> ((ApiException)ex.ApiException).errors)
> {
> Console.WriteLine(" Error type is '{0}' and
> fieldPath is '{1}'.",
> error.ApiErrorType, error.fieldPath);
> }
> }
> }
> catch (Exception ex)
> {
> Logger.LogThis(string.Format("addCampaignCriteria() inside
> UpdateTheseGoogleGEOTargets(): " + googleCampaign.gname + " " +
> googleCampaign.gid + "\n" + ex.ToString(), Logger.MsgTypeEnum.Error));
> }
>
> operations = null;
> }
>
>
> To generate the user:
>
> Dictionary<string, string> headers = new Dictionary<string,
> string>();
> headers.Add("email", campaign_email);
> headers.Add("password", campaign_password);
> headers.Add("useragent",
> ConfigurationManager.AppSettings["useragent"]);
> headers.Add("developerToken",
> ConfigurationManager.AppSettings["developerToken"]);
> AdWordsUser user = new AdWordsUser(headers);
> *user.Config.RetryCount = 3;*
>
> I use " *user.Config.RetryCount = 3;*" as the advice from Anash-API Team
> from the beginning of this April to prevent the "
> AuthenticationError.GOOGLE_ACCOUNT_COOKIE_INVALID" error, and now I'm
> facing the above error.
>
>
> I also got this error:
>
> System.Net.WebException: The request was aborted: *Could not create
> SSL/TLS secure channel. *
> at
> System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
> request)
> at
> System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest
> request)
> at Google.Api.Ads.Common.Lib.AdsSoapClient.GetWebResponse(WebRequest
> request)
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)
> at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String methodName,
> Object[] parameters)
> at Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.MakeApiCall(String
> methodName, Object[] parameters)
> at Google.Api.Ads.Common.Lib.AdsSoapClient.Invoke(String methodName,
> Object[] parameters)
> at
> Google.Api.Ads.AdWords.v201109.CampaignCriterionService.mutate(CampaignCriterionOperation[]
>
> operations)
> at addCampaignCriteria(AdWordsUser user, Int64 campaignId,
> List<CampaignCriterion> criteria, CampaignCriterionService
> campaignCriterionService, GoogleAccount googleAcc)
>
> Does anyone has any advice on these 2 issues?
>
> Thanks
>
>
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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