+ // validate number of parameters received
+ // this should be optional really, as we assume the server does the validation
+ $minPars = count($funcDesc['params']);
+ $maxPars = $minPars;
+ foreach ($funcDesc['params'] as $i => $param) {
+ if ($param['isoptional']) {
+ // this particular parameter is optional. We assume later ones are as well
+ $minPars = $i;
+ break;
+ }
+ }
+ $numPars = $req->getNumParams();
+ if ($numPars < $minPars || $numPars > $maxPars) {
+ return new $responseClass(0, 3, 'Incorrect parameters passed to method');
+ }
+