PHP5 + Adwords API: scheduleReportJob = no go!
| From: | Ken Chau | Date: | Sat, 21 Jan 2006 01:03:51 +0000 |
| Subject: | PHP5 + Adwords API: scheduleReportJob = no go! | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-2092@lists.php.net to get a copy of this message | ||
I tried to simply schedule a report job from ext/soap with the code below....
All it would do is tell me that I'm "missing default constructor." Here lies
the rub - I have to specify the job's xsi:type to "KeywordReportJob" - but
where do I do that in PHP5 ext/soap? (answer does NOT lie in documentation)..
Also, if I were to manually do a __doRequest, I realized that the xmlns:xsi
namespace isn't set in the SOAP envelope! Any help?
<?php
$ns = 'https://adwords.google.com/api/adwords/v2';
$headers[] = new SoapHeader($ns, 'email', 'x');
$headers[] = new SoapHeader($ns, 'clientEmail', 'x');
$headers[] = new SoapHeader($ns, 'password', 'x');
$headers[] = new SoapHeader($ns, 'useragent', 'x');
$headers[] = new SoapHeader($ns, 'token', 'x');
$client = new SoapClient("
https://adwords.google.com/api/adwords/v2/ReportService?wsdl",
array("trace"
=> 1));
$client->__setSoapHeaders($headers);
$client->scheduleReportJob(array("job" => array(
'startDate' => '2005-04-01',
'endDate' => '2005-04-01'
)));
?>