All Sorted Now it was
// Set selector paging (required for targeting idea serivce). Paging paging = new Paging(); paging.startIndex = 0; paging.startIndexSpecified = true; ****************************************** MISSING paging.numberResults = 1; paging.numberResultsSpecified = true; ******************************************** MISSING selector.paging = paging; Error message in v2009 are not very good to be honest they are Wack! On Mar 15, 11:40 am, Duncan Lawrence <duncandevelo...@googlemail.com> wrote: > Hello can anyone please help me, Below I am try to get back search > volumes for a given list of keywords. I am getting an error, I am > completed stuck here!!!!! > ////****************START OF ERROR ********************* > private object[] Call(string methodName, object[] parameters) { > try { > if (HttpContext.Current != null) { > HttpContext.Current.Items.Add("AdWordsParent", this.Parent); > HttpContext.Current.Items.Add("SoapService", this); > HttpContext.Current.Items.Add("SoapMethod", methodName); > } else { > CallContext.SetData("AdWordsParent", this.Parent); > CallContext.SetData("SoapService", this); > CallContext.SetData("SoapMethod", methodName); > } > return base.Invoke(methodName, parameters); > } catch (SoapException ex) > { ************************************* HERE > > ERROR = [TargetingIdeaError.INVALID_SEARCH_PARAMETERS @ > selector.selector.searchParameters[0], > TargetingIdeaError.INVALID_SEARCH_PARAMETERS @ > selector.selector.searchParameters[1], > TargetingIdeaError.INVALID_SEARCH_PARAMETERS @ > selector.selector.searchParameters[2], RequiredError.REQUIRED @ > selector.requestType, NotEmptyError.EMPTY_LIST @ > selector.searchParameters[1].keywords] > > throw GetCustomException(ex); > } finally { > if (HttpContext.Current != null) { > HttpContext.Current.Items.Remove("AdWordsParent"); > HttpContext.Current.Items.Remove("SoapService"); > HttpContext.Current.Items.Remove("SoapMethod"); > > } else { > CallContext.FreeNamedDataSlot("AdWordsParent"); > CallContext.FreeNamedDataSlot("SoapService"); > CallContext.FreeNamedDataSlot("SoapMethod"); > } > } > } > > ///// ******************END OF ERROR ********************* > > //////// ************************ CODE USED > ******************************* > com.google.api.adwords.v200909.TargetingIdeaService > oTargetIdeasService = > (TargetingIdeaService)user.GetService(AdWordsService.v200909.TargetingIdeaService); > > int counter = tbKeyWordList.Lines.Length - 1; > Keyword[] kwa = new Keyword[counter]; > for (int a = 0; a < counter; a++) > { > if (!string.IsNullOrEmpty(tbKeyWordList.Lines[a])) > { > kwa[a] = new Keyword(); > kwa[a].text = tbKeyWordList.Lines[a].ToString(); > kwa[a].matchType = KeywordMatchType.EXACT; > kwa[a].matchTypeSpecified = true; > > } > } > //Create Target language for search stats > LanguageTarget lt = new LanguageTarget(); > lt.languageCode = "en"; > CountryTarget ct = new CountryTarget(); > ct.countryCode = "US"; > > //create selector > TargetingIdeaSelector selector = new > TargetingIdeaSelector(); > selector.requestType = RequestType.STATS; > selector.ideaType = IdeaType.KEYWORD; > selector.localeCode = "en_US"; > selector.currencyCode = "USD"; > selector.ideaTypeSpecified = true; > selector.requestedAttributeTypes = new AttributeType[] > { > AttributeType.KEYWORD, > AttributeType.COMPETITION, > AttributeType.TARGETED_MONTHLY_SEARCHES, > AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES, > AttributeType.GLOBAL_MONTHLY_SEARCHES, > }; > > // Set selector paging (required for targeting idea > serivce). > Paging paging = new Paging(); > paging.startIndex = 0; > paging.numberResults = 1; > selector.paging = paging; > > //Create LanguageTargetSearchParameter > LanguageTargetSearchParameter oLTSP = new > LanguageTargetSearchParameter(); > oLTSP.languageTargets = new LanguageTarget[] { lt }; > oLTSP.SearchParameterType = null; //this may need to be > null > > //Create CountryTargetSearchParameter > CountryTargetSearchParameter oCTSP = new > CountryTargetSearchParameter(); > oCTSP.countryTargets = new CountryTarget[] { ct }; > oCTSP.SearchParameterType = null; //this may need to be > null > > // Create related to keyword search parameter. > RelatedToKeywordSearchParameter > relatedToKeywordSearchParameter = new > RelatedToKeywordSearchParameter(); > relatedToKeywordSearchParameter.keywords = kwa; > selector.searchParameters = new SearchParameter[] > { relatedToKeywordSearchParameter, oLTSP, oCTSP }; > > //NOW GET THE STUFF > TargetingIdeaPage page = > oTargetIdeasService.get(selector); > > TargetingIdea[] aTI = page.entries; -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. 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 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