1

I have an application in web2py. To create the command line interface of the gui (web-interface), I want to use xmlrpc service. For example if I have following function :

@auth.requires_login
def example():
    temp = request.args[0]
    //do something on temp
    return dict(temp=temp)

How can I call this function in xmlrpc, so that I make minimal changes in my original function definition (I require to do authentication, somehow send the request variable, and have some returned data structure).

1 Answer 1

1

You need to use service to expose function with xmlrpc

auth.settings.allow_basic_login = True

@service.xmlrpc
def example(temp):
    return ...


@auth.requires_login()
def call(): return service()

You can read more in the book.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.