XML-RPC with a http server
Eugene Leitl
eugene.leitl@l...
Mon, 23 Apr 2001 15:34:19 +0200 (MET DST)
Um, I just realized something embarrassing. Please correct me
if I'm spouting nonsense.
I want to run a janusian server based on medusa (pardon the mythology
melange): talking to the users HTML via a http port, and via XML-RPC to
other services, running on the same machine, or different ones.
Now the wunderbar Medusa usually uses something like this, when starting
a server (this ripped from xmlrpc_handler.py):
class rpc_demo (xmlrpc_handler):
def call (self, method, params):
print 'method="%s" params=%s' % (method, params)
return "Sure, that works"
import asyncore
import http_server
hs = http_server.http_server ('', 8000)
rpc = rpc_demo()
hs.install_handler (rpc)
asyncore.loop()
There can be only one handler in the asyncore.loop(), correct? I can't
run medusa serving web pages (applets, cgi-bin python) at one end, and
have an xml-rpc running within the same binary, on an alternative port?
Or can I have medusa serving html on, say, port 80, and the xml-rpc
handler be automatically invoked, when a POST /RPC2 HTTP/1.0 request comes
in on same standard port?
I'm a bit fuzzy on the concepts, somebody please clue me in.