What about this approach (these are just my thoughts)? So, create a rout which gets request and builds $form_state
and calls drupal_form_submit function, actual form looks something like this:
function myForm($form, &$form_state)
{
....
$form['submit'] = array(
'#type' => 'submit',
'#submit' => array(),
'#validate' => array('myFormValidation')
);
....
}
function myFormValidation($form, &$form_state)
{
$error = false;
if (SOME_CONDITION) {
$error = true;
}
...
if (!$error) {
drupal_json_output(array('ok'));
exit;
}
else {
drupal_json_output(array('error'));
exit;
}
}
EDIT:
I don't have an expirience with Drupal's Services module or its RESTFul services, but I usually develope my REST projects (usually backend system for IOS apps) in symfony, I think I understand how all this stuff work:), So when I wrote about a rout I meant that this will be some menu item (with hook_menu):
$items['check-my-external-post-data'] = array(
'page callback' => 'some_callback',
...
);
...
function some_callback()
{
...
// $values - from $_POST request
$form_state = array();
foreach ($values as $key => $value) {
$form_state['values'][$key] = $value;
}
...
drupal_form_submit('myForm', $form_state);
}
I've never tested this kind of things, but it should work (there are too many tutorials about REST APIs, request handling, and so on.. which can help OP if something goes wrong)