If anyone can help with the following code, which is correctly showing the
page.totalNumEntries for my MCC, but not allowing me to reference the *
page.entries* in order to get the actual ManagedCustomer objects I am
requesting.
' Create the selector.
Dim oManagedCustomer As New ManagedCustomer
Dim selector As New GoogleAccountAPI.Selector
selector.fields = New String() {"CompanyName", "CustomerId",
"Name", "Login"}
'Size of result set
selector.paging = New GoogleAccountAPI.Paging
Dim offset As Integer = 0
Dim pageSize As Integer = 10
Dim page As New GoogleAccountAPI.ManagedCustomerPage
Dim oCst As New GoogleAccountAPI.ManagedCustomer
Try
Do
selector.paging.startIndex = offset
selector.paging.numberResults = pageSize
' Get the Accounts
page = myService.get(selector)
' Display the results.
If ((Not page Is Nothing) AndAlso (page.totalNumEntries >
0)) Then
Dim i As Integer = offset
For Each oManCst As GoogleAccountAPI.ManagedCustomer In
page.entries
Console.WriteLine("Customer ID = '{0}' and name ="
& " '{1}' .", oManCst.customerId, oManCst.companyName)
MyArray.Add(oManCst)
i += 1
Next
Else
Console.WriteLine("No Accounts were found.")
End If
offset = offset + pageSize
Loop While (offset < page.totalNumEntries)
Console.WriteLine("Number of Accounts found: {0}",
page.totalNumEntries)
I've attached my cleansed Soap request/response data with my MCC clientID,
Dev and Auth token cleansed.
I must be very close, just missing the Doh moment to properly get the
ManagedCustomer object with the fields I have requested in the selector.
Thanks!
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
POST https://adwords.google.com/api/adwords/mcm/v201309/ManagedCustomerService
HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol
2.0.50727.5472)
Authorization: Bearer OAuthToken
VsDebuggerCausalityData:
uIDPowfv9DzRlh1Ig0vrFjsOJAwAAAAA0RXXlj5HJk+aQ9K5Al3Vg0kxbFubxitFvg36aSynfH4ACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: adwords.google.com
Content-Length: 1182
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201309">
<clientCustomerId
xmlns="https://adwords.google.com/api/adwords/cm/v201309">hidden</clientCustomerId>
<developerToken
xmlns="https://adwords.google.com/api/adwords/cm/v201309">hidden</developerToken>
<userAgent
xmlns="https://adwords.google.com/api/adwords/cm/v201309">AdWordsAPIV201309</userAgent>
</RequestHeader>
</soap:Header>
<soap:Body>
<get xmlns="https://adwords.google.com/api/adwords/mcm/v201309">
<serviceSelector>
<fields
xmlns="https://adwords.google.com/api/adwords/cm/v201309">CompanyName</fields>
<fields
xmlns="https://adwords.google.com/api/adwords/cm/v201309">CustomerId</fields>
<fields xmlns="https://adwords.google.com/api/adwords/cm/v201309">Name</fields>
<fields xmlns="https://adwords.google.com/api/adwords/cm/v201309">Login</fields>
<paging xmlns="https://adwords.google.com/api/adwords/cm/v201309" />
</serviceSelector>
</get>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Date: Thu, 24 Oct 2013 18:43:07 GMT
Expires: Thu, 24 Oct 2013 18:43:07 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked
309
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header>
<ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201309"
xmlns="https://adwords.google.com/api/adwords/mcm/v201309">
<ns2:requestId>0004e981013797200ae5e8ca000016bf</ns2:requestId>
<ns2:serviceName>ManagedCustomerService</ns2:serviceName>
<ns2:methodName>get</ns2:methodName><ns2:operations>1</ns2:operations>
<ns2:responseTime>333</ns2:responseTime></ResponseHeader></soap:Header>
<soap:Body><getResponse
xmlns="https://adwords.google.com/api/adwords/mcm/v201309"
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201309"><rval>
<ns2:totalNumEntries>474</ns2:totalNumEntries>
<ns2:Page.Type>ManagedCustomerPage</ns2:Page.Type></rval>
</getResponse>
</soap:Body>
</soap:Envelope>