Update: The JSON-RPC works in command line, but not in my app1's controller
function (all my testing is done localhost).
I'm seeking assistance from anyone using JSON-RPC, with POST or GET to make
it work… thank you!!!
On Tuesday, July 8, 2014 4:17:55 PM UTC+8, lyn2py wrote:
>
> When I used @service.jsonrpc instead,
>
> It gave this error…
>
> File "/Users/.../web2py/.../gluon/contrib/simplejsonrpc.py", line 108, in
> <lambda>
> return lambda *args: self.call(attr, *args)
> File "/Users/.../web2py/.../gluon/contrib/simplejsonrpc.py", line 140, in
> call
> self.error.get('data', None))
> File "/Users/.../web2py/.../gluon/contrib/simplejsonrpc.py", line 37, in
> __init__
> value = "%s: %s\n%s" % (code, message, '\n'.join(data))
> TypeError
>
>
> The examples seemed simple enough and the code is very minimal, what seems
> to be wrong?
>
> On Tuesday, July 8, 2014 12:51:42 PM UTC+8, lyn2py wrote:
>>
>> Hello,
>>
>> I'm trying out the XML RPC to have 2 apps talk to each other, and this is
>> what I have in my code (copy-pasted from this groups and web2py book):
>>
>> App 1:
>> def test():
>> import xmlrpclib
>> xmlpxy = xmlrpclib.ServerProxy('
>> http://127.0.0.1:8000/app2/default/call/xmlrpc')
>> result = xmlpxy.do_action(3,7)
>> return locals()
>>
>>
>> App2:
>> def call():
>> return service()
>>
>>
>> @service.xmlrpc
>> def do_action(a,b):
>> return a+b
>>
>>
>> And I ran into this error… I'm puzzled what I am missing out to make this
>> work??
>>
>> File
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py",
>> line 793, in close
>> raise Fault(**self._stack[0])
>> Fault: <Fault 1: '<type \'exceptions.Exception\'>:method "xml" is not
>> supported'>
>>
>>
--
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.