繁体   English   中英

Fedex API-身份验证仅可用于创建运输标签失败

[英]Fedex API - Authentication Failed for creating shipping labels only

fedex API的开发已完成,我正在尝试转为生产。

我使用以下常量作为凭据:

FEDEX_KEY // The fedex production key
FEDEX_PASSWORD // The api passwd
FEDEX_ACCOUNT_NUMBER // The account number tied to the key/pw
FEDEX_METER_NUMBER // The meter number tied to the key/pw

如“移至生产”中所述,我从所有.wsdl文件中删除了“ beta”属性。

我正在获得运输成本的实时估计,这告诉我我的凭据正在正确阅读。

问题是创建货运标签不起作用,并且给我以下错误:

The transaction returned an Error.
Severity: ERROR
Source: prof
Code: 1000
Message: Authentication Failed

Request
//Hiding this due to containing private information
Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><v17:ProcessShipmentReply xmlns:v17="http://fedex.com/ws/ship/v17"> <v17:HighestSeverity xmlns:v17="http://fedex.com/ws/ship/v17">ERROR</v17:HighestSeverity>  <v17:Notifications xmlns:v17="http://fedex.com/ws/ship/v17">     <v17:Severity xmlns:v17="http://fedex.com/ws/ship/v17">ERROR</v17:Severity>     <v17:Source xmlns:v17="http://fedex.com/ws/ship/v17">prof</v17:Source>     <v17:Code xmlns:v17="http://fedex.com/ws/ship/v17">1000</v17:Code>     <v17:Message xmlns:v17="http://fedex.com/ws/ship/v17">Authentication Failed</v17:Message>  </v17:Notifications> <v17:TransactionDetail xmlns:v17="http://fedex.com/ws/ship/v17"><v17:CustomerTransactionId xmlns:v17="http://fedex.com/ws/ship/v17">*** Ground Domestic Shipping Request using PHP ***</v17:CustomerTransactionId> </v17:TransactionDetail>  <v17:Version xmlns:v17="http://fedex.com/ws/ship/v17">     <v17:ServiceId xmlns:v17="http://fedex.com/ws/ship/v17">ship</v17:ServiceId>     <v17:Major xmlns:v17="http://fedex.com/ws/ship/v17">17</v17:Major>     <v17:Intermediate xmlns:v17="http://fedex.com/ws/ship/v17">0</v17:Intermediate>     <v17:Minor xmlns:v17="http://fedex.com/ws/ship/v17">0</v17:Minor>  </v17:Version> </v17:ProcessShipmentReply></SOAP-ENV:Body></SOAP-ENV:Envelope>

这是我打的电话

//Creating new SoapClient and setting path to the Shipping .wsdl
$path_to_wsdl = $_SERVER['DOCUMENT_ROOT']."/portal/API/FedEx/wsdl/ShipService_v17.wsdl";
$client = new SoapClient($path_to_wsdl, array('trace' => 1));

//This is the snippet where I set the credentials
$masterRequest['WebAuthenticationDetail'] = array(
    'ParentCredential' => array(
        'Key' => getProperty('parentkey'),
        'Password' => getProperty('parentpassword')
    ),
    'UserCredential' => array(
        'Key' => FEDEX_KEY, 
        'Password' => FEDEX_PASSWORD
    )
);
$masterRequest['ClientDetail'] = array(
    'AccountNumber' => FEDEX_ACCOUNT_NUMBER, 
    'MeterNumber' => FEDEX_METER_NUMBER
);

在测试模式和实时模式下,FedEx的帐号和仪表号不同-您是否进行了相应的更改? 在测试和实时模式下不能使用相同的值。

您也可以在FedEx开发人员资源中心的“移至生产”部分中获得生产仪表编号。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM