Expose a function of my service to JSonRPC
#1
Hello everyone, just joined forum and I am a newbie so hope this makes sense:

I'm building a service add-on in python for kodi and I would like to expose an "api" to JSONRPC in order to have other add ons to call my api functions.

I tried to search online but I can only find how to access to other jsonrpc "api's" as a client (http://kodi.wiki/view/JSON-RPC_API/Examples) but I can't find out how to expose my functions for others to access.

Thanks for your help.
Reply
#2
I figured out the solution:

1) I just need to add this line at my service addon.xml file and then it's ready to role:

<extension point="xbmc.python.pluginsource" library="service.py" />


2) to make the call you can use in the skin or eventually using executebuiltin command in your python file:
plugin://script.service.myservice?action=getPlaylist

3) and then receive and threat this call in the service.py where the get arguments are received as arguments (argv) in the service.py:
xbmc.log("[Started Service in API_MODE] > SYS %s : %d : %d" % (sys.argv, len(sys.argv), os.getpid()), level=xbmc.LOGNOTICE)
Reply

Logout Mark Read Team Forum Stats Members Help
Expose a function of my service to JSonRPC0