jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Frederickx <dirk.frederi...@gmail.com>
Subject Re: JSON-RPC support
Date Thu, 13 Feb 2014 08:58:29 GMT
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.furusato@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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message