That is as intended -- functions in controllers that take arguments are private. If you want to pass arguments to controller actions via HTTP requests, you must use URL args or vars. Alternatively, you might look into the various RCP options: http://web2py.com/books/default/chapter/29/10/services#Remote-procedure-calls.
Anthony On Thursday, July 9, 2015 at 5:34:19 AM UTC-4, Rakesh Singh wrote: > > Hello, > > Please could you assist with the following issue. > > I am attempting to create a web service, and have defined a function in > default.py that accepts an argument. > I notice that whenever I define a function which requires an argument, it > disappears from the the "exposes" list of default.py. > > *Example1 that works.* > > def count(): > session.counter = (session.counter or 0) + 1 > return dict(counter=session.counter, now=request.now) > > default.py > <https://sshipappldm1:8000/admin/peek/HiOnline/controllers/default.py?id=controllers__default__py> > exposes index <https://sshipappldm1:8000/>, user > <https://sshipappldm1:8000/user>, download > <https://sshipappldm1:8000/download>, call > <https://sshipappldm1:8000/call>, count <https://sshipappldm1:8000/count> > Calling web service works fine. > > *Example2 that does not work* > > def count(id): > session.counter = (session.counter or 0) + 1 > return dict(counter=session.counter, now=request.now) > > default.py > <https://sshipappldm1:8000/admin/peek/HiOnline/controllers/default.py?id=controllers__default__py> > exposes index <https://sshipappldm1:8000/>, user > <https://sshipappldm1:8000/user>, download > <https://sshipappldm1:8000/download>, call > <https://sshipappldm1:8000/call> > > Calling web service returns : > invalid function (default/count) > > Web2py 2.10.3-stable+timestamp.2015.04.02.21.42.07 running on Solaris 10 > > Any idea what I am missing? > > Thank you. > > Regards, > > Rakesh > > > > -- 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.

