本文介绍了正确数据时出错105 - PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好。



使用PHP库和KeywordPerformance示例,我得到105错误。


该问题似乎与"错误105 Bingads API v9"不同。因为生成的SOAP不同。


我在下面发布它。


- 标题似乎很奇怪,但是当我使用提供的API时,我更愿意在调整它之前询问。


使用ConstructWithCredentials或 生成代理; ConstructWithAccountId(此SOAP请求的ConstructWithCredentials)。


-  范围似乎也很奇怪但是生成时带有 

 $ report - > Scope = new AccountThroughAdGroupReportScope(); 
$ report-> Scope-> AccountIds = null;
$ report-> Scope-> AdGroups = null;

$ report-> Scope-> Campaigns = array();
$ campaignReportScope = new CampaignReportScope();
$ campaignReportScope-> CampaignId = $ CampaignId;
$ campaignReportScope-> AccountId = $ AccountId;
$ report-> Scope-> Campaigns [] = $ campaignReportScope;



< soap-env:envelope xmlns :SOAP-ENV = QUOT; HTTP://schemas.xmlsoap.org/soap/envelope/"的xmlns:NS1 = QUOT; HTTPS://bingads.microsoft.com/Reporting/v9"的xmlns:的xsi = QUOT; HTTP://www.w3.org/2001/XMLSchema-instance">< SOAP-ENV:报头GT;< NS1:customeraccountid>< NS1:客户id>< NS1:developertoken> XXXXX< / NS1:developertoken>< NS1:用户名> XXXXX< / NS1:用户名>< NS1:密码> XXXXX< / NS1:密码>< / NS1:客户id>< / NS1:customeraccountid>< / soap-env:header>< soap-env:body>< ns1:submitgeneratereportrequest>< ns1:reportrequest xsi:type =" ns1:KeywordPerformanceReportRequest">< ns1:format> Tsv< / ns1:format> < ns1:language xsi:nil =" true">< ns1:reportname>我的关键字效果报告< / ns1:reportname>< ns1:returnonlycompletedata> false< / ns1:returnonlycompletedata>< ns1:aggregation>每日与LT; / NS1:聚合>< NS1:列>< NS1:keywordperformancereportcolumn> TIMEPERIOD< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn> ACCOUNTID< / NS1:keywordperformancereportcolumn& GT;< NS1:keywordperformancereportcolumn> CAMPAIGNID< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>关键字< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn> KeywordId< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>设备类型< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn> BidMatchType< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>点击< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>曝光< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn> CTR< ; / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn> AverageCpc< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>花< / NS1:keywordperformancereportcolumn>< NS1:keywordperformancereportcolumn>的QualityScore< / NS1:K eywordperformancereportcolumn>< / ns1:columns>< ns1:filter xsi:nil =" true">< ns1:maxrows> 10< / ns1:maxrows>< ns1:scope>< ns1:accountids xsi: nil =" true">< ns1:adgroups xsi:nil =" true">< ns1:campaigns>< ns1:campaignreportscope>< ns1:accountid> XXXXX< / ns1:accountid>< NS1:CAMPAIGNID> XXXXX< / NS1:CAMPAIGNID>< / NS1:campaignreportscope>< / NS1:系列>< / NS1:广告组>< / NS1:accountids>< / NS1:范围>< NS1:排序>< NS1:keywordperformancereportsort>< NS1:sortcolumn>点击< / NS1:sortcolumn>< NS1:排序顺序>升序< / NS1:排序顺序>< / NS1:keywordperformancereportsort>< / NS1:排序>< NS1:时间>< NS1:customdaterangeend>< NS1:天>< NS1:月>< NS1:年>< / NS1:年>< / NS1:月>< / NS1:天>< ; / NS1:customdaterangeend>< NS1:customdaterangestart>< NS1:天>< NS1:月>< NS1:年>< / NS1:年&克t;< / ns1:month>< / ns1:day>< / ns1:customdaterangestart>< ns1:predefinedtime xsi:nil =" true">< / ns1:predefinedtime>< / ns1:时间>< / NS1:滤光器>< / NS1:语言>< / NS1:的ReportRequest>< / NS1:submitgeneratereportrequest>< / SOAP-ENV:体>< / SOAP-ENV:包络GT; 

你知道为什么我会收到这个105错误的原因吗?


为了避免由于空的提供问题而导致问题,我更新了ClientProxy。 php所以

 $ headers [] =新的SoapHeader(
$ this-> namespace,'AuthenticationToken' ,$ this-> authenticationToken
);

变为

 if(!empty($ this-> authenticationToken)){
$ headers [] =新的SoapHeader(
$ this-> namespace,'AuthenticationToken',$ this-> authenticationToken
);
}



解决方案




Good morning.

Using the PHP library and the KeywordPerformance example, I get a 105 error.

The issue seems different from "Error 105 Bingads API v9" as the generated SOAP is different.

I post it below.

- The header seems weird but as I use provided API, I prefer to ask before tweaking it.

Proxy is generated with either ConstructWithCredentials or ConstructWithAccountId (ConstructWithCredentials for this SOAP request).

- Scope seems also weird but generated with 

 $report->Scope = new AccountThroughAdGroupReportScope();
	    $report->Scope->AccountIds = null;
	    $report->Scope->AdGroups = null;
	   
 	    $report->Scope->Campaigns = array ();   
	    $campaignReportScope = new CampaignReportScope();
	    $campaignReportScope->CampaignId = $CampaignId;
	    $campaignReportScope->AccountId = $AccountId;
	    $report->Scope->Campaigns[] = $campaignReportScope; 
	    


<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/Reporting/v9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap-env:header><ns1:customeraccountid><ns1:customerid><ns1:developertoken>XXXXX</ns1:developertoken><ns1:username>XXXXX</ns1:username><ns1:password>XXXXX</ns1:password></ns1:customerid></ns1:customeraccountid></soap-env:header><soap-env:body><ns1:submitgeneratereportrequest><ns1:reportrequest xsi:type="ns1:KeywordPerformanceReportRequest"><ns1:format>Tsv</ns1:format><ns1:language xsi:nil="true"><ns1:reportname>My Keyword Performance Report</ns1:reportname><ns1:returnonlycompletedata>false</ns1:returnonlycompletedata><ns1:aggregation>Daily</ns1:aggregation><ns1:columns><ns1:keywordperformancereportcolumn>TimePeriod</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>AccountId</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>CampaignId</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>Keyword</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>KeywordId</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>DeviceType</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>BidMatchType</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>Clicks</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>Impressions</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>Ctr</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>AverageCpc</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>Spend</ns1:keywordperformancereportcolumn><ns1:keywordperformancereportcolumn>QualityScore</ns1:keywordperformancereportcolumn></ns1:columns><ns1:filter xsi:nil="true"><ns1:maxrows>10</ns1:maxrows><ns1:scope><ns1:accountids xsi:nil="true"><ns1:adgroups xsi:nil="true"><ns1:campaigns><ns1:campaignreportscope><ns1:accountid>XXXXX</ns1:accountid><ns1:campaignid>XXXXX</ns1:campaignid></ns1:campaignreportscope></ns1:campaigns></ns1:adgroups></ns1:accountids></ns1:scope><ns1:sort><ns1:keywordperformancereportsort><ns1:sortcolumn>Clicks</ns1:sortcolumn><ns1:sortorder>Ascending</ns1:sortorder></ns1:keywordperformancereportsort></ns1:sort><ns1:time><ns1:customdaterangeend><ns1:day><ns1:month><ns1:year></ns1:year></ns1:month></ns1:day></ns1:customdaterangeend><ns1:customdaterangestart><ns1:day><ns1:month><ns1:year></ns1:year></ns1:month></ns1:day></ns1:customdaterangestart><ns1:predefinedtime xsi:nil="true"></ns1:predefinedtime></ns1:time></ns1:filter></ns1:language></ns1:reportrequest></ns1:submitgeneratereportrequest></soap-env:body></soap-env:envelope>

Do you see any reason why I get this 105 error?

To avoid issue due to empty yet provided AuthenticationToken, I update ClientProxy.php so that

      $headers[] = new SoapHeader(
	$this->namespace, 'AuthenticationToken', $this->authenticationToken
      );

becomes

if(!empty($this->authenticationToken)) {
      $headers[] = new SoapHeader(
	$this->namespace, 'AuthenticationToken', $this->authenticationToken
      );
}


解决方案




这篇关于正确数据时出错105 - PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 15:41