HI,

The easiest way to debug the error is to turn on logging in your 
App.config. Also, set maskCredentials as false. Then run your code, check 
the logs, and ensure that you are sending the correct clientCustomerId 
header. If you believe the issue is not at your end, then post a sanitized 
request and response xml on this thread and I'll take a look.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Monday, 21 May 2012 17:52:58 UTC+5:30, Chad Ruff wrote:
>
>  Hi ,
>
> I am using Google Adwords API version v201109, 
>
> While working with below code,  getting incorrect Campaign page entities 
> and stats for a valid account id
>
> Can you please look into this where i am going wrong
>
>  Public Function getUser() As AdWordsUser
>         Dim headers As New Dictionary(Of String, String)
>
>         headers.Add("email", "x...@xxx.xx")
>         headers.Add("password", "XXXX")
>
>         headers.Add("useragent", "XXXXX")
>         headers.Add("developerToken", "XXXXX")
>         headers.Add("applicationToken", "XXXXX")
>         Dim strValue As String = "XXXXX"
>         headers.Add("clientCustomerId", strValue.Replace("-", ""))
>
>         Try
>             Dim AdWordsUserObj As New AdWordsUser(headers)
>             Return AdWordsUserObj
>         Catch ex As Exception
>                      Return Nothing
>         End Try
>     End Function
>
>     Public Function updateCampaigns() As Integer
>         Dim user As AdWordsUser
>         user = getUser()
>
>         user.Config.RetryCount = 3
>
>         If user Is Nothing Then
>             Return 0
>         End If
>
>         Dim CampaignServiceObj As CampaignService
>         Dim page As CampaignPage
>         Dim SearchEngineeCampaignDBObj As New 
> SearchEngineCampaignDB(SQLConn)
>         Dim secObj As SearchEngineCampaign
>         Dim rtn As String
>
>         CampaignServiceObj = 
> user.GetService(AdWordsService.v201109.CampaignService)
>
>         Try
>             Dim selector As New Selector()
>             selector.fields = New String() {"Id", "Name", "Status", 
> "clicks"}
>
>             Dim orderByName As New OrderBy()
>             orderByName.field = "Name"
>             orderByName.sortOrder = 
> System.Windows.Forms.SortOrder.Ascending
>
>             
>
>             Dim SearchEngineDBObj As New SearchEngineDB(SQLConn)
>             Dim SearchEngineObj As SearchEngine
>
>             SearchEngineObj = SearchEngineDBObj.populate("Google")
>             If SearchEngineObj Is Nothing Then
>                 SearchID = 0
>                 Return Nothing
>             End If
>
>             selector.ordering = New OrderBy() {orderByName}
>             TryCast(user.Config, AdWordsAppConfig).ClientCustomerId = 
> SearchEngineObj.UserName
>
>             selector.paging = New Paging()
>             selector.paging.startIndex = 0
>             selector.paging.numberResults = 500
>
>             page = CampaignServiceObj.get(selector)
>
>             'page = CampaignServiceObj.get(New 
> Google.Api.Ads.AdWords.v201109.Selector())
>
>         Catch ex As Exception
>             Return 0
>         End Try
>
>         If page Is Nothing Then
>             Return 0
>         End If
>
>         Try
>             If page.entries.Length = 0 Then
>                 Return 0
>             End If
>         Catch ex As Exception
>             Return 0
>         End Try
>
>
>         For Each CampaignObj As Google.Api.Ads.AdWords.v201109.Campaign In 
> page.entries
>             secObj = New SearchEngineCampaign
>             secObj.SearchID = SearchID
>             secObj.CampaignName = CampaignObj.name
>
>             Try
>                 secObj.BudgetAmount = 
> CampaignObj.budget.amount.microAmount / 1000000
>             Catch ex As Exception
>                 secObj.BudgetAmount = 0
>             End Try
>
>             secObj.Status = CampaignObj.status.ToString
>             secObj.ID = CampaignObj.id
>             rtn = SearchEngineeCampaignDBObj.findAdd(secObj)
>         Next
>
>         Return page.entries.Length - 1
>     End Function
>
>
>

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

Reply via email to