Hi, 

Can you please share the request and response SOAP xml logs to spot the 
issue (please remove the sensitive info before posting)?

Best,
- Takeshi, AdWords API Team

On Wednesday, November 6, 2013 12:12:48 PM UTC+9, Mark Ibanez wrote:
>
> Hi,
>
> We have a .Net application that uses AdWords API. In this application, we 
> retrieve accounts and campaigns in both MCC and regular AdWords accounts. 
> Below is the code we use to do that.
>
>             ManagedCustomerService MCServices = 
> (ManagedCustomerService)User.GetService(AdWordsService.v201302.ManagedCustomerService);
>             Selector AccountsSelector = new Selector();
>             AccountsSelector.fields = new string[] { "CustomerId", "Name" 
> };
>             AccountsSelector.paging = new Paging();
>             AccountsSelector.paging.startIndex = 0;
>             AccountsSelector.paging.numberResults = 500;
>             ManagedCustomerPage AccountsPage = 
> MCServices.get(AccountsSelector);
>
>                 foreach (var Account in AccountsPage.entries)
>                 {
>                     string CustomerID = 
> Account.customerId.ToString().Substring(0, 3) + "-" +
>                         Account.customerId.ToString().Substring(3, 3) + 
> "-" +
>                         Account.customerId.ToString().Substring(6);
>
>                     if (AccountsPage.totalNumEntries > 1 && 
> ClientCustomerID == CustomerID)
>                         continue;
>
>                     //Process Accounts Here
>
>                     (User.Config as AdWordsAppConfig).ClientCustomerId = 
> CustomerID;
>                     // Get the CampaignService.
>                     CampaignService campaignService =
>                         
> (CampaignService)User.GetService(AdWordsService.v201302.CampaignService);
>
>                     // Create the selector.
>                     Selector selector = new Selector();
>                     selector.fields = new string[] { "Id", "Name", 
> "Status" };
>
>                     // Set the selector paging.
>                     selector.paging = new Paging();
>                     int offset = 0;
>                     int pageSize = 500;
>                     CampaignPage page = new CampaignPage();
>
>                     try
>                     {
>                         do
>                         {
>                             selector.paging.startIndex = offset;
>                             selector.paging.numberResults = pageSize;
>
>                             // Get the campaigns.
>                             page = campaignService.get(selector);
>
>                             // Display the results.
>                             if (page != null && page.entries != null)
>                             {
>                                 int i = offset;
>                                 foreach (Campaign campaign in page.entries)
>                                 {
>                                     //Process Campaigns Here
>                                 }
>                             }
>                             offset += pageSize;
>                         } while (offset < page.totalNumEntries);
>                     }
>                     catch (Exception ex) {  }                    
>                 }
>
> This works for both MCC and regular AdWords accounts. But we are having 
> trouble with a specific account. The CustomerID for this account is 
> 308-863-3431. The code breaks because AccountsPage.entries being returned 
> is null. We tried to troubleshoot using the code below.
>
>             CustomerService CustService = 
> (CustomerService)User.GetService(AdWordsService.v201302.CustomerService);
>             var CustPage = CustService.get();
>
>             MessageBox.Show(CustPage.descriptiveName, 
> CustPage.customerId.ToString());
>
> What shows up is that the descriptiveName field is blank which could mean 
> it is probably null. This could be the reason why the 
> ManagedCustomerService object is return null entries. Anyway, we really 
> need help to figure out what's going on here. Why does this occur only with 
> this particular account and not with the others both MCC and regular 
> accounts.
>
> Looking forward to your help and thanks in advance.
>
>
> Best regards,
>
>
> Mark Ibanez
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.

Reply via email to