def __init__(self, root, definitions): """ @param root: An XML root element. @type root: L{Element} @param definitions: A definitions object. @type definitions: L{Definitions} """ NamedObject.__init__(self, root, definitions) self.operations = {} for c in root.getChildren("operation"): op = Facade("Operation") op.name = c.get("name") op.tns = definitions.tns input = c.getChild("input") if input is None: op.input = None else: op.input = input.get("message") output = c.getChild("output") if output is None: op.output = None else: op.output = output.get("message") faults = [] for fault in c.getChildren("fault"): f = Facade("Fault") f.name = fault.get("name") f.message = fault.get("message") faults.append(f) op.faults = faults self.operations[op.name] = op
def __init__(self, root, definitions): """ @param root: An XML root element. @type root: L{Element} @param definitions: A definitions object. @type definitions: L{Definitions} """ NamedObject.__init__(self, root, definitions) self.operations = MultiDict() for c in root.getChildren('operation'): op = Facade('Operation') op.name = c.get('name') op.tns = definitions.tns input = c.getChild('input') if input is None: op.input = None else: op.input = input.get('message') output = c.getChild('output') if output is None: op.output = None else: op.output = output.get('message') faults = [] for fault in c.getChildren('fault'): f = Facade('Fault') f.name = fault.get('name') f.message = fault.get('message') faults.append(f) op.faults = faults self.operations.add(op.name, op)