Two things to verifiy :
1/ Try this : s = jsonrpclib.ServerProxy("http://localhost:8000/
pledgedrives/default/call/jsonrpc",verbose=1)
2/ The "call" function is defined ?
def call():
    session.forget()
    return service()


On 8 déc, 19:58, johntynan <jgty...@gmail.com> wrote:
> I am looking in the admin and do not see any tickets for the error.
> So, web2py is not getting the request.
>
> On Dec 8, 11:19 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > check the tickets in admin and see if web2py is getting the request
> > and what is the error
>
> > On Dec 8, 10:10 am, johntynan <jgty...@gmail.com> wrote:
>
> > > One note.  I also receive the same error when using this url:
>
> > > s = jsonrpclib.ServerProxy("http://localhost:8000/pledgedrives/default/
> > > service/",verbose=1)
>
> > > On Dec 8, 9:07 am, johntynan <jgty...@gmail.com> wrote:
>
> > > > I have a question about testing web2py's jsonrpc service using the
> > > > python interactive shell.
>
> > > > In looking at the web2py pyjamas todo application as a starting point,
> > > > and noticed the following code in the tests folder:
>
> > > > import jsonrpclib
>
> > > > s = jsonrpclib.ServerProxy("http://localhost:8000/todo/default/
> > > > service",
> > > >                           verbose=1)
> > > > reply = s.getTasks()
> > > > print reply
>
> > > > I found that I needed to download Matt Harrison's jsonrpclib 
> > > > fromhttp://lkcl.net/jsonrpclib.tgzandplacethejsonrpclib.py file
> > > > somewhere within my python path
>
> > > > After that, I decorated a class in my web2py app with
> > > > @service.jsonrpc:
>
> > > >http://code.google.com/p/pledgedrivetracker/source/browse/pledgedrive...
>
> > > > Then, I tried to connect to the web2py jsonrpc service from within the
> > > > python shell using this script:
>
> > > > >>> s = 
> > > > >>> jsonrpclib.ServerProxy("http://localhost:8000/pledgedrives/default/call/",verbose=1)
> > > > >>> reply = s.service_pledgedrive_pledges('1')
>
> > > > Only I receive the following error:
>
> > > > connect: (localhost, 8000)
> > > > send: 'POST /pledgedrives/default/call/ HTTP/1.0\r\nHost: localhost:
> > > > 8000\r\nUser-Agent: jsonlib.py/0.0.1 (by matt harrison)\r\nContent-
> > > > Type: text/xml\r\nContent-Length: 67\r\n\r\n'
> > > > send: '{"params": ["1"], "method": "service_pledgedrive_pledges",
> > > > "id": 6}'
> > > > reply: 'HTTP/1.1 400 BAD REQUEST\r\n'
> > > > header: Set-Cookie:
> > > > session_id_pledgedrives=127-0-0-1-1bb105e6-9359-4a9e-
> > > > a776-6915963c26ed; Path=/
> > > > header: Content-Length: 534
> > > > header: Content-Type: text/html; charset=UTF-8
> > > > header: Date: Tue, 08 Dec 2009 14:54:13 GMT
> > > > header: Server: CherryPy/3.2.0beta WSGI Server
> > > > Traceback (most recent call last):
> > > >   File "<stdin>", line 1, in <module>
> > > >   File "jsonrpclib.py", line 136, in __call__
> > > >     return self.__send(self.__name, args)
> > > >   File "jsonrpclib.py", line 382, in __request
> > > >     verbose=self.__verbose
> > > >   File "jsonrpclib.py", line 179, in request
> > > >     response
> > > > jsonrpclib.ProtocolError: <ProtocolError for localhost:8000/
> > > > pledgedrives/default/call/: 400 BAD REQUEST>
>
> > > > Is it possible to tell if I am using the wrong syntax when calling
> > > > jsonrpclib.ServerProxy or else where in my script?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to