def _Dispatch(ps, server, SendResponse, SendFault, post, action, nsdict={}, **kw):
localURL = '<STR_LIT>' % (server.server_name,<EOL>server.server_port, post)<EOL>address = action<EOL>service = server.getNode(post)<EOL>isWSResource = False<EOL>if isinstance(service, WSAResource):<EOL><INDENT>isWSResource = True<EOL>service.setServiceURL(localURL)<EOL>address = Address()<EOL>try:<EOL><INDENT>address.parse(ps)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>if action and action != address.getAction():<EOL><INDENT>e = WSActionException('<STR_LIT>'<EOL>% (action, address.getAction()))<EOL>return SendFault(FaultFromException(e, <NUM_LIT:0>, None), **kw)<EOL><DEDENT>action = address.getAction()<EOL><DEDENT>if isinstance(service, ServiceInterface) is False:<EOL><INDENT>e = NoSuchService(<EOL>'<STR_LIT>' % (post, server))<EOL>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>if not service.authorize(None, post, action):<EOL><INDENT>return SendFault(Fault(Fault.Server, "<STR_LIT>"), code=<NUM_LIT>)<EOL><DEDENT>try:<EOL><INDENT>method = service.getOperation(ps, address)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>try:<EOL><INDENT>if isWSResource is True:<EOL><INDENT>request, result = method(ps, address)<EOL><DEDENT>else:<EOL><INDENT>request, result = method(ps)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>service.verify(ps)<EOL>if result is None:<EOL><INDENT>return SendResponse('<STR_LIT>', **kw)<EOL><DEDENT>sw = SoapWriter(nsdict=nsdict)<EOL>try:<EOL><INDENT>sw.serialize(result)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>if isWSResource is True:<EOL><INDENT>action = service.getResponseAction(ps, action)<EOL>addressRsp = Address(action=action)<EOL>try:<EOL><INDENT>addressRsp.setResponseFromWSAddress(address, localURL)<EOL>addressRsp.serialize(sw)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT><DEDENT>service.sign(sw)<EOL>try:<EOL><INDENT>soapdata = str(sw)<EOL>return SendResponse(soapdata, **kw)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return SendFault(FaultFromException(e, <NUM_LIT:0>, sys.exc_info()[<NUM_LIT:2>]), **kw)<EOL><DEDENT>
Send ParsedSoap instance to ServiceContainer, which dispatches to
    appropriate service via post, and method via action.  Response is a
    self-describing pyobj, which is passed to a SoapWriter.

    Call SendResponse or SendFault to send the reply back, appropriately.
        server -- ServiceContainer instance