Webservice args types automatic validation It's a Drupal 7 with Webservices module, and there is a service with something like this (example):

'create-product' =&gt; array(
  'operations' =&gt; array(
    'create' =&gt; array(
      'help' =&gt; t('Add Product'),
      'file' =&gt; array(
        'type' =&gt; 'endpoints.inc',
        'module' =&gt; 'custommodule',
        'name' =&gt; 'custommodule',
      ),
        'callback' =&gt; 'custommodule_create_product',
        'args' =&gt; array(
            array(
                'name' =&gt; 'appID',
                'type' =&gt; 'int',
                'description' =&gt; t("App ID"),
                'source' =&gt; array('data' =&gt; 'appID'),
                'optional' =&gt; FALSE
            ),
            ...


Okay, so the type here is "int". Is it possible to make Drupal return some error automatically, if it's not an int that is being sent as appID.
Like if it's a string being sent, then it will throw an error.
I can't make it work.
Why else is there a "type" key-value?
Although it appears Services doesn't validate the incoming data based on the type, you can use an access callback to build your own validation.

Add something like this to your Service Resource definition:

// ...
'access callback' =&gt; '_example_resource_access',
'access callback file' =&gt; array(
  'type' =&gt; 'inc',
  'module' =&gt; 'example',
  'name' =&gt; 'example.resource-access',
),
'access arguments' =&gt; array('foo bar'),
'access arguments append' =&gt; TRUE,
// ...


Then create a file called example.resource-access.inc with a function like this:

function _example_resource_access($op, $args = array()) {    
  if ($op == 'foo bar' &amp;&amp; !is_numeric($args[0])) {
    return services_error(t('That is not an integer.'), 406);
  }    
  return TRUE;    
}


Note, $args[0] will likely come in as a string representing an integer, so using is_numeric() should be accurate, unless you specifically use (int) to cast $args[0] beforehand, then you can run it through is_int() for validation instead.