I'm having difficulty with the osapi & osapi.services sections of the container.js config. I was hoping for some feedback about where I might be in error... below:
I'm trying to avoid the dynamic listMethods registration in gadgetsrpctransport.js, so I explicitly define the supported methods: "gadgets.rpc" : ["gadgets.metadata","appdata.get","cache.invalidate","people.supportedFields","people.get","appdata.update","http.get","appdata.delete","appdata.create"] This should result in those methods being supported by the osapi calls and will use gadgets.rpc (which still goes to the "http://%host%/rpc" JsonRpcServlet as a JSON body POST). Unlisted methods will fail/unsupported. I ask because I can't get it to work this way, and trying to debug some things has made me further confused.... -In gadgetsrpctransport.js init, I see that the 'services' object has my gadget.rpc definition, but also a 'http://%hosts%/rpc' entry, which seems to have *all* methods (even though it's not listed in my container.js file). -Watching osapi._registerMethod run, I see that the "http://%host%/rpc" big list go through and register against that URL as the transport (w/resolved host name). Just after that, my explicit list goes through (called from gadgetsrpctransport.js) and throws errors for each method - "duplicate definition" - because it's already been defined for the servlet transport. Is the intention that you can hit the servlet directly and any method would work... but only the registered ones will work via osapi abstraction? Thanks for any advice, Gregg
