Index: Zend/Json/Server.php
===================================================================
--- Zend/Json/Server.php (revision 21613)
+++ Zend/Json/Server.php (working copy)
@@ -526,6 +526,37 @@
$params = $this->_getDefaultParams($params, $serviceParams);
}

+ //Make sure named parameters are passed in correct order
+ if( is_string( key( $params ) ) ) {
+
+ $callback = $invocable->getCallback();
+ if( 'function' == $callback->getType() ) {
+ $reflection = new ReflectionFunction( $callback->getFunction() );
+ $refParams = $reflection->getParameters();
+ } else {
+
+ $reflection = new ReflectionMethod(
+ $callback->getClass(),
+ $callback->getMethod()
+ );
+ $refParams = $reflection->getParameters();
+ }
+
+ $newParams = array();
+ foreach( $reflection->getParameters() as $refParam ) {
+ if( isset( $params[ $refParam->getName() ] ) ) {
+ $newParams[ $refParam->getName() ] = $params[ $refParam->getName() ];
+ } elseif( $refParam->isOptional() ) {
+ $newParams[ $refParam->getName() ] = null;
+ } else {
+ throw new Zend_Server_Exception(
+ 'Missing required parameter: ' . $refParam->getName()
+ );
+ }
+ }
+ $params = $newParams;
+ }
+
try {
$result = $this->_dispatch($invocable, $params);
} catch (Exception $e) {