Changeset 058f58e for fedd/fedd.py


Ignore:
Timestamp:
Nov 20, 2008 7:14:58 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
cfabc40
Parents:
c922f23
Message:

Unify the code for calling SOAP and XMLRPC services into a couple classes.
Before there were slightly different semantics everywhere.

Also make the handlers classes rather than the output of stub compiling
functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd.py

    rc922f23 r058f58e  
    212212    def do_POST(self):
    213213        """Treat an HTTP POST request as an XMLRPC service call"""
     214        # NB: XMLRPC faults are not HTTP errors, so the code is always 200,
     215        # unless an HTTP error occurs, which we don't handle.
    214216
    215217        resp = None
    216218        data = None
    217219        method = None
    218         code = 200
    219220        cl = int(self.headers['content-length'])
    220221        data = self.rfile.read(cl)
     
    225226            data = xmlrpclib.dumps(xmlrpclib.Fault("Client",
    226227                "Malformed request"), methodresponse=True)
    227             code = 500
    228228
    229229        if method != None:
     
    236236                data = xmlrpclib.dumps(f, methodresponse=True)
    237237                resp = None
    238                 code = 500
    239 
    240         self.send_xml(data, code)
     238
     239        self.send_xml(data)
    241240
    242241    def log_request(self, code=0, size=0):
Note: See TracChangeset for help on using the changeset viewer.