Hi Dirk, Yup, that's what I meant by 'instrumented' the JSONRPCManager. The wiki log has my comments:
JSONRPCManager.registerGlobalObject() id='blah' class: 'net.neocortext.wiki.plugin.json.JsonTest$JSONRPCTarget' hashcode: 974083980 JsonTest() registered 'blah' with JSONRPCBridge. So it *seems* to be registering... I was thinking that perhaps it was a different instance of the JSONRPCManager so I even checked its hashcode. Ichiro On Thu, Feb 13, 2014 at 9:58 PM, Dirk Frederickx <dirk.frederi...@gmail.com>wrote: > Ichiro, > > The json error indicates that the command "blah.response" is not found. > Maybe the JSON registerGlobalObject was not called? > Can you put a log just before/after the registerGlobalObject() to check > whether it gets invoked ? > > dirk > > > On Thu, Feb 13, 2014 at 9:41 AM, Ichiro Furusato > <ichiro.furus...@gmail.com>wrote: > > > Hi Dirk, > > > > My JSONRPCTarget is your MyJSONBlahSample. I'm quite literally doing > > exactly > > what you suggested. Here's my registration: > > > > JSONRPCManager.registerGlobalObject("blah",new JSONRPCTarget()); > > > > and my implementing class (i.e., an inner class, just the way it's done > in > > SearchManager with its JSONSearch inner class): > > > > public class JSONRPCTarget implements RPCCallable > > { > > public String getResponse( String echo, int count ) > > { > > return "response: echo='"+echo+"'; count='"+count+"'"; > > } > > } > > > > My JavaScript call is: > > > > Wiki.jsonrpc( 'blah.response', [qv,5], function(result,exception) { > > tout.innerHTML = "x:"+result; > > }); > > > > The response (when printing the result) is: "[object Object]" and the > JSON > > Response > > (from FireBug) is: > > > > {"id":10000,"error":{"code":591,"msg":"method not found (session may > > have timed out)"}}" > > > > This has always been the response I've seen. As I said, I'm flummoxed as > to > > why > > I've been unsuccessful in getting this to work. I *can* swap out a call > to > > findPages > > and get a response from the search engine. Just not on anything *I* > > register, and > > I've instrumented the JSPWiki code in the JSONRPCManager to be sure the > > global registration is getting through. It is. > > > > Ichiro > > >