Created
February 26, 2013 20:34
-
-
Save roycehaynes/5041910 to your computer and use it in GitHub Desktop.
Magento 623 error code issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handle an xmlrpc call (actual work) | |
* | |
* @param Zend_XmlRpc_Request $request | |
* @return Zend_XmlRpc_Response | |
* @throws Zend_XmlRpcServer_Exception|Exception | |
* Zend_XmlRpcServer_Exceptions are thrown for internal errors; otherwise, | |
* any other exception may be thrown by the callback | |
*/ | |
protected function _handle(Zend_XmlRpc_Request $request) | |
{ | |
$method = $request->getMethod(); | |
// Check for valid method | |
if (!$this->_table->hasMethod($method)) { | |
#require_once 'Zend/XmlRpc/Server/Exception.php'; | |
throw new Zend_XmlRpc_Server_Exception('Method "' . $method . '" does not exist', 620); | |
} | |
$info = $this->_table->getMethod($method); | |
$params = $request->getParams(); | |
$argv = $info->getInvokeArguments(); | |
if (0 < count($argv) and $this->sendArgumentsToAllMethods()) { | |
$params = array_merge($params, $argv); | |
} | |
// Check calling parameters against signatures | |
$matched = false; | |
$sigCalled = $request->getTypes(); | |
$sigLength = count($sigCalled); | |
$paramsLen = count($params); | |
if ($sigLength < $paramsLen) { | |
for ($i = $sigLength; $i < $paramsLen; ++$i) { | |
$xmlRpcValue = Zend_XmlRpc_Value::getXmlRpcValue($params[$i]); | |
$sigCalled[] = $xmlRpcValue->getType(); | |
} | |
} | |
$signatures = $info->getPrototypes(); | |
foreach ($signatures as $signature) { | |
$sigParams = $signature->getParameters(); | |
if ($sigCalled === $sigParams) { | |
$matched = true; | |
break; | |
} | |
} | |
if (!$matched) { | |
#require_once 'Zend/XmlRpc/Server/Exception.php'; | |
throw new Zend_XmlRpc_Server_Exception('Calling parameters do not match signature', 623); | |
} | |
$return = $this->_dispatch($info, $params); | |
$responseClass = $this->getResponseClass(); | |
return new $responseClass($return); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment