'Handle a SOAP command.'

def render(self, request):

    data = request.content.read()
    (p, header, body, attrs) = SOAPpy.parseSOAPRPC(data, 1, 1, 1)
    (methodName, args, kwargs) = (p._name, p._aslist, p._asdict)
    if callable(args):
        args = args()
    if callable(kwargs):
        kwargs = kwargs()
    function = self.lookupFunction(methodName)
    if (not function):
        self._methodNotFound(request, methodName)
        return server.NOT_DONE_YET
    elif hasattr(function, 'useKeywords'):
        keywords = {}
        for (k, v) in kwargs.items():
            keywords[str(k)] = v
        d = defer.maybeDeferred(function, **keywords)
    else:
        d = defer.maybeDeferred(function, *args)
    d.addCallback(self._gotResult, request, methodName)
    d.addErrback(self._gotError, request, methodName)
    return server.NOT_DONE_YET
