Question by gdwsports · Nov 09, 2016 at 08:15 AM · reviseinventorystatusrequest
ReviseInventoryStatusRequest - quit working?
I had this working just fine up until a few weeks ago; it's been working fine for well over a year now. Anyone know why it would just suddenly stop working? Here is the code that worked fine to submit this to eBay and it suddenly quit working (haven't touched the code at all):
$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
$requestXmlBody .= '<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
$requestXmlBody .= '<RequesterCredentials>';
$requestXmlBody .= '<eBayAuthToken>'.$userToken.'</eBayAuthToken>';
$requestXmlBody .= '</RequesterCredentials>';
$requestXmlBody .= '<ErrorLanguage>en_US</ErrorLanguage>';
$requestXmlBody .= '<WarningLevel>High</WarningLevel>';
foreach ($newInv as $value){
$sku = $tableData[$value]['sku'];
$itID = $quant[$sku][1];
$qty = $tableData[$value]['inv'];
///Build the request Xml string
$requestXmlBody .= ''; $requestXmlBody .= ''.$sku.''; $requestXmlBody .= ''.$itID.''; $requestXmlBody .= ''.$qty.''; $requestXmlBody .= '';
}
$requestXmlBody .= '';
//Create a new eBay session with all details pulled in from included keys.php $session = new eBaySession($userToken, $devID, $appID, $certID, $serverUrl, $compatabilityLevel, $siteID, $verb);
//send the request and get response $responseXml = $session->sendHttpRequest($requestXmlBody);
if (stristr($responseXml, 'HTTP 404') || $responseXml == '') die('Error sending request');
//Xml string is parsed and creates a DOM Document object $responseDoc = new DomDocument(); $responseDoc->loadXML($responseXml);
//get any error nodes $errors = $responseDoc->getElementsByTagName('Errors'); $response = simplexml_import_dom($responseDoc); $entries = $response->PaginationResult->TotalNumberOfEntries;
//if there are error nodes if ($errors->length > 0) { echo 'eBay returned the following error(s):'; //display each error //Get error code, ShortMesaage and LongMessage $code = $errors->item(0)->getElementsByTagName('ErrorCode'); $shortMsg = $errors->item(0)->getElementsByTagName('ShortMessage'); $longMsg = $errors->item(0)->getElementsByTagName('LongMessage'); //Display code and shortmessage echo '', $code->item(0)->nodeValue, ' : ', str_replace(">", ">", str_replace("<", "<", $shortMsg->item(0)->nodeValue));
//if there is a long message (ie ErrorLevel=1), display it
if (count($longMsg) > 0)
echo '<BR>', str_replace(">", ">", str_replace("<", "<", $longMsg->item(0)->nodeValue));
}else { //If there are no errors, continue if(isset($_GET['debug'])) {
header("Content-type: text/xml"); print_r($responseXml); }else { //$responseXml is parsed in view.php include_once 'ship.php'; } }
/* } else{ echo "no sku"; echo "
"; }
Your answer
