Feature Requests item #1745722, was opened at 2007-06-30 13:31
Message generated for change (Comment added) made by gbrandl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1745722&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XML
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Helmut Grohne (gnarfk)
>Assigned to: Fredrik Lundh (effbot)
Summary: please add wsgi to SimpleXMLRPCServer
Initial Comment:
There should be a simple wsgi xmlrpc application and in fact it is not
difficult. You could for instance take this one and append it to
SimpleXMLRPCServer.py.
class WSGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
def __init__(self, allow_none=False, encoding=None):
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
def __call__(self, environ, start_response):
"""WSGI interface"""
if environ["REQUEST_METHOD"] != "POST":
status = "400 Bad request"
headers = [("Content-type", "text/html")]
data = "<html><head><title>400 Bad
request</title></head><body><h1>400 Bad request</h1></body></html>"
headers.append(("Content-length", str(len(data))))
start_response(status, headers)
if environ["REQUEST_METHOD"] == "HEAD":
return []
return [data]
l = int(environ["CONTENT_LENGTH"])
request = environ["wsgi.input"].read(l)
response = self._marshaled_dispatch(request)
headers = [("Content-type", "text/xml")]
headers.append(("Content-length", str(len(response))))
start_response("200 OK", headers)
return [response]
----------------------------------------------------------------------
>Comment By: Georg Brandl (gbrandl)
Date: 2007-06-30 14:59
Message:
Logged In: YES
user_id=849994
Originator: NO
Assigned to Fredrik.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1745722&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com