Thanks for your response Matheus!
no authentication… is there somewhere I can read up on this? I tried
searching around google for answers, and ran into using "id", but no idea
how that works, it appears that the id is automatically included. It's
working on command line, the exact same commands, but not inside the
controller function.
Had me wondering if I am using JSON-RPC correctly?
I guess what I need is an example of JSON-RPC working within a controller's
function…
On Wednesday, July 9, 2014 9:58:23 PM UTC+8, Matheus Cardoso wrote:
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.