problem with JSON-RPC

Michel Perez opsbat at
Wed Nov 12 15:33:41 CET 2008

Hi everybody:
 I'm trying to use JSON-RPC to provide my services but produce this

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "jsonrpc/", line 43, in __call__
    resp = loads(respdata)
  File "jsonrpc/", line 211, in loads
    raise JSONDecodeException('Expected []{}," or Number, Null, False or
jsonrpc.json.JSONDecodeException: Expected []{}," or Number, Null, False
or True

This is what am doing

==== configuration file for apache ====
<code lang="apache.conf">
Alias /services/ //home/mperez/Desktop/test_jsonrpc/

<Location /services/>
    Options Indexes MultiViews FollowSymLinks
    Order deny,allow
	Allow from All
    AddHandler mod_python .py
    PythonHandler jsonrpc

==== service for jsonrpc ====
<code lang="python">
from jsonrpc import ServiceMethod

class MyService(object):
    def echo(self, msg):
        return msg

service = MyService()

==== service client ====
<code lang="python">
#!/usr/bin/env python
from jsonrpc import ServiceProxy
s = ServiceProxy("http://localhost/services/")
print s.echo("foobar")


Michel Perez                                  )\._.,--....,'``.    
Ulrico Software Group                        /,   _.. \   _\  ;`._ ,.
Nihil est tam arduo et difficile human      `._.-(,_..'--(,_..'`-.;.'
mens vincat.                    Séneca.   ============================= 

    Red Telematica de Salud - Cuba
    	  CNICM - Infomed

More information about the Python-list mailing list