|
|
@@ -190,11 +190,14 @@ class Zend_Rest_Server implements Zend_Server_Interface
|
|
|
$func_args = $this->_functions[$this->_method]->getParameters();
|
|
|
|
|
|
$calling_args = array();
|
|
|
+ $missing_args = array();
|
|
|
foreach ($func_args as $arg) {
|
|
|
if (isset($request[strtolower($arg->getName())])) {
|
|
|
$calling_args[] = $request[strtolower($arg->getName())];
|
|
|
} elseif ($arg->isOptional()) {
|
|
|
$calling_args[] = $arg->getDefaultValue();
|
|
|
+ } else {
|
|
|
+ $missing_args[] = $arg->getName();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -202,6 +205,9 @@ class Zend_Rest_Server implements Zend_Server_Interface
|
|
|
if (substr($key, 0, 3) == 'arg') {
|
|
|
$key = str_replace('arg', '', $key);
|
|
|
$calling_args[$key] = $value;
|
|
|
+ if (($index = array_search($key, $missing_args)) !== false) {
|
|
|
+ unset($missing_args[$index]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -211,7 +217,7 @@ class Zend_Rest_Server implements Zend_Server_Interface
|
|
|
$result = false;
|
|
|
if (count($calling_args) < count($func_args)) {
|
|
|
require_once 'Zend/Rest/Server/Exception.php';
|
|
|
- $result = $this->fault(new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($func_args) . ', ' . count($calling_args) . ' given.'), 400);
|
|
|
+ $result = $this->fault(new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Missing argument(s): ' . implode(', ', $missing_args) . '.'), 400);
|
|
|
}
|
|
|
|
|
|
if (!$result && $this->_functions[$this->_method] instanceof Zend_Server_Reflection_Method) {
|