[英]Fedex Web Services: ERROR 9040 - Can't pull up tracking
I'm having issues attempting to pull up tracking info using Fedex's Web Services. 我在尝试使用Fedex的Web服务提取跟踪信息时遇到问题。 I am using a valid tracking number and I'm able to view the details on Fedex's site. 我使用的是有效的跟踪号码,我可以在Fedex的网站上查看详细信息。 However, I get an error 9040 "No information for the following shipments has been received by our system yet. Please try again or contact Customer Service at 1.800.Go.FedEx(R) 800.463.3339." 但是,我收到错误9040“我们的系统尚未收到以下货件的信息。请重试或联系客户服务部1.800.Go.FedEx(R)800.463.3339。” Am I leaving something out? 我要留下什么了?
My code: 我的代码:
<?php
$path_to_wsdl = "URL_TO_WSDL";
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient($path_to_wsdl, array('trace' => 1));
$request['WebAuthenticationDetail'] = array(
'UserCredential' =>array(
'Key' => 'MY_KEY',
'Password' => 'MY_PASSWORD'
)
);
$request['ClientDetail'] = array(
'AccountNumber' => 'MY_ACCT',
'MeterNumber' => 'MY_METER'
);
$request['TransactionDetail'] = array('CustomerTransactionId' => 'ActiveShipping');
$request['Version'] = array(
'ServiceId' => 'trck',
'Major' => '5',
'Intermediate' => '0',
'Minor' => '0'
);
$request['PackageIdentifier'] = array(
'Value' => 'TRACKING#',
'Type' => 'TRACKING_NUMBER_OR_DOORTAG');
$response = $client->track($request);
var_dump($response);
?>
Got it! 得到它了!
Call the web services departement and they told me to remove 'beta' from the wsdl file. 打电话给Web服务部门,他们告诉我从wsdl文件中删除“beta”。 This appears to be a different address than what I found in responses to this problem before. 这似乎与我之前在回答此问题时发现的地址不同。 On line 1507 of the wsdl file, make the following change: 在wsdl文件的第1507行,进行以下更改:
From: 从:
<s1:address location="https://wsbeta.fedex.com:443/web-services/track"/>
To 至
<s1:address location="https://ws.fedex.com:443/web-services/track"/>
I changed the rest of my code slightly, but that shouldn't have made the difference. 我稍微更改了其余的代码,但这不应该有所不同。 To be on the safe side, here it is: 为了安全起见,这里是:
<?php
$path_to_wsdl = "PATH_TO_WSDL_FILE";
$client = new SoapClient($path_to_wsdl, array('trace' => 1));
$trackRequest = array(
'WebAuthenticationDetail' => array(
'UserCredential' => array(
'Key' => 'MY_KEY',
'Password' => 'MY_PASSWORD'
)
),
'ClientDetail' => array(
'AccountNumber' => 'MY_ACCT_#',
'MeterNumber' => 'MY_METER_#'
),
'Version' => array(
'ServiceId' => 'trck',
'Major' => '5',
'Intermediate' => '0',
'Minor' => '0'
),
'PackageIdentifier' => array(
'Type' => 'TRACKING_NUMBER_OR_DOORTAG',
'Value' => 'THE_TRACKING_#',
),
'CustomerTrasactionId',
'IncludeDetailedScans' => 1
);
$response = $client->track($trackRequest);
var_dump($response);
?>
I'm also working on this same problem. 我也在研究同样的问题。 I'm trying several things and you can see if anything works for you. 我正在尝试几件事,你可以看看是否有什么对你有用。 Try including ShipDateRangeBegin and End elements, your test account/payer numbers or destination info. 尝试包括ShipDateRangeBegin和End元素,您的测试帐户/付款人号码或目的地信息。 I've found here that switching to xml and ssl post requests supposedly solve the problem, but it's not an option for me. 我在这里发现切换到xml和ssl发布请求可能会解决问题,但它不适合我。 Maybe it will help you? 也许它会对你有所帮助?
I have same problem when use xml-request. 使用xml-request时遇到同样的问题。 I solved the problem this way: 我这样解决了问题:
$endpointurl = "https://gatewaybeta.fedex.com:443/xml"; // remove word "beta"
$endpointurl = "https://gateway.fedex.com:443/xml";
...
$request = stream_context_create($form);
$browser = fopen($endpointurl , 'rb' , false , $request);
$response = stream_get_contents($browser);
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.