diff options
Diffstat (limited to 'frameworks')
| -rwxr-xr-x | frameworks/middleware/examples/soap/client.py | 11 | ||||
| -rwxr-xr-x | frameworks/middleware/examples/soap/server.py | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/frameworks/middleware/examples/soap/client.py b/frameworks/middleware/examples/soap/client.py new file mode 100755 index 0000000..9cd35f2 --- /dev/null +++ b/frameworks/middleware/examples/soap/client.py @@ -0,0 +1,11 @@ +#!/usr/bin/python + +from datetime import datetime +from ZSI.client import Binding + +b = Binding(url='http://localhost:8000/') +t = b.today (5) +# t = 2014-02-18 15:59:50.571927 +conv = datetime.strptime (t, "%Y-%m-%d %H:%M:%S.%f") +print "Today: %s" % conv.strftime ("%d.%m.%Y, %H:%M") +print b.load ("string") diff --git a/frameworks/middleware/examples/soap/server.py b/frameworks/middleware/examples/soap/server.py new file mode 100755 index 0000000..32a550a --- /dev/null +++ b/frameworks/middleware/examples/soap/server.py @@ -0,0 +1,18 @@ +#!/usr/bin/python + +from datetime import datetime +from ZSI import dispatch + +def today (arg): + print "today arg:", arg + today = datetime.today () + return str (today) + +def load (arg): + print "load arg:", arg + fd = open ("/proc/loadavg", "r") + loadavg = fd.read () + sysload = loadavg.split () + return sysload[0] + +dispatch.AsServer (port=8000, rpc=True) |
