MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / add_operations

Method add_operations

suds/wsdl.py:566–608  ·  view source on GitHub ↗

Add children

(self, root, definitions)

Source from the content-addressed store, hash-verified

564 return None
565
566 def add_operations(self, root, definitions):
567 """ Add <operation/> children """
568 dsop = Element('operation', ns=soapns)
569 for c in root.getChildren('operation'):
570 op = Facade('Operation')
571 op.name = c.get('name')
572 sop = c.getChild('operation', default=dsop)
573 soap = Facade('soap')
574 soap.action = '"%s"' % sop.get('soapAction', default='')
575 soap.style = sop.get('style', default=self.soap.style)
576 soap.input = Facade('Input')
577 soap.input.body = Facade('Body')
578 soap.input.headers = []
579 soap.output = Facade('Output')
580 soap.output.body = Facade('Body')
581 soap.output.headers = []
582 op.soap = soap
583 input = c.getChild('input')
584 if input is None:
585 input = Element('input', ns=wsdlns)
586 body = input.getChild('body')
587 self.body(definitions, soap.input.body, body)
588 for header in input.getChildren('header'):
589 self.header(definitions, soap.input, header)
590 output = c.getChild('output')
591 if output is None:
592 output = Element('output', ns=wsdlns)
593 body = output.getChild('body')
594 self.body(definitions, soap.output.body, body)
595 for header in output.getChildren('header'):
596 self.header(definitions, soap.output, header)
597 faults = []
598 for fault in c.getChildren('fault'):
599 sf = fault.getChild('fault')
600 if sf is None:
601 continue
602 fn = fault.get('name')
603 f = Facade('Fault')
604 f.name = sf.get('name', default=fn)
605 f.use = sf.get('use', default='literal')
606 faults.append(f)
607 soap.faults = faults
608 self.operations[op.name] = op
609
610 def body(self, definitions, body, root):
611 """ add the input/output body properties """

Callers 1

__init__Method · 0.95

Calls 8

getChildrenMethod · 0.95
getChildMethod · 0.95
bodyMethod · 0.95
headerMethod · 0.95
ElementClass · 0.90
FacadeClass · 0.90
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected