def AsJonPy(request=None, modules=None, **kw):
kw['<STR_LIT>'] = request<EOL>if request.environ.get('<STR_LIT>') != '<STR_LIT:POST>':<EOL><INDENT>_JonPySendFault(Fault(Fault.Client, '<STR_LIT>'), **kw)<EOL>return<EOL><DEDENT>ct = request.environ['<STR_LIT>']<EOL>try:<EOL><INDENT>if ct.startswith('<STR_LIT>'):<EOL><INDENT>cid = resolvers.MIMEResolver(ct, request.stdin)<EOL>xml = cid.GetSOAPPart()<EOL>ps = ParsedSoap(xml, resolver=cid.Resolve)<EOL><DEDENT>else:<EOL><INDENT>length = int(request.environ['<STR_LIT>'])<EOL>ps = ParsedSoap(request.stdin.read(length))<EOL><DEDENT><DEDENT>except ParseException as e:<EOL><INDENT>_JonPySendFault(FaultFromZSIException(e), **kw)<EOL>return<EOL><DEDENT>_Dispatch(ps, modules, _JonPySendXML, _JonPySendFault, **kw)<EOL>
Dispatch within a jonpy CGI/FastCGI script.