Hi, I think the problem here is that you are retrieving a *DataService* object from *AdWordsServices*. Please try switching to a *DataServiceInterface* object instead, as shown in the GetKeywordBidSimulations.java example <https://github.com/googleads/googleads-java-lib/blob/master/examples/adwords_axis/src/main/java/adwords/axis/v201502/optimization/GetKeywordBidSimulations.java#L72>, and let me know if that doesn't resolve the issue.
DataServiceInterface dataService = adWordsServices.get(session, DataService Interface.class); Thanks, Josh, AdWords API Team On Monday, May 11, 2015 at 1:01:42 AM UTC-4, Yehoshaphat Schellekens wrote: > > HI All > > I'm Trying to pull some data using the data service, i know that this > service's get methods are a bit different, but im following the API in: > https://developers.google.com/adwords/api/docs/reference/v201502/DataService > > It seems like my IDE doe's not recognize the other possible get methods, > as following: > > import com.google.api.ads.adwords.axis.factory.AdWordsServices; > import com.google.api.ads.adwords.axis.utils.v201502.SelectorBuilder; > import com.google.api.ads.adwords.axis.v201502.cm.AdGroupBidLandscapePage; > import com.google.api.ads.adwords.axis.v201502.cm.DataService; > import com.google.api.ads.adwords.axis.v201502.cm.Selector; > import com.google.api.ads.adwords.lib.client.AdWordsSession; > import com.google.api.ads.common.lib.auth.OfflineCredentials; > import com.google.api.client.auth.oauth2.Credential; > > ..........CREDENTIALS...... > > public static void main(String[] args) throws Exception { > // Generate a refreshable OAuth2 credential similar to a ClientLogin > token > // and can be used in place of a service account. > Credential oAuth2Credential = new OfflineCredentials.Builder() > .forApi(OfflineCredentials.Api.ADWORDS) > .withClientSecrets(Client_ID, > Client_secret).withRefreshToken(RefreshToken) > .build() > .generateCredential(); > > // Construct an AdWordsSession. > AdWordsSession session = new AdWordsSession.Builder() > > .withClientCustomerId(clientCustomerId).withDeveloperToken(developerToken).withUserAgent(userAgent) > .withOAuth2Credential(oAuth2Credential) > .build(); > > AdWordsServices adWordsServices = new AdWordsServices(); > > runExample(adWordsServices, session); > } > > > public static void runExample( > AdWordsServices adWordsServices, AdWordsSession session) throws > Exception { > // Get the CampaignService. > DataService dataService = adWordsServices.get(session, > DataService.class); > > int offset = 0; > > // Create selector. > SelectorBuilder builder = new SelectorBuilder(); > Selector selector = builder > .fields("AdGroupId", "Bid", "CampaignId", "CriterionId", > "EndDate", "LocalClicks", "LocalCost", "LocalImpressions", > "PromotedImpressions", "StartDate") > .build(); > > AdGroupBidLandscapePage page = null; > > do { > // Get all data > page = dataService.getAdGroupBidLandscape(selector); // the problem > is here : get method isn't recognized > > > // Display campaigns. > if (page.getEntries() != null) { > for ( DataService ds : page.getEntries()) { > System.out.println(ds.toString()); > } > } else { > System.out.println("No campaigns were found."); > } > > offset += PAGE_SIZE; > selector = builder.increaseOffsetBy(PAGE_SIZE).build(); > } while (offset < page.getTotalNumEntries()); > } > > > > > Thanks for any help on that :) > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1a204f36-08ce-44cc-9a28-f0a4ce23fc85%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.