Try this default.py

from gluon.tools import Service
service=Service(globals())
@service.xmlrpc
def add(a,b):
    return a+b
@service.xmlrpc
def sub(a,b):
    return a-b
def call():
    return service()

and this from a python shell

    import xmlrpclib
    server=xmlrpclib.ServerProxy('http://hostname:port/app/call/
xmlrpc')
    print server.add(3,4)
    print server.sub(3,4)

For jsonrpc you can use the pyjamas example posted on applicances but
no it does not need anymore the xmlrpc.py model in there.

Massimo

On Mar 8, 2:04 pm, Fran <[email protected]> wrote:
> On Mar 8, 6:55 pm, Fran <[email protected]> wrote:
>
> > I'm not sure if I can get all the requires statements
> > from the model unless I store them inside a Storage() global variable?
>
> They already are of course ;)
>
> OK, looks like I'll be able to get my creates/updates from Javascript
> working :)
>
> What I'm still interested in frm this thread is how to test that the
> functions I expose via XMLRPC/JSONRPC are working properly?
> - including testing the authentication.
>
> Is there any simple Web services client I can test from?
> - another Web2Py appliance would be best I guess :)
>
> F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to