1
我向ebay發送xml請求,但它沒有響應任何內容。我檢查了像runame,header和curl這樣的每個字段,但仍然沒有出現任何錯誤。任何人都可以解決這個問題?Ebay使用curl發送xml請求
$runame = "Th_c_L__B_-ThcLB-SynEbay-S-swfednxx";
$xml = '<?xml version="1.0" encoding="utf-8"?>'.
'<GetSessionIDRequest xmlns="urn:ebay:apis:eBLBaseComponents">'.
'<RuName>'.$runame.'</RuName>'.
'</GetSessionIDRequest>';
$headers = array(
'Content-Type' => 'text/xml',
'X-EBAY-API-COMPATIBILITY-LEVEL' => '889',
'X-EBAY-API-DEV-NAME' => $devId,
'X-EBAY-API-APP-NAME' => $appId,
'X-EBAY-API-CERT-NAME' => $certId,
'X-EBAY-API-SITEID' => '0',
'X-EBAY-API-CALL-NAME' => 'GetSessionID'
);
$url = 'https://api.sandbox.ebay.com/ws/api.dll';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_TIMEOUT, 400);
$result = curl_exec($ch);
curl_close($ch);
echo '<pre>';
print_r($result);
echo '</pre>';
當您使用命令行curl發送相同的XML時會發生什麼? – Nikem
必須有一些方法來獲得有關捲曲結果的更多信息? (HTTP代碼,頭文件等)我建議您挖掘並評估您在那裏找到的內容。 –