Beispiel #1
0
 private void InitializeRequestHeader(ref com.google.adwords.CampaignService CampaignService)
 {
     CampaignService.RequestHeader.userAgent        = _accountData.UserAgent;
     CampaignService.RequestHeader.applicationToken = _accountData.AppToken;
     CampaignService.RequestHeader.developerToken   = _accountData.Token;
     CampaignService.RequestHeader.authToken        = FetchAutoToken(_accountData.UserAgent);
     CampaignService.RequestHeader.developerToken   = _accountData.Token;
     CampaignService.RequestHeader.applicationToken = _accountData.AppToken;
     GetAccountAccessData();
     _accountData.ClientEmail = _accountEmail;
     CampaignService.RequestHeader.clientEmail = _accountEmail;
 }
Beispiel #2
0
        protected override ServiceOutcome DoWork()
        {
            Console.WriteLine("-------ccccccccccc-");
            Console.WriteLine("AccountID: {0}", Instance.AccountID);
            Console.WriteLine("TestMode (option): {0}", Instance.Configuration.Options["TestMode"]);
            Console.WriteLine("----------vvvvvvvvvvvvvvvvvvvvvvvvvvv---------");

            com.google.adwords.CampaignSelector selector = new Easynet.Edge.Services.Google.Adwords.com.google.adwords.CampaignSelector();


            InitalizeServiceData();
            com.google.adwords.CampaignService CampaignService = new com.google.adwords.CampaignService();


            CampaignService.RequestHeader = new Easynet.Edge.Services.Google.Adwords.com.google.adwords.MySoapHeader();

            InitializeRequestHeader(ref CampaignService);



            com.google.adwords.CampaignPage page = new Easynet.Edge.Services.Google.Adwords.com.google.adwords.CampaignPage();

            int campaignID = 0;

            Google.Adwords.com.google.adwords.CampaignStatus campStatus = new Easynet.Edge.Services.Google.Adwords.com.google.adwords.CampaignStatus();
            string campaignName = string.Empty;

            page = CampaignService.get(selector);


            GetCampaignStatusDicFromDB();
            int count = 0;

            foreach (var item in page.entries)
            {
                campStatus = item.status;
                if (item.id == null)
                {
                    count++;
                }
                else
                {
                    campaignID = Convert.ToInt32(item.id);
                }
                campaignName = item.name;

                UpdateCampaignStatusInDB(_accountID, 1, campaignName, Convert.ToInt32(campaignStatusHashSet[campStatus.ToString()]), campaignID);
            }
            return(ServiceOutcome.Success);
        }