[Twisted-web] Weird problem with XMLRPC -> ('405', 'Method Not Allowed')

Remi Cool mailinglists at smartology.nl
Thu Nov 10 01:39:17 MST 2005


Remi Cool wrote:

>I've run into a problem with my twisted xmlrpc test server (using
>twisted version 2.01 or 2.1).
>
>Every time the client calls the echo function a '405 Method Not Allowed
>is returned'.
>
>This code ran in Twisted 1.3 without problems ... what's changed besides the zope interface 
>implements.
>
A print statement in the render method:

def render(self, request):
   self._clientIP = request.getClientIP()
   print 'REQUEST:', request
   return resource.Resource.render(self, request)


gave: "<POST / HTTP/1.0>" ... shouldn't that be "<POST /RPC2 HTTP/1.0>" ?

The client code works fine with a simplefied server:

#!/usr/bin/env python

from twisted.web import xmlrpc, server

class Example(xmlrpc.XMLRPC):
    """An example object to be published."""

    def xmlrpc_echo(self, x):
        """Return all passed args."""
        return x

if __name__ == '__main__':
    from twisted.internet import reactor
    r = Example()
    reactor.listenTCP(7080, server.Site(r))
    reactor.run()







More information about the Twisted-web mailing list