SOAPpy (Simple Object Access Protocol) is a protocol for exchanging messages over computer networks. It was ported to S60 mobile phones and can be download from this link, also posted on Python s60 effort page.
A SOAPpy example of a calculator using the mobile as a client and a server at PC is given below.
#SOAPcalculator.py
import SOAPpy
calculator = SOAPpy.SOAPProxy("http://localhost:8080/")
a = 8
b = 2
print calculator.plus(a,b)
print calculator.minus(a,b)
print calculator.multiply(a,b)
print calculator.divide(a,b)
#Server.py
import SOAPpy
class Calculator:
def plus(self, a, b):
return a+b
def minus(self, a, b):
return a-b
def multiply(self, a, b):
return a*b
def divide(self, a, b):
return a/b
server = SOAPpy.SOAPServer(("localhost", 8080))
print "Serving..."
server.registerObject(Calculator())
server.serve_forever()
No related wiki articles found