如何修复请求缺少必需的输入标签
How to fix request is missing required input tag
我正在尝试从用户的 ebay 帐户获取一些产品,但是当我 运行 我的代码时,我只收到错误 "Your application encountered an error. This request is missing required input tag " 或“。”
<?php
function print_d($array){ echo "<pre>\n"; print_r($array); echo "</pre>\n";}
$mytoken = "************mytoken************";
$devId = "************mydevId************";
$appId = "************myappId************";
$certId = "************mycertId************";
$wsdl_url = 'http://developer.ebay.com/webservices/latest/ebaySvc.wsdl';
$apiCall = "GetSellerList";
$credentials = array('AppId' => $appId, 'DevID' => $devId, 'AuthCert' => $certId);
$client = new SOAPClient($wsdl_url, array('trace' => 1, 'exceptions' => 0, 'location' => "https://api.ebay.com/wsapi?callname=$apiCall&appid=$appId&siteid=0&version=803&Routing=new"));
$eBayAuth = array('eBayAuthToken' => new SoapVar($mytoken, XSD_STRING, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'),
'Credentials' => new SoapVar ($credentials, SOAP_ENC_OBJECT, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'));
$header_body = new SoapVar($eBayAuth, SOAP_ENC_OBJECT);
$header = array(new SOAPHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $header_body));
//set the API call parameters
$params = array('UserID'=>'**sellerid**','DetailLevel'=>'ReturnAll','WarningLevel'=>'High','IncludeWatchCount'=>'true','Pagination'=>array('EntriesPerPage'=>'20','PageNumber'=>'1'),'Version' => '803', 'CreateTimeFrom'=>'2019-07-01T01:01:02.768Z', 'CreateTimeTo'=>'2019-08-22T01:01:02.768Z');
$request = $client->__soapCall($apiCall, array($params), NULL, $header); //make the actual API call
print_d($request);
?>
这是我得到的:
stdClass Object
(
[Timestamp] => 2019-08-23T05:54:30.954Z
[Ack] => Failure
[Errors] => stdClass Object
(
[ShortMessage] => Your application encountered an error.
[LongMessage] => Your application encountered an error. This request is missing required input tag " or ".
[ErrorCode] => 34
[SeverityCode] => Error
[ErrorParameters] => stdClass Object
(
[Value] => or
[ParamID] => 0
)
[ErrorClassification] => RequestError
)
[Version] => 1119
[Build] => E1119_CORE_APISELLING_19039141_R1
)```
谢谢我只使用邮递员,我发现 StartTimeFrom 和 StartTimeTo 是缺少的那个
我在德语中遇到了同样的错误 Your application encountered an error. This request is missing required input tag ""
或 In der Anwendung ist ein Fehler aufgetreten. In dieser Anforderung fehlt der erforderliche Eingabetag ""
。
首先,如果您在浏览器中发出请求(99% 确定),您必须查看 浏览器源代码 HTML 代码 (CTRL+U),有一个标签信息将显示隐藏在“漂亮”的浏览器视图中。
在我的例子中,我错过了 eBay developer API AddItem
method Item.PrimaryCategory.CategoryID
tag,这在文档中不是必需的,但在实际中是必需的。
我正在尝试从用户的 ebay 帐户获取一些产品,但是当我 运行 我的代码时,我只收到错误 "Your application encountered an error. This request is missing required input tag " 或“。”
<?php
function print_d($array){ echo "<pre>\n"; print_r($array); echo "</pre>\n";}
$mytoken = "************mytoken************";
$devId = "************mydevId************";
$appId = "************myappId************";
$certId = "************mycertId************";
$wsdl_url = 'http://developer.ebay.com/webservices/latest/ebaySvc.wsdl';
$apiCall = "GetSellerList";
$credentials = array('AppId' => $appId, 'DevID' => $devId, 'AuthCert' => $certId);
$client = new SOAPClient($wsdl_url, array('trace' => 1, 'exceptions' => 0, 'location' => "https://api.ebay.com/wsapi?callname=$apiCall&appid=$appId&siteid=0&version=803&Routing=new"));
$eBayAuth = array('eBayAuthToken' => new SoapVar($mytoken, XSD_STRING, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'),
'Credentials' => new SoapVar ($credentials, SOAP_ENC_OBJECT, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'));
$header_body = new SoapVar($eBayAuth, SOAP_ENC_OBJECT);
$header = array(new SOAPHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $header_body));
//set the API call parameters
$params = array('UserID'=>'**sellerid**','DetailLevel'=>'ReturnAll','WarningLevel'=>'High','IncludeWatchCount'=>'true','Pagination'=>array('EntriesPerPage'=>'20','PageNumber'=>'1'),'Version' => '803', 'CreateTimeFrom'=>'2019-07-01T01:01:02.768Z', 'CreateTimeTo'=>'2019-08-22T01:01:02.768Z');
$request = $client->__soapCall($apiCall, array($params), NULL, $header); //make the actual API call
print_d($request);
?>
这是我得到的:
stdClass Object
(
[Timestamp] => 2019-08-23T05:54:30.954Z
[Ack] => Failure
[Errors] => stdClass Object
(
[ShortMessage] => Your application encountered an error.
[LongMessage] => Your application encountered an error. This request is missing required input tag " or ".
[ErrorCode] => 34
[SeverityCode] => Error
[ErrorParameters] => stdClass Object
(
[Value] => or
[ParamID] => 0
)
[ErrorClassification] => RequestError
)
[Version] => 1119
[Build] => E1119_CORE_APISELLING_19039141_R1
)```
谢谢我只使用邮递员,我发现 StartTimeFrom 和 StartTimeTo 是缺少的那个
我在德语中遇到了同样的错误 Your application encountered an error. This request is missing required input tag ""
或 In der Anwendung ist ein Fehler aufgetreten. In dieser Anforderung fehlt der erforderliche Eingabetag ""
。
首先,如果您在浏览器中发出请求(99% 确定),您必须查看 浏览器源代码 HTML 代码 (CTRL+U),有一个标签信息将显示隐藏在“漂亮”的浏览器视图中。
在我的例子中,我错过了 eBay developer API AddItem
method Item.PrimaryCategory.CategoryID
tag,这在文档中不是必需的,但在实际中是必需的。