Hi,

I've already left you a few questions and answers in this thread 
https://groups.google.com/forum/?fromgroups=#!topic/adwords-api/grCpR_CmF9Y, 
please lets follow up on it.

Best,

- David Torres - AdWords API Team

On Friday, January 25, 2013 12:15:07 PM UTC-5, Timo Aarnio wrote:
>
> Hi
>
> I'm currently trying to add campaigns to my test account. But when running 
> the script I get this error: "Fault occurred while processing."
>
> The error seems to happen when the script tries to add using the 
> budgetservice:
> [Jan 25 2013 19:03:26.000000 - ERROR] email=testemail 
> effectiveUser=123456789 service=BudgetService method=mutate operators={ADD: 
> 1} responseTime=73 requestId=0004d41fe7adf2700ae5630d00001737 operations=0 
> units=0 server=adwords.google.com isFault=true faultMessage=Fault 
> occurred while processing.
>
> When looking at the soap_xml.log, it shows a 500 internal server error:
> [Jan 25 2013 19:03:26.000000 - ERROR] POST 
> /api/adwords/cm/v201209/BudgetService HTTP/1.1
>
> Host: adwords.google.com
>
> Connection: Keep-Alive
>
> User-Agent: PHP-SOAP/5.3.15, gzip
>
> Accept-Encoding: gzip, deflate
>
> Content-Encoding: gzip
> Content-Type: text/xml; charset=utf-8
>
> SOAPAction: ""
>
> Content-Length: 626
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="
> https://adwords.google.com/api/adwords/cm/v201209";>
>   <SOAP-ENV:Header>
>     <ns1:RequestHeader>
>       <ns1:authToken>*****</ns1:authToken>
>       <ns1:clientCustomerId>123456789</ns1:clientCustomerId>
>       <ns1:developerToken>987654321token</ns1:developerToken>
>       <ns1:userAgent>TestTool (AwApi/3.1.1, php/5.3.15)</ns1:userAgent>
>     </ns1:RequestHeader>
>   </SOAP-ENV:Header>
>   <SOAP-ENV:Body>
>     <ns1:mutate>
>       <ns1:operations>
>         <ns1:operator>ADD</ns1:operator>
>         <ns1:operand>
>           <ns1:name>TestCampaign #5102bade7612e</ns1:name>
>           <ns1:period>DAILY</ns1:period>
>           <ns1:amount>
>             <ns1:microAmount>50000000</ns1:microAmount>
>           </ns1:amount>
>           <ns1:deliveryMethod>STANDARD</ns1:deliveryMethod>
>         </ns1:operand>
>       </ns1:operations>
>     </ns1:mutate>
>   </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> HTTP/1.1 500 Internal Server Error
>
> Content-Type: text/xml; charset=UTF-8
>
> Content-Encoding: gzip
>
> Date: Fri, 25 Jan 2013 17:03:22 GMT
>
> Expires: Fri, 25 Jan 2013 17:03:22 GMT
>
> Cache-Control: private, max-age=0
>
> X-Content-Type-Options: nosniff
>
> X-Frame-Options: SAMEORIGIN
>
> X-XSS-Protection: 1; mode=block
>
> Content-Length: 311
>
> Server: GSE
>
> <?xml version="1.0"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>   <soap:Header>
>     <ResponseHeader xmlns="
> https://adwords.google.com/api/adwords/cm/v201209";>
>       <requestId>0004d41fe7adf2700ae5630d00001737</requestId>
>       <serviceName>BudgetService</serviceName>
>       <methodName>mutate</methodName>
>       <operations>0</operations>
>       <responseTime>73</responseTime>
>       <units>0</units>
>     </ResponseHeader>
>   </soap:Header>
>   <soap:Body>
>     <soap:Fault>
>       <faultcode>soap:Server</faultcode>
>       <faultstring>Fault occurred while processing.</faultstring>
>     </soap:Fault>
>   </soap:Body>
> </soap:Envelope>
>
>
> Here is the code for the script, it's practically the same as the example, 
> only with some modifications so it actually works:
>
> <?php
> require_once 
> ('adwords_api/src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php');
>
> function AddCampaign($user) {
>
>       // Get the BudgetService, which loads the required classes.
>   $budgetService = $user->GetService('BudgetService', 'v201209');
>
>   // Create the shared budget (required).
>   $budget = new Budget();
>   $budget->name = 'TestCampaign #' . uniqid();
>   $budget->period = 'DAILY';
>   $budget->amount = new Money(50000000);
>   $budget->deliveryMethod = 'STANDARD';
>
>   $operations = array();
>
>   // Create operation.
>   $operation = new BudgetOperation();
>   $operation->operand = $budget;
>   $operation->operator = 'ADD';
>   $operations[] = $operation;
>
>    // Make the mutate request. Error pops up here.
>   $result = $budgetService->mutate($operations);
>
>   $budget = $result->value[0];
>
>   // Get the CampaignService, which loads the required classes.
>   $campaignService = $user->GetService('CampaignService', 'v201209');
>
>   $numCampaigns = 3;
>   $operations = array();
>   for ($i = 0; $i < $numCampaigns; $i++) {
>     // Create campaign.
>     $campaign = new Campaign();
>     $campaign->name = 'TestCampaign #' . uniqid();
>
>     // Set shared budget (required).
>     $campaign->budget = new Budget();
>     $campaign->budget->budgetId = $budget->budgetId;
>
>     // Set bidding strategy (required).
>     $biddingStrategy = new ManualCPC();
>     $biddingStrategy->enhancedCpcEnabled = TRUE;
>     $campaign->biddingStrategy = $biddingStrategy;
>
>     // Set keyword matching setting (required).
>     $keywordMatchSetting = new KeywordMatchSetting();
>     $keywordMatchSetting->optIn = TRUE;
>     $campaign->settings[] = $keywordMatchSetting;
>
>     // Set network targeting (recommended).
>     $networkSetting = new NetworkSetting();
>     $networkSetting->targetGoogleSearch = TRUE;
>     $networkSetting->targetSearchNetwork = TRUE;
>     $networkSetting->targetContentNetwork = TRUE;
>     $campaign->networkSetting = $networkSetting;
>
>     // Set additional settings (optional).
>     $campaign->status = 'ACTIVE';
>     $campaign->startDate = date('Ymd', strtotime('+1 day'));
>     $campaign->endDate = date('Ymd', strtotime('+1 month'));
>     $campaign->adServingOptimizationStatus = 'ROTATE';
>
>     // Set frequency cap (optional).
>     $frequencyCap = new FrequencyCap();
>     $frequencyCap->impressions = 5;
>     $frequencyCap->timeUnit = 'DAY';
>     $frequencyCap->level = 'ADGROUP';
>     $campaign->frequencyCap = $frequencyCap;
>
>     // Display network targeting settings (optional).
>     // It can only be enabled, shown only for demonstration purposes.
>     // If not set this setting is enabled by default on ADD operations.
>     $targetRestrictSetting = new TargetRestrictSetting();
>     $targetRestrictSetting->useAdGroup = TRUE;
>     $campaign->settings[] = $targetRestrictSetting;
>
>     // Set advanced location targeting settings (optional).
>     $geoTargetTypeSetting = new GeoTargetTypeSetting();
>     $geoTargetTypeSetting->positiveGeoTargetType = 'DONT_CARE';
>     $geoTargetTypeSetting->negativeGeoTargetType = 'DONT_CARE';
>     $campaign->settings[] = $geoTargetTypeSetting;
>
>     // Create operation.
>     $operation = new CampaignOperation();
>     $operation->operand = $campaign;
>     $operation->operator = 'ADD';
>     $operations[] = $operation;
>   }
>
>   // Make the mutate request.
>   $result = $campaignService->mutate($operations);
>
>   // Display results.
>   foreach ($result->value as $campaign) {
>     printf("Campaign with name '%s' and id '%s' was added.\n", 
> $campaign->name,
>         $campaign->id);
>   }
> }
>
> try {
>
>     
>     $email = "testemail";
>     $password = "testpassword";
>     $developerToken = "987654321token";
>     $userAgent = "TestTool";
>     $clientId = "123456789";
>
>     //Create User
>     $user = new AdWordsUser(NULL, $email, $password, $developerToken,
>                     $auth, $userAgent, $clientId);
>     $user->LogAll();
>
>     // Run the function
>     AddCampaign($user);
>
> } catch (Exception $e) {
>     printf("An error has occurred: %s\n", $e->getMessage());
> }
> ?>
>
> I've done a getCampaigns script, which works properly, showing no 
> campaigns as there are none. But when trying to add, I get the error.
>
> So yeah, am I doing something wrong here? Or is it from the API's side? Or 
> something else?
> And I currently use the test account email and password, should I put the 
> MCC account's to those fields even when I'm using the test account?
>
> I'm still pretty much a beginner with this and can't find a solution...
>
> Thanks in advance!
>

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

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