3 messages in com.googlegroups.adwords-apiRe: java.lang.ClassCastException: com...
FromSent OnAttachments
patil23 May 2007 23:14 
tamar24 May 2007 05:48 
Jigar05 Jun 2007 23:21 
Subject:Re: java.lang.ClassCastException: com.google.api.adwords.v10.AccountServiceSoapBindingStub
From:tamar (tei@gmail.com)
Date:05/24/2007 05:48:34 AM
List:com.googlegroups.adwords-api

Been getting the same exception, from BaseCredentials.java, line #177. I tried using v9 instead of v10, but it doesn't help. Can anybody help?

Thanks, Tamar

On May 24, 9:15 am, patil <akpt@gmail.com> wrote:

Hello forum, Our application is desktop application devloped using swings of java, here we are calling the api V7(which is no more in use) so we added V10 api,and when i tried to run our application i'm getting the above(subject Line) Exception error i.e java.lang.ClassCastException: com.google.api.adwords.v10.AccountServiceSoapBindingStub

following is the code for load the account service

public class AdwordServices {

/* Google AdWords Services */

public static AccountService accountService = null;

public static AdGroupService adGroupService = null;

public static CampaignService campaignService = null;

public static CreativeService creativeService = null;

public static CriterionService criterionService = null;

public static InfoService infoService = null;

public static KeywordToolInterface keywordToolInterface = null;

public static ReportServiceInterface reportServiceInterface = null;

public static TrafficEstimatorInterface trafficEstimatorInterface = null;

/** * Creates a new instance of AdwordServices */ public AdwordServices() { }

/**Services * Function <code>loadServices</code>loads the services Adword Services * */

public static void loadServices(){ try { accountService = (AccountService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.ACCOUNT_SERVICE); adGroupService =(AdGroupService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.AD_GROUP_SERVICE); campaignService = (CampaignService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.CAMPAIGN_SERVICE); creativeService = (CreativeService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.CREATIVE_SERVICE); criterionService =(CriterionService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.CRITERION_SERVICE); keywordToolInterface = (KeywordToolInterface)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.KEYWORDTOOL_SERVICE); reportServiceInterface = (ReportServiceInterface)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.REPORT_SERVICE); trafficEstimatorInterface = (TrafficEstimatorInterface) Main.ADWORDS_USER.getService(Main.ADWORDS_USER.TRAFFIC_ESTIMATOR_SERVICE); } catch (ServiceException ex) { ex.printStackTrace(); }

}

public boolean AccServices() { AccountInfo acin; String str1 = " "; boolean x = false;

// This is a dummy call to Account Service and used only for validation // This is used by Login to validate the given password with Google server, as there is // no separate google API to validate the password

try { accountService = (AccountService)Main.ADWORDS_USER.getService(Main.ADWORDS_USER.ACCOUNT_SERVICE); acin = accountService.getAccountInfo(); str1 = acin.getDescriptiveName(); System.out.println("accountinfo" +str1); x = true;

} catch (ServiceException ex) { if (str1 == " ") { x = false; } else { ex.printStackTrace(); } } catch (RemoteException ex) { ex.printStackTrace(); } return x; }

}

could any one tell me where the things are going wrong Please acknowledge me

Thanks Anil Patil