hello,

I try to make a report, I try to fix changing the columns,
SelectedReportType, etc, but its not work:

the error is:

Report job failed validation due to the following error: The following
SOAP fault occurred:
  faultcode: soapenv:Server.userException
  faultstring: org.xml.sax.SAXException: No deserializer defined for
array type {http://www.w3.org/1999/XMLSchema}ur-type

the script its not executed completely, the mensage is in the
validateReportJob.

I only need (now) get 3 columns, this columns are (Campaign Campaingid
CampaignStatus), the 'selectedReportType' => 'Campaign'  and
'aggregationTypes' => ['Daily'].



this is my code (a copy of the example in google AdWord):

use strict;
use warnings;
use English '-no_match_vars';
use SOAP::Lite;
use LWP::Simple qw();
use IO::Uncompress::Gunzip qw();

binmode(STDOUT, ':utf8');

my $email = '[email protected]';
my $password = 'XXXXXXXXXX';
my $client_email = '[email protected]';
my $useragent = 'Perl Sample Code';
my $developer_token = 'XXXXXXXXX++QWE';
my $application_token = '';

my $url = sprintf('https://%s.google.com/api/adwords/v13/
ReportService',
                  'sandbox');
my $wsdl = $url . '?wsdl';
my $service = SOAP::Lite->service($wsdl)->autotype(0)->readable(1)-
>proxy($url);

$service->on_fault(sub {
                     my $response = $ARG[1];
                     die('The following SOAP fault occurred:', "\n",
                         '  faultcode: ', $response->faultcode(),
"\n",
                         '  faultstring: ', $response->faultstring(),
"\n")
                   });
#SOAP::Lite->import(+trace => 'debug');

# Define SOAP headers.
my @headers = (
  SOAP::Header->name('email' => $email),
  SOAP::Header->name('password' => $password),
  SOAP::Header->name('clientEmail' => $client_email),
  SOAP::Header->name('useragent' => $useragent),
  SOAP::Header->name('developerToken' => $developer_token),
);

my $report_job = SOAP::Data->name('job' =>
  {'selectedReportType' => 'Campaign',
   'name' => 'Sample Keyword Report',
   'aggregationTypes' => ['Daily'],
   'selectedColumns' => [qw(Campaign Campaingid CampaignStatus
                           )]
  });


$report_job->attr({'xsi:type' => 'DefinedReportJob',
                   'xmlns' => 'https://adwords.google.com/api/adwords/
v13'});

eval {
  # Validate report.
  $service->call('validateReportJob' => $report_job, @headers);

  # Schedule report.
  my $job_id = $service->call('scheduleReportJob' => $report_job,
@headers)
    ->result();
  $job_id = SOAP::Data->name('reportJobId' => $job_id);

  # Wait for report to finish.
  my $status = $service->call('getReportJobStatus' => $job_id,
@headers)
    ->result();
  while ($status ne 'Completed' and $status ne 'Failed') {
    printf("Report job status is '%s'.\n", $status);
    sleep(30);
    $status = $service->call('getReportJobStatus' => $job_id,
@headers)
      ->result();
  }

  if ($status eq 'Failed') {
    die("Report job generation failed.\n");
  }

  # Download report.
  my $report_url = $service->call('getGzipReportDownloadUrl' =>
$job_id,
    @headers)->result();
  printf("Report is available at '%s'.\n", $report_url);

  # Write report to local file.
  my $gzip_report_data = LWP::Simple::get($report_url);
  my $file = 'keyword_report.xml';
  IO::Uncompress::Gunzip::gunzip(\$gzip_report_data => $file);
  printf("Report has been written to '%s'.\n", $file);
};


if ($@) {
  print("Report job failed validation due to the following error: ",
$@, "\n");
}




thanks for your help.

Regards,
Benjamin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to