--- Server.php 2007-11-13 16:50:53.000000000 -0500 +++ Server_new.php 2008-01-31 17:02:05.000000000 -0500 @@ -132,9 +132,14 @@ $func_args = $this->_functions[$this->_method]->getParameters(); $calling_args = array(); + $required_args = array(); foreach ($func_args as $arg) { - if (isset($request[strtolower($arg->getName())])) { - $calling_args[] = $request[strtolower($arg->getName())]; + $lower_arg_name = strtolower($arg->getName()); + if (isset($request[$lower_arg_name])) { + $calling_args[] = $request[$lower_arg_name]; + } + if (!$arg->isOptional()) { + $required_args[] = $lower_arg_name; } } @@ -145,8 +150,8 @@ } } - if (count($calling_args) < count($func_args)) { - throw new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($func_args) . ', ' . count($calling_args) . ' given.', 400); + if (count($calling_args) < count($required_args)) { + throw new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($required_args) . ', ' . count($calling_args) . ' given.', 400); } if ($this->_functions[$this->_method] instanceof Zend_Server_Reflection_Method) {