使用node-soap连接Bing Ads API

问题描述 投票:2回答:1

我正在尝试使用node-soap连接到bing ads soap api。我按照bing documentation的建议创建了请求。但每次我尝试连接响应时都会声明无效凭据(错误代码 - 105)消息 - 身份验证失败。提供的凭据无效或帐户处于非活动状态。

我能够使用bing提供的示例C#代码对API进行身份验证。所以,很明显,凭证/令牌工作得非常好。

有没有办法用我的方法或我的节点代码来识别问题。

soap.createClient(url, function (err, client) {
    if (err) {
        console.log("err", err);
    } else {
        client.addSoapHeader({
            'AuthenticationToken': '<AuthenticationToken>',
            'DeveloperToken': '<DeveloperToken>',
            'CustomerId': '<CustomerId>',
            'CustomerAccountId': '<CustomerAccountId>',
        });        
        client.SubmitGenerateReport(args, function (err, result) {
            if (err) {
                console.log("err", err.body);
            } else {
                console.log(result);
            }
        });
    }
});

PS:Bing文档很糟糕。冰雹Stackoverflow!

node.js soap bing node-soap bing-ads-api
1个回答
3
投票

您需要使用tns为标头中的每个键添加前缀,例如:tns:AuthenticationToken

© www.soinside.com 2019 - 2024. All rights reserved.