question soap and classes

Scott Hathaway scott_hathaway at riskvision.com
Thu Dec 20 12:03:26 EST 2001


I want to create a soap server that will expose many classes and then acces
them as follows:

client:

import SOAP
if SOAP.Config.SSLserver:
 from M2Crypto import SSL
SOAP.Config.debug = 1
SOAP.Config.BuildWithNoType = 1
SOAP.Config.BuildWithNoNamespacePrefix = 1
s = SOAP.SOAPProxy("http://localhost:8800")
u1 = s.classA.Login('joe','smith')
u2 = s.classB.Logout('joe','smith')

server:

import SOAP
if SOAP.Config.SSLserver:
    from M2Crypto import SSL
server = SOAP.SOAPServer(('localhost',9900))

import classA
import classB
a = classA.classA()
server.registerObject(a)
b = classB.classB()
server.registerObject(b)

try:
    server.serve_forever()
except KeyboardInterrupt:
    pass

This does not allow me to access separate classes.  Can anyone tell me the
best way to do what I want?

Thanks,
Scott Hathaway





More information about the Python-list mailing list