6 messages in com.googlegroups.adwords-apiRe: KeywordTool interface ClassCastEx...
FromSent OnAttachments
Michael Kuhinica11 Jan 2008 08:55 
AdWords API Advisor11 Jan 2008 13:08 
Michael Kuhinica14 Jan 2008 03:05 
Michael Kuhinica14 Jan 2008 04:06 
Michael Kuhinica14 Jan 2008 04:55 
Michael Kuhinica14 Jan 2008 10:07 
Subject:Re: KeywordTool interface ClassCastException
From:Michael Kuhinica (tave@gmail.com)
Date:01/14/2008 10:07:32 AM
List:com.googlegroups.adwords-api

Damn I am having another error! When I try to get some services such as the Campaign service he tries to give me the following class com.google.api.adwords.v11.CampaignServiceServiceLocator note the duplicated Service. I really dont know what is going on....

I think I found the error. When I try to get the KeywordToolService from AdWordUser.KEYWORDTOOL_SERVICE it brings me the number 6 which is the number of the ReportService now, apparently. I did some experiments and found out that the KeywordToolService is number 9! Now I make the request with this static number (9) and it works fine! Maybe this is a bug or maybe I am doing something wrong, I cant tell....

But thanks for the help!

On Jan 14, 10:06 am, Michael Kuhinica <tave@gmail.com> wrote:

Looks like this only heppen when I try to call the function from a SpringController...

On Jan 14, 9:06 am, Michael Kuhinica <tave@gmail.com> wrote:

Hi Jeff! The problem is really odd... I am using Java and during the test with a POJO I can get related keywords with this code: String search = "mp3";

Properties adProp = new Properties(); InputStream file = Teste.class.getClassLoader().getResourceAsStream("adwords.properties");

adProp.load(file); adProp.setProperty("clientEmail", "ourEmail"); AdWordsUser user = new AdWordsUser(adProp);

ArrayList<String> lista = new ArrayList<String>(); KeywordToolInterface request = (KeywordToolInterface)user.getService(AdWordsUser.KEYWORDTOOL_SERVICE);

SeedKeyword seed = new SeedKeyword(); seed.setNegative(false); seed.setText(search); seed.setType(KeywordType.Exact);

SeedKeyword[] sk = {seed};

String[] linguas = {"pt"}; String[] pais = {"BR"};

KeywordVariations keywordVariation = request.getKeywordVariations(sk, false, linguas, pais);

And it works fine! But when I try to use this code inside my aplication, the getService returns a ReportServiceSoapBindingStub! All the imports seens to be fine. This heppened after we migrated to v11.

I would really appreciate your help!

Thanks,