【发布时间】:2015-11-09 17:46:41
【问题描述】:
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
);
【问题讨论】: