我需要创建一个沙箱帐户:http://code.google.com/apis/adwords/docs/sandbox.html
不幸的是,在针对他们提供的 WSDL 位置发出 GET 时,我遇到了 500 错误,(没有这样的操作:(HTTP GET PATH_INFO:/v201109/CampaignService))
该链接指出:
To create a sandbox account, send a get request to the sandbox version of CampaignService, using the WSDL location and sandbox headers as described below. This initial call to the sandbox creates an MCC sandbox account, along with five client accounts, for the email address you specified. Your sandbox account and its client accounts start out empty."
我创建了我的 authToken:
my $token = Google::Ads::Common::AuthToken::get_token({
email => EMAIL,
password => PASSWORD,
service => "adwords"
});
但是,向指定的 WSDL 位置结果发出 GET 请求 出现 500 错误,内容如下:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>No such operation: (HTTP GET PATH_INFO: /v201109/CampaignService)</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
我正在使用以下代码:
use HTTP::Request;
use LWP::UserAgent;
my $wsdl_location =
'https://adwords-sandbox.google.com/api/adwords/cm/v201109/CampaignService';
my $req = HTTP::Request->new( GET => $wsdl_location );
$req->header(
":authToken" => $auth_token,
":developerToken" => EMAIL . '++USD',
":userAgent" => 'weborama',
);
my $ua = LWP::UserAgent->new;
$ua->add_handler("request_send", sub { shift->dump; return });
$ua->add_handler("response_done", sub { shift->dump; return });
my $res = $ua->request($req);
if ( $res->is_success ) {
print $res->content;
}
else {
print $res->status_line, "\n";
}
我的请求 header :
GET https://adwords-sandbox.google.com/api/adwords/cm/v201109/CampaignService
User-Agent: libwww-perl/6.02
authToken: *********
developerToken: EMAIL++USD
userAgent: weborama
有没有人用 Perl 和 v201109 完成这项工作?我错过了一些明显的东西吗? (我没有收到 Google Adwords API 论坛的回复)
最佳答案
关于perl - v2011109 沙盒上的 Adwords API 出现 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8446962/