~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/web/examples/xmlrpcclient.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.web.xmlrpc import Proxy
 
2
from twisted.internet import reactor
 
3
 
 
4
def printValue(value):
 
5
    print repr(value)
 
6
    reactor.stop()
 
7
 
 
8
def printError(error):
 
9
    print 'error', error
 
10
    reactor.stop()
 
11
 
 
12
proxy = Proxy('http://advogato.org/XMLRPC')
 
13
proxy.callRemote('test.sumprod', 3, 5).addCallbacks(printValue, printError)
 
14
reactor.run()
 
15
proxy.callRemote('test.capitalize', 'moshe zadka').addCallbacks(printValue,
 
16
                                                                printError)
 
17
reactor.run()
 
18
proxy = Proxy('http://time.xmlrpc.com/RPC2')
 
19
proxy.callRemote('currentTime.getCurrentTime').addCallbacks(printValue, printError)
 
20
reactor.run()
 
21
proxy = Proxy('http://betty.userland.com/RPC2')
 
22
proxy.callRemote('examples.getStateName', 41).addCallbacks(printValue, printError)
 
23
reactor.run()