def wsgi_xmlrpc(environ, start_response):
 if ((environ['REQUEST_METHOD'] == 'POST') and environ['PATH_INFO'].startswith('/xmlrpc/')):
  length = int(environ['CONTENT_LENGTH'])
  data = environ['wsgi.input'].read(length)
  string_faultcode = True
  if environ['PATH_INFO'].startswith('/xmlrpc/2/'):
   service = environ['PATH_INFO'][len('/xmlrpc/2/'):]
   string_faultcode = False
  else:
   service = environ['PATH_INFO'][len('/xmlrpc/'):]
  (params, method) = xmlrpclib.loads(data)
  return xmlrpc_return(start_response, service, method, params, string_faultcode)

def wsgi_xmlrpc ( environ , start_response ) : if ( ( environ [ 'REQUEST_METHOD' ] == 'POST' ) and environ [ 'PATH_INFO' ] . startswith ( '/xmlrpc/' ) ) : length = int ( environ [ 'CONTENT_LENGTH' ] ) data = environ [ 'wsgi.input' ] . read ( length ) string_faultcode = True if environ [ 'PATH_INFO' ] . startswith ( '/xmlrpc/2/' ) : service = environ [ 'PATH_INFO' ] [ len ( '/xmlrpc/2/' ) : ] string_faultcode = False else : service = environ [ 'PATH_INFO' ] [ len ( '/xmlrpc/' ) : ] ( params , method ) = xmlrpclib . loads ( data ) return xmlrpc_return ( start_response , service , method , params , string_faultcode )
two routes are available for xml-rpc /xmlrpc/<service> route returns faultcode as strings .