Hi Grace, Thanks, that helps for me to see how things get setup initially. So it looks like the net result is that nothing gets bound to gadgets.rpc if I list them explicitly.... they all issue the duplicate error and don't re-register (so all the bound methods have "http://os.dealer.com/rpc" as the transport... none have "gadgets.rpc"). Is this intentional (or am I just missing the difference between what the transport implies.... "gadgets.rpc" vs. "http://os.dealer.com/rpc").
Gregg On Nov 15, 2010, at 9:35 PM, 孙巧云 wrote: > Hi, Gregg > > All those rpc services will be injected by default. Actually the code is on > server side, gadget.config.init will be called and init those services, > which are injected by OsapiServicesConfigContributor, > OsapiServicesConfigContributor will finally call > http://localhost:8080/vulcan/shindig/rpc?method=system.listMethods to get > those methods and then that's the logic of you said. > > Grace > > From: > Gregg Horan <[email protected]> > To: > "[email protected]" <[email protected]> > Date: > 11/16/2010 07:58 AM > Subject: > gadgets.rpc bindings > > > From:Gregg Horan <[email protected]> > To:"[email protected]" <[email protected]> > Date: > 11/16/2010 07:58 AM > Subject:gadgets.rpc bindings > > 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
