web2py xmlrpc service


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. @service.xmlrpc
  2. def add(a1,a2):
  3. '''
  4. # Sample Python Client Call
  5. from xmlrpclib import ServerProxy, Error
  6.  
  7. #server = ServerProxy('http://localhost:8000/Test1/default/call/xmlrpc') # local server
  8.  
  9. def GetProxy():
  10. return ServerProxy('http://localhost:8000/Test1/default/call/xmlrpc')
  11.  
  12. s = GetProxy()
  13. print s.add(3,4)
  14. '''
  15. return a1 + a2

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.