daniel36 -7 Light Poster

i am trying to create google adword sandbox account and display the information returned by sandbox for it i hv installed google adword library and installed it.and made a code index.php which is

<?php
 
require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
 
$username = "rmvd for security";
$password = "rmvd for security";
$currencyCode = "USD";
$developerToken = "$username++$currencyCode";
 
$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com");
$user->LogAll();
 
try {
    $campaignService = $user->GetService("CampaignService", 'v201109');
    $page = $campaignService->get(new Selector());
} catch (Exception $e) {}
 
$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
foreach ($page->accounts as $account) {
    print "Customer ID: {$account->customerId}\n";
}
 
$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
$customerId = $page->accounts[0]->customerId;
$user->SetClientId($customerId);
 
$campaignService = $user->GetService("CampaignService", 'v201109');
 
$campaign = new Campaign();
$campaign->name = "Test Sandbox Account";
$campaign->status = "ACTIVE";
$campaign->biddingStrategy = new ManualCPC();
 
$budget = new Budget();
$budget->period = 'DAILY';
$budget->amount = new Money((float) 10000000);
$budget->deliveryMethod = 'STANDARD';
$campaign->budget = $budget;
 
$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = TRUE;
$campaign->networkSetting = $networkSetting;
 
$operation = new CampaignOperation();
$operation->operand = $campaign;
$operation->operator = 'ADD';
 
$operations = array($operation);
$result = $campaignService->mutate($operations);
 
print_r($result);
?>

It is giving the error-

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://adwords-sandbox.google.com/api/adwords/cm/v201109/CampaignService?wsdl" in C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://adwords-sandbox.google.com/api/adwords/mcm/v201109/ServicedAccountService?wsdl" in C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords-sandbox.google.com/api/adwords/mcm/v201109/ServicedAccountService?wsdl' in C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\AdsSoapClient.php:163 Stack trace: #0 C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\AdsSoapClient.php(163): SoapClient->SoapClient('https://adwords...', Array) #1 C:\xampp\php\PEAR\Google\Api\Ads\AdWords\Lib\AdWordsSoapClient.php(53): AdsSoapClient->__construct('https://adwords...', Array, Object(AdWordsUser), 'ServicedAccount...', 'https://adwords...') #2 C:\xampp\php\PEAR\Google\Api\Ads\AdWords\v201109\ServicedAccountService.php(1858): AdWordsSoapClient->__construct('https://adwords...', Array, Object(AdWordsUser), 'ServicedAccount...', 'https://adwords...') #3 C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\SoapClientFactory.php(146): ServicedAccountService->__construct('https://adwords...', Array, Object(AdWordsUser)) #4 C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\SoapClientFactory.php(82): SoapCl in C:\xampp\php\PEAR\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163

can any one help me to resolve this problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.