Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Registering a custom function to be invoked by webservice
I know I've asked this before, but I'm still a bit fuzzy on this:

What are the basic steps to register a new webservice function (for instance in a module's postinstall), so that it can be invoked from the outside (by the doInvoke command) through webservice?

So far I've found this in the repo. Is that a good lead?
Hm. It seems if I create a new webservice operation I can pass its name here and the params with it, and if I'm not mistaken I need to name the function the same as the handler_method in the vtiger_webservice_operations table. But I'm not sure how my $params from the doInvoke method will end up in my custom function and what the prescribed way is to register this new operation.
The $params is an array with all the parameters defined in the webservice method:

that is the call to this method:

one parameter which is the one value in the array in the call. You ALWAYS have to define the $user when you define the method, not when you register it, only when you code it. The user calling the method is always passed in as the last parameter.

There is no obligation to define the method function and the exported webervice name the same, in fact they are usually different:

The easiest way to register the method is using the registerWSAPI() method
Thanks! Gets me on my way, and hopefully some help for someone looking for the same..

Forum Jump:

Users browsing this thread: 1 Guest(s)