Define a resource of Service module, But 'access callback' cannot work This following is my resource:

For clearly read, I delete some line.

/**
 * Implementation of hook_services_resources().
 */

function baidu_push_services_services_resources() {
  $resources = array();

  $resources['message']['actions']['send'] = [
    'file' =&gt; array(
      'type' =&gt; 'inc',
      'module' =&gt; 'baidu_push_services',
      'name' =&gt; 'baidu_push_services',
    ),
    'access callback' =&gt; '_message_access',
    'callback' =&gt; 'baidu_push_services_send',
    'args' =&gt; array(
      array(
        'name' =&gt; 'uid',
        'type' =&gt; 'string',
        'source' =&gt; 'data',
        'optional' =&gt; FALSE,
      ),
  ];

  return $resources;
}


In order to test my 'access callback' function will be invoked, I always return FALSE in my 'access callback' function:

function _message_access($op = 'view', $args = array()) {
  return FALSE;
}


But when I try to use curl command line to test with no SESSION and no Token, but It work!(return the right result to me), Did that mean 'access callback' not be invoked?

So I try to use drush cc all to clear cache, But still above problem.
Is your access callback in the same file? If not, you'd have to add: "access callback file" to your definition, and point to it.

I'd also clear cache within Drupal, as I've seen drush cc all not always clear all caches.

Also, I'd name-space your access callback function, as it could be conflicting with something else in the system. _message_access is a pretty generic name. You should rename it to: _baidu_push_services_message_access().

Otherwise, your syntax looks correct.

Or, if you solved your issue, perhaps post it in here, to help others.