Beispiel #1
0
class SOAPServiceNode(CompositeNode):
    def __init__(self):
        self.serviceproxy = None
        self._children = {}
        CompositeNode.__init__(self)
    def configure(self, config):
        CompositeNode.configure(self, config)
        self.soapurl = config.get('soapurl')
        self.prefixnamespaces = config.get('prefixnamespaces', False)
        if isinstance(self.prefixnamespaces, str):
            self.prefixnamespaces = eval(self.prefixnamespaces)
        self.soapaction = config.get('soapaction')
        self.namespace = config.get('namespace')
    def start(self):
        self.serviceproxy = SOAPService(self.soapurl, self.namespace)
        self.serviceproxy.setsoapaction(self.soapaction)
        self.serviceproxy.namespace_prefixing(self.prefixnamespaces)
        CompositeNode.start(self)
    def __getattr__(self, name):
        if name in ('_children', 'discover_children_nodes'):
            raise AttributeError(name)
        return CurriedCallable(self.serviceproxy.invoke, name)
Beispiel #2
0
 def start(self):
     self.serviceproxy = SOAPService(self.soapurl, self.namespace)
     self.serviceproxy.setsoapaction(self.soapaction)
     self.serviceproxy.namespace_prefixing(self.prefixnamespaces)
     CompositeNode.start(self)