[Twisted-Python] More on XMLRPC

Magnus Heino magnus.heino at pleon.sigma.se
Tue Nov 20 04:36:17 EST 2001


Hi.

I just want to make sure that my conclusions are right:

If I create an application using widgets, resource.Resource.getChild is used
to traverse the URL to find the callable object. This traverse will always
take place if resource.Resource.isLeaf is set to 0.

The server.Request.process will then assume that we want to return html, and
call render() on the object. After processing all childs, the page will be
returned to the browser.


The xmlrpc-implementation in xmlrpc.XMLRPC sets isLeaf to 1, which means
that that the url wont be traversed, the only thing you can do is to use the
_getFunction and traverse to the function manually, and return it. The
useage of _getFunction is provided by overriding render. This means that you
can't use anything in guard.ResourceGuard to protect your resources.

Override isLeaf in the xmlrpc-class, and the url traversal wil take place,
but server.Request isn't aware of anything but html, which means that it
returns html to xmlrpc, which is not what we want. Not good at all... or am
I wrong?

Seems as if widgets and guards are only usable if you always, always only
want to return html?

/Magnus






More information about the Twisted-Python mailing list