I'm trying to call a custom webservice from an external php file but it's not working. In order to create the custom webservice I followed this post (How to Create custom operation for Webservice VtigerCRM?), so I first ran a query to add the new webservice in vtiger_ws_operation table:
INSERT INTO `vtiger_ws_operation` ( `name`, `handler_path`, `handler_method`, `type`, `prelogin`) VALUES ('my_webservice_method', 'include/Webservices/WbsWebserviceMethod.php', 'vtws_my_webservice_method’, 'GET', 0);
then I added a new row in vtiger_ws_operation_parameters with the only parameter I need for this webservice:
INSERT INTO `vtiger_ws_operation_parameters` (`operationid`, `name`, `type`, `sequence`) VALUES (35, 'key', 'String', 1);
finally, I added my php file 'include/Webservices/WbsWebserviceMethod.php':
<?php
function vtws_my_webservice_method($key) {
global $log,$adb;
return "ok";
}
?>
But when I try and call this webservice from my external file, it returns false:
$results = $client->doInvoke(
'vtws_my_webservice_method',
array('key' => $date),
'GET'
);
var_dump($results);
What am I doing wrong?