Subject: | Unable to create reports |
Date: | Tue, 24 May 2011 16:56:40 +0100 |
To: | bug-Microsoft-AdCenter [...] rt.cpan.org |
From: | Toby Wilkinson <tobes [...] tobestool.net> |
Hi,
I'm trying to use your library to retrieve performance data from MSN
adcenter. In order to get the traffic on the relevant adverts, I'm
trying to schedule some performance reports. Unfortunately I'm unable to
do this successfully.
I'm unsure if this is a fault in the library or simply my using it
incorrectly. Any pointers to get me going in the right direction
gratefully accepted. The code I have is as follows:
# Create the service client
my %logonParams = (ApplicationToken => $login->{'api_dev_token'},
CustomerAccountId => $login->{'account_id'},
CustomerId => $login->{'customer_id'},
DeveloperToken => $login->{'api_dev_token'},
Password => $login->{'api_password'},
UserName => $login->{'api_user'},
RetrySettings => [$retry]);
if ($login->{'sandbox'}) {
$logonParams{'EndPoint'} =
'https://sandboxapi.adcenter.microsoft.com/Api/Advertiser/v7/Reporting/ReportingService.svc?wsdl';
}
# Create the service client
my $reporting_service =
Microsoft::AdCenter::V7::ReportingService->new(%logonParams);
my $reportRequest =
Microsoft::AdCenter::V7::ReportingService::AdGroupPerformanceReportRequest->new
(ReportName => 'Example AdGroupReport',
Aggregation=> 'Daily',
Scope=> {AccountIds => 'NULL'},
Time => 'LastFourWeeks',
Columns => ['AdGroupId', 'Clicks', 'Spend']);
my $response = $reporting_service->SubmitGenerateReport
(ReportRequest => $reportRequest);
print Dumper($response);
Running this results in the following response (I'm using the sandbox at
present for development):
$VAR1 = bless( {
'faultcode' => 'a:DeserializationFailed',
'faultstring' => 'The formatter threw an exception while trying to
deserialize the message: There was an error while trying to deserialize
parameter https://adcenter.microsoft.com/v7:ReportRequest. The
InnerException message was \'Error in line 1 position 1948. Expecting
state \'Element\'.. Encountered \'Text\' with name \'\', namespace
\'\'. \'. Please see InnerException for more details.'
}, 'Microsoft::AdCenter::SOAPFault' );
Thanks for any help!
--Toby