4 messages in com.googlegroups.adwords-apiAdWords API Re: source code and compi...
FromSent OnAttachments
AdWords API Advisor25 Jul 2008 09:11 
AdWords API Advisor29 Jul 2008 12:56 
AdWords API Advisor31 Jul 2008 10:36 
Achal Rastogi31 Aug 2008 01:49 
Subject:AdWords API Re: source code and compiled .jar do not appear to be the same in awapi_java_lib_1.0.1
From:AdWords API Advisor (adwo@google.com)
Date:07/29/2008 12:56:06 PM
List:com.googlegroups.adwords-api

Hello Robert,

Thanks for your detailed info. We're looking into this further to see exactly what might account for this discrepancy.

Cheers, -Jeff Posnick, AdWords API Team

On Jul 27, 11:01 am, robertjw <baCl@gmail.com> wrote:

Our code does explicitly state the API version when we create the AdWordsUser. We create AdWordsUser like the following:

Map credentials = new HashMap(); credentials.put("applicationToken", apptkn); credentials.put("developerToken", dvltkn ); credentials.put("useragent", usragt ); credentials.put("email", email ); credentials.put("password", passwd ); credentials.put("version", "v12"); AdWordsUser myMCC = new AdWordsUser( credentials );

Furthermore this code DOES work with the compiled version 12 api (adwords-api-1.0.1.jar). We get the classpath error when we try and use the source (compiling it ourselves). Line 172 of the source code of the class: com.google.api.adwords.lib.BaseCredentials is:

((AdWordsService) obj).setServiceAccountant(new ServiceAccountant((Stub) obj));

Which requires that the obj in question be an instance of AdWordsService obj in our case is an instance of: com.google.api.adwords.v12.AccountServiceSoapBindingStub Which I believe is NOT an instance AdWordsService (in the source code).

However when we decompiled the AccountServiceSoapBindingStub.class extracted from the binary source (.jar) we found that this class implements com.google.api.adwords.v12.AccountService (i.e. is an instance of AccountService)

Thanks

On Jul 25, 6:12 pm, AdWords API Advisor <adwo@google.com> wrote:

Hello Robert,

Hmmm, I'm not positive about mis-matches between the compiled .jar and the provided source (and can ask a colleague about that if need be), but I've seen that sort of error you describe when there is a version mismatch between the version of the API (11 or 12) you specify that you're using in your credentials and the corresponding version of API whose support libraries you're import-ing into your code. If you're not specifying an explicit version of the API in your credentials (either via a "version=1X" line in your ~/ adwords.properties file or via the AdWordsUser() constructor) then it's going to default to the earliest supported version, 11.

Can you check to make sure your import-ed libraries match the version in your credentials?

Cheers, -Jeff Posnick, AdWords API Team

On Jul 24, 6:46 am, robertjw <baCl@gmail.com> wrote:

We were trying to use the source code of the class: com.google.api.adwords.v12.AccountServiceSoapBindingStub

and noticed that it has this class definition:

public class AccountServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.google.api.adwords.v12.AccountInterface

Compiling and using this class gives all sort of problems, esp this type: java.lang.ClassCastException: com.google.api.adwords.v12.AccountServiceSoapBindingStub ...

This error does not occur when we use the adwords-api-1.0.1.jar provided in the same distribution, so we decompiled the AccountServiceSoapBindingStub.class and found that its definition was different than the source code. In particular it has this definition: public class AccountServiceSoapBindingStub extends Stub implements AccountInterface, AdWordsService (note that it implements AdWordsService)

Is there a reason for this difference? If the source and compiled code are not the same, it makes debugging code very difficult.

Thanks