1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
5 This is an example of a simple SOAP server.
10 An example session (assuming the server is running):
13 >>> p = SOAPpy.SOAPProxy('http://localhost:8080/')
18 >>> p.echo("Hello World")
23 from twisted.web import soap, server
24 from twisted.internet import reactor, defer
27 class Example(soap.SOAPPublisher):
29 It publishs two methods, 'add' and 'echo'.
32 def soap_echo(self, x):
35 def soap_add(self, a=0, b=0):
37 soap_add.useKeywords = 1
39 def soap_deferred(self):
40 return defer.succeed(2)
43 reactor.listenTCP(8080, server.Site(Example()))