Re: Help migration Adwords API 201209 to 201306

2013-07-24 Thread Takeshi Hagikura (AdWords API Team)
Hi,

First, are you able to run this example that uses 
ManagedCustomerServiceInterface?
https://code.google.com/p/google-api-ads-java/source/browse/examples/adwords_axis/src/main/java/adwords/axis/v201306/accountmanagement/GetAccountHierarchy.java

Best,
- Takeshi, AdWords API Team

On Monday, July 22, 2013 8:38:37 PM UTC+9, mcn.a...@gmail.com wrote:

 I'm migrating from API 201209 to 201306 but have a lot of problems:

 This is my old code


 try {

  Boolean mail_flag = false;


   String clientLoginToken = new ClientLoginTokens(ClientLoginTokens.
 ADWORDS_SERVICE).

from(adwordsPropertyService.getEmail(),

adwordsPropertyService.getPassword());


   // Construct an AdWordsSession.

  AdWordsSession session = new AdWordsSession.Builder().withDeveloperToken(
 adwordsPropertyService.getDeveloperToken())

   .withUserAgent(adwordsPropertyService.getUseragent())

   .withEndpoint(https:/adwords.google.com/api/adwords/)

   .withEnvironment(Environment.PRODUCTION)

   .withClientLoginToken(clientLoginToken).build();


   AdWordsServices adWordsServices = new AdWordsServices();


   LinkedListCampaignCriterionOperation operations2 = 
 newLinkedListCampaignCriterionOperation();

  ListInteger adwordsCode = zonaService.findAdwordsCode();

  // Get the ServicedAccountService.


   ManagedCustomerServiceInterface managedCustomerService = 
 adWordsServices.get(session, ManagedCustomerServiceInterface.class);


   // Create selector.

  Selector selector = new Selector();

  selector.setFields(new String[]{Login, CustomerId,  Name});


   // Get results.

  ManagedCustomerPage page = managedCustomerService.get(selector);


   for (ManagedCustomer account : page.getEntries()) {

   logger.info(Client with email +account.getLogin()+ has ID 
 +account.getCustomerId()+.);


   try{

   // Get the CampaignService.

   session.setClientCustomerId(account.getCustomerId().toString());


CampaignServiceInterface campaignService = 
 adWordsServices.get(session, CampaignServiceInterface.class);


// Create selector.

   Selector selectorCampaign = new Selector();

   selectorCampaign.setFields(new String[] {Id, Name, Status});

   selectorCampaign.setOrdering(new OrderBy[] {new OrderBy(Name, 
 SortOrder.ASCENDING)});


   … … ...

   
 First problem is when execute


  ManagedCustomerServiceInterface managedCustomerService = 
 adWordsServices.get(session, ManagedCustomerServiceInterface.class);


 that give me follow error:


  No group found for service: v201306.ManagedCustomerService


 How can I resolve it?


 Thanks a lot for your help.

 Best regards,

 Marco


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Help migration Adwords API 201209 to 201306

2013-07-22 Thread mcn . adwordz
 

I'm migrating from API 201209 to 201306 but have a lot of problems:

This is my old code


try {

 Boolean mail_flag = false;


  String clientLoginToken = new ClientLoginTokens(ClientLoginTokens.
ADWORDS_SERVICE).

   from(adwordsPropertyService.getEmail(),

   adwordsPropertyService.getPassword());


  // Construct an AdWordsSession.

 AdWordsSession session = new AdWordsSession.Builder().withDeveloperToken(
adwordsPropertyService.getDeveloperToken())

  .withUserAgent(adwordsPropertyService.getUseragent())

  .withEndpoint(https:/adwords.google.com/api/adwords/)

  .withEnvironment(Environment.PRODUCTION)

  .withClientLoginToken(clientLoginToken).build();


  AdWordsServices adWordsServices = new AdWordsServices();


  LinkedListCampaignCriterionOperation operations2 = 
newLinkedListCampaignCriterionOperation();

 ListInteger adwordsCode = zonaService.findAdwordsCode();

 // Get the ServicedAccountService.


  ManagedCustomerServiceInterface managedCustomerService = 
adWordsServices.get(session, ManagedCustomerServiceInterface.class);


  // Create selector.

 Selector selector = new Selector();

 selector.setFields(new String[]{Login, CustomerId,  Name});


  // Get results.

 ManagedCustomerPage page = managedCustomerService.get(selector);


  for (ManagedCustomer account : page.getEntries()) {

  logger.info(Client with email +account.getLogin()+ has ID 
+account.getCustomerId()+.);


  try{

  // Get the CampaignService.

  session.setClientCustomerId(account.getCustomerId().toString());


   CampaignServiceInterface campaignService = adWordsServices.get(session, 
CampaignServiceInterface.class);


   // Create selector.

  Selector selectorCampaign = new Selector();

  selectorCampaign.setFields(new String[] {Id, Name, Status});

  selectorCampaign.setOrdering(new OrderBy[] {new OrderBy(Name, SortOrder.
ASCENDING)});


  … … ...

  
First problem is when execute


 ManagedCustomerServiceInterface managedCustomerService = 
adWordsServices.get(session, ManagedCustomerServiceInterface.class);


that give me follow error:


 No group found for service: v201306.ManagedCustomerService


How can I resolve it?


Thanks a lot for your help.

Best regards,

Marco

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.