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