[Twisted-web] SOAP issue

Thomas Mangin thomas.mangin at exa-networks.co.uk
Thu Apr 15 10:09:46 MDT 2004


Hello,

I would appreciate if someone could tell me what I did wrong.

Tested with twisted 1.2.0 - installed from tar.gz on a Mandrake 9.2 with
the latest version of SOAPpy using the python 2.3 Mandrake RPMS.

Thank you

Thomas
----
#!/usr/bin/python
 
from twisted.web.soap import Proxy
from twisted.internet import reactor
 
def printValue(value):
        print repr(value)
        reactor.stop()
 
def printError(error):
        print 'error', error
        reactor.stop()
 
proxy = Proxy('http://192.0.2.1:7080/SOAP')
proxy.callRemote('quote').addCallbacks(printValue, printError)
reactor.run()

$ cat server.py
#!/usr/bin/python
 
from twisted.web import soap
from twisted.web import server
from twisted.internet import reactor
 
class Example(soap.SOAPPublisher):
        def soap_quote(self):
                return "Boring string ....."
 
r = Example()
reactor.listenTCP(7080, server.Site(r))
reactor.run()

$ ./client.py
error [Failure instance: Traceback: twisted.web.error.Error, 500
Internal Server Error
]

$ ./server.py
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/twisted/protocols/basic.py",
line 229, in dataReceived
    return self.rawDataReceived(data)
  File "/usr/lib/python2.3/site-packages/twisted/protocols/http.py",
line 1002, in rawDataReceived
    self.allContentReceived()
  File "/usr/lib/python2.3/site-packages/twisted/protocols/http.py",
line 993, in allContentReceived
    req.requestReceived(command, path, version)
  File "/usr/lib/python2.3/site-packages/twisted/protocols/http.py",
line 554, in requestReceived
    self.process()
--- <exception caught here> ---
  File "/usr/lib/python2.3/site-packages/twisted/web/server.py", line
159, in process
    self.render(resrc)
  File "/usr/lib/python2.3/site-packages/twisted/web/server.py", line
166, in render
    body = resrc.render(self)
  File "/usr/lib/python2.3/site-packages/twisted/web/soap.py", line 87,
in render
    d = defer.maybeDeferred(function, *args)
exceptions.TypeError: maybeDeferred() argument after * must be a
sequence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://pyramid.twistedmatrix.com/pipermail/twisted-web/attachments/20040415/ecc7290f/attachment.bin


More information about the Twisted-web mailing list