def _validate_param(self, expected, param):
        """
        Validates a single param against its expected type.
        Raises RpcException if the param is invalid
        
        :Parameters:
          expected
            Type instance
          param
            Parameter value to validate
        """
        ok, msg = self.contract.validate(expected, expected.is_array, param)
        if not ok:
            vals = (self.full_name, expected.name, msg)
            msg = "Function '%s' invalid param '%s'. %s" % vals
            raise RpcException(ERR_INVALID_PARAMS, msg)
Validates a single param against its expected type.
        Raises RpcException if the param is invalid
        
        :Parameters:
          expected
            Type instance
          param
            Parameter value to validate