There is any authentication on that? If yes, you should try something like this:
server = ServerProxy('http://'+ ws_user + ':' + ws_pass + ' @127.0.0.1:8000/app22/default/call/jsonrpc <http://127.0.0.1:8000/app22/default/call/jsonrpc>') And If you created by yourself the WS through web2py, make sure that you put the decorator on your service function "load". Besides, try (this time is a guess, ok?) return your "result" variable instead of locals(). On Tuesday, July 8, 2014 7:41:44 AM UTC-3, lyn2py wrote: > > I'm wanting to get JSON RPC to work within web2py controller functions, > without using pyjamas (which is the example provided in the book) > > This is my code for the JSON RPC call: > def test_call(): > from gluon.contrib.simplejsonrpc import ServerProxy > service = ServerProxy(' > http://127.0.0.1:8000/app22/default/call/jsonrpc') > result = service.load(1000) > return locals() > > (1) Running it within web2py controller functions = It returns an error: > ValueError: No JSON object could be decoded > > (2) Running it in the browser = > http://127.0.0.1:8000/app22/default/call/jsonrpc/load/1000 it runs into > the same error as (1). > > (3) Running it in command prompt = it works like a charm. > > How do I get it to work within web2py controller functions? Thanks! > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.