Index: fedd/fedd.py
===================================================================
--- fedd/fedd.py	(revision 4f4b977f03ddfe11afbdf314b4758889330c5dcd)
+++ fedd/fedd.py	(revision 329f61d5ad85f73d5c14fb854483fabef73b7f0b)
@@ -10,4 +10,5 @@
 from M2Crypto import SSL
 from M2Crypto.SSL.SSLServer import SSLServer
+import xmlrpclib
 
 from optparse import OptionParser
@@ -27,11 +28,6 @@
 	self.impl = impl
 
-class fedd_handler(BaseHTTPRequestHandler):
+class fedd_soap_handler(BaseHTTPRequestHandler):
     server_version = "ZSI/2.0 fedd/0.1 " + BaseHTTPRequestHandler.server_version
-
-    namespace = 'http://www.isi.edu/faber/fedd.wsdl'
-    methods = {
-	    'RequestAccess': 'soap_RequestAccess',
-	    }
 
 
@@ -59,11 +55,11 @@
 	"""Confirm that this class implements the namespace and SOAP method"""
 	root = ps.body_root
-	if root.namespaceURI != fedd_handler.namespace:
+	if root.namespaceURI != self.server.impl.soap_namespace:
 	    self.send_fault(Fault(Fault.Client, 
 		'Unknown namespace "%s"' % root.namespaceURI))
 	    return False
-	if not fedd_handler.methods.has_key(root.localName):
-	    self.send_fault(Fault(Fault.Client, 'Unknown operation "%s"' % \
-		    root.localName))
+
+	if getattr(root, 'localName', None) == None:
+	    self.send_fault(Fault(Fault.Client, 'No method"'))
 	    return False
 	return True
@@ -84,8 +80,6 @@
 	if not self.check_method(ps): return
 	try:
-	    # We know this will work because check_method passed above
-	    method = getattr(self.server.impl,
-		    fedd_handler.methods[ps.body_root.localName])
-	    resp = method(ps, fedid(cert=self.request.get_peer_cert()))
+	    resp = self.server.impl.soap_dispatch(ps.body_root.localName, ps,
+		    fedid(cert=self.request.get_peer_cert()))
 	except Fault, f:
 	    self.send_fault(f)
@@ -97,4 +91,40 @@
 	    self.send_xml(str(sw))
 
+class fedd_xmlrpc_handler(BaseHTTPRequestHandler):
+    server_version = "ZSI/2.0 fedd/0.1 " + BaseHTTPRequestHandler.server_version
+
+    def send_xml(self, text, code=200):
+	"""Send an XML document as reply"""
+	self.send_response(code)
+	self.send_header('Content-type', 'text/xml; charset="utf-8"')
+	self.send_header('Content-Length', str(len(text)))
+	self.end_headers()
+	self.wfile.write(text)
+	self.wfile.flush()
+
+    def do_POST(self):
+	"""Treat an HTTP POST request as an XMLRPC service call"""
+
+	resp = None
+	data = None
+	cl = int(self.headers['content-length'])
+	data = self.rfile.read(cl)
+	params, method = xmlrpclib.loads(data)
+
+	try:
+	    resp = self.server.impl.xmlrpc_dispatch(method, params,
+			fedid(cert=self.request.get_peer_cert()))
+	    data = xmlrpclib.dumps((resp,), methodresponse=True)
+	except Fault, f:
+	    xf = xmlrpclib.Fault(f.code, f.string)
+	    data = xmlrpclib.dumps(xf, methodresponse=True)
+	    resp = None
+	except xmlrpclib.Fault, f:
+	    data = xmlrpclib.dumps(f, methodresponse=True)
+	    resp = None
+
+	self.send_xml(data)
+
+
 class fedd_opts(OptionParser):
     """Encapsulate option processing in this class, rather than in main"""
@@ -103,5 +133,6 @@
 		version="0.1")
 
-	self.set_defaults(host="localhost", port=23235, debug=0)
+	self.set_defaults(host="localhost", port=23235, 
+		transport="soap",debug=0)
 
 	self.add_option("-d", "--debug", action="count", dest="debug", 
@@ -113,4 +144,7 @@
 	self.add_option("-p", "--port", action="store", type="int",
 		dest="port", help="Port to listen on (default %default)")
+	self.add_option("-x","--transport", action="store", type="choice",
+		choices=("xmlrpc", "soap"),
+		help="Transport for request (xmlrpc|soap) (Default: %default)")
 	self.add_option("--trace", action="store_const", dest="tracefile", 
 		const=sys.stderr, help="Print SOAP exchange to stderr")
@@ -140,4 +174,10 @@
 	    raise
 
-s = fedd_server(SOAP_port, fedd_handler, ctx, impl)
+if opts.transport == "soap":
+    s = fedd_server(SOAP_port, fedd_soap_handler, ctx, impl)
+elif opts.transport == "xmlrpc":
+    s = fedd_server(SOAP_port, fedd_xmlrpc_handler, ctx, impl)
+else:
+    s = None
+
 s.serve_forever()
Index: fedd/fedd_client.py
===================================================================
--- fedd/fedd_client.py	(revision 4f4b977f03ddfe11afbdf314b4758889330c5dcd)
+++ fedd/fedd_client.py	(revision 329f61d5ad85f73d5c14fb854483fabef73b7f0b)
@@ -8,5 +8,8 @@
 
 from M2Crypto import SSL, X509
+from M2Crypto.m2xmlrpclib import SSL_Transport
 import M2Crypto.httpslib
+
+from xmlrpclib import ServerProxy, Error, dumps, loads
 from ZSI import SoapWriter
 
@@ -69,5 +72,6 @@
 
 	self.set_defaults(url="https://localhost:23235", anonymous=False,
-		serialize_only=False, use_fedid=False, debug=0)
+		serialize_only=False, transport="soap", use_fedid=False,
+		debug=0)
 
 	self.add_option("-a","--anonymous", action="store_true",
@@ -108,4 +112,7 @@
 	self.add_option("-U", "--username", action="store", dest="user",
 		type="string", help="Use this username instead of the uid")
+	self.add_option("-x","--transport", action="store", type="choice",
+		choices=("xmlrpc", "soap"),
+		help="Transport for request (xmlrpc|soap) (Default: %default)")
 	self.add_option("--trace", action="store_const", dest="tracefile", 
 		const=sys.stderr, help="Print SOAP exchange to stderr")
@@ -230,12 +237,4 @@
 	else: raise
 
-loc = feddServiceLocator();
-port = loc.getfeddPortType(opts.url,
-	transport=M2Crypto.httpslib.HTTPSConnection, 
-	transdict={ 'ssl_context' : context },
-	tracefile=opts.tracefile)
-
-req = RequestAccessRequestMessage()
-
 msg = {
 	'allocID': pack_id('test alloc'),
@@ -268,30 +267,63 @@
 	msg['user'] = [];
 
-req.set_element_RequestAccessRequestBody(
-	pack_soap(req, "RequestAccessRequestBody", msg))
-
 if opts.debug > 1: print >>sys.stderr, msg
 
-if opts.serialize_only:
-    sw = SoapWriter()
-    sw.serialize(req)
-    print str(sw)
-    sys.exit(0)
-
-try:
-    resp = port.RequestAccess(req)
-except ZSI.FaultException, e:
-    sys.exit("Fault: %s" % e)
-
-
-if (resp != None):
-    resp_body = resp.get_element_RequestAccessResponseBody()
-    if ( resp_body != None): 
+if opts.transport == "soap":
+    loc = feddServiceLocator();
+    port = loc.getfeddPortType(opts.url,
+	    transport=M2Crypto.httpslib.HTTPSConnection, 
+	    transdict={ 'ssl_context' : context },
+	    tracefile=opts.tracefile)
+
+    req = RequestAccessRequestMessage()
+
+    req.set_element_RequestAccessRequestBody(
+	    pack_soap(req, "RequestAccessRequestBody", msg))
+
+    if opts.serialize_only:
+	sw = SoapWriter()
+	sw.serialize(req)
+	print str(sw)
+	sys.exit(0)
+
+    try:
+	resp = port.RequestAccess(req)
+    except ZSI.FaultException, e:
+	sys.exit("Fault: %s" % e)
+
+
+    if (resp != None):
+	resp_body = resp.get_element_RequestAccessResponseBody()
+	if ( resp_body != None): 
+	    try:
+		resp_dict = unpack_soap(resp_body)
+		if opts.debug > 1: print >>sys.stderr, resp_dict
+		print_response_as_testbed(resp_dict, opts.label)
+	    except RuntimeError, e:
+		sys.exit("Bad response. %s" % e.messgae)
+	else: sys.exit("No body in resonpse!?")
+    else: sys.exit("No response?!?")
+elif opts.transport == "xmlrpc":
+    if opts.serialize_only:
+	ser = dumps((msg,))
+	sys.exit(0)
+
+    transport = SSL_Transport(context)
+    port = ServerProxy(opts.url, transport=transport)
+
+    try:
+	resp = port.RequestAccess({ 'RequestAccessRequestBody': msg})
+	resp, method = loads(resp)
+    except Error, e:
+	sys.exit("Fault: %s" % e)
+
+
+    if (resp != None):
 	try:
-	    resp_dict = unpack_soap(resp_body)
+	    print resp
+	    resp_dict = resp[0]['RequestAccessResponseBody']
 	    if opts.debug > 1: print >>sys.stderr, resp_dict
 	    print_response_as_testbed(resp_dict, opts.label)
 	except RuntimeError, e:
 	    sys.exit("Bad response. %s" % e.messgae)
-    else: sys.exit("No body in resonpse!?")
-else: sys.exit("No response?!?")
+    else: sys.exit("No response?!?")
Index: fedd/fedd_proj.py
===================================================================
--- fedd/fedd_proj.py	(revision 4f4b977f03ddfe11afbdf314b4758889330c5dcd)
+++ fedd/fedd_proj.py	(revision 329f61d5ad85f73d5c14fb854483fabef73b7f0b)
@@ -8,4 +8,5 @@
 from M2Crypto.SSL.SSLServer import SSLServer
 import M2Crypto.httpslib
+import xmlrpclib
 
 import re
@@ -30,4 +31,9 @@
     id_attrs = ("testbed", "cert_file", "trusted_certs", "proxy",
 	    "proxy_trusted_certs", "cert_pwd")
+
+    # Used by the SOAP caller
+    soap_namespace = 'http://www.isi.edu/faber/fedd.wsdl'
+    soap_methods = { 'RequestAccess': 'soap_RequestAccess' }
+    xmlrpc_methods = { 'RequestAccess': 'xmlrpc_RequestAccess' }
 
     class access_project:
@@ -407,20 +413,4 @@
 	return msg
 
-
-    def soap_RequestAccess(self, ps, fid):
-	req = ps.Parse(RequestAccessRequestMessage.typecode)
-
-
-	#if req == None: raise Fault(Fault.Client, "No request??")
-	#req = req.get_element_RequestAccessRequestBody()
-	# if req == None: raise Fault(Fault.Client, "No request body??")
-
-	msg = self.RequestAccess(unpack_soap(req), fedid)
-	resp = RequestAccessResponseMessage()
-
-	resp.set_element_RequestAccessResponseBody(
-		pack_soap(resp, "RequestAccessResponseBody", msg))
-	return resp
-
     def RequestAccess(self, req, fid):
 
@@ -466,4 +456,19 @@
 	    # Proxy the request
 	    return self.proxy_request(dt, req)
+
+    def soap_RequestAccess(self, ps, fid):
+	req = ps.Parse(RequestAccessRequestMessage.typecode)
+
+	msg = self.RequestAccess(unpack_soap(req), fedid)
+	resp = RequestAccessResponseMessage()
+
+	resp.set_element_RequestAccessResponseBody(
+		pack_soap(resp, "RequestAccessResponseBody", msg))
+	return resp
+
+    def xmlrpc_RequestAccess(self, params, fid):
+	msg = self.RequestAccess(params[0], fedid)
+	if msg != None:
+	    return xmlrpclib.dumps(({ "RequestAccessResponseBody": msg },))
 
     def read_trust(self, trust):
@@ -634,4 +639,16 @@
 	f.close()
 
+    def soap_dispatch(self, method, req, fid):
+	if fedd_proj.soap_methods.has_key(method):
+	    return getattr(self, fedd_proj.soap_methods[method])(req, fid)
+	else:
+	    raise Fault(Fault.Client, "Unknown method: %s" % method)
+
+    def xmlrpc_dispatch(self, method, req, fid):
+	if fedd_proj.xmlrpc_methods.has_key(method):
+	    return getattr(self, fedd_proj.xmlrpc_methods[method])(req, fid)
+	else:
+	    raise xmlrpclib.Fault(100, "Unknown method: %s" % method)
+
 def new_feddservice(configfile):
     return fedd_proj(configfile)
