def invoke(self, ns, request_name, params, auth_token, simplify=False, methodattrs=None): """ Invokes zimbra soap request. """ ZimbraClientTransport.invoke(self, ns, request_name, params, auth_token, simplify) headers = SOAPpy.Types.headerType() if auth_token.token != None: data = { sconstant.E_AUTH_TOKEN: auth_token.token, sconstant.E_SESSION_ID: auth_token.session_id } context = SOAPpy.Types.structType(data=data, name=sconstant.CONTEXT) context._validURIs = [] context._ns = (zconstant.SOAP_DEFAULT_PREFIX, zconstant.NS_ZIMBRA_URL) headers.context = context proxy = SOAPpy.SOAPProxy(self.soap_url, ns, header=headers, noroot=1, methodattrs=methodattrs, simplify_objects=simplify) proxy.config.debug = self.log.isEnabledFor(logging.DEBUG) proxy.config.strictNamespaces = 0 proxy.config.buildWithNamespacePrefix = 0 proxy.config.returnAllAttrs = True proxy.config.dumpSOAPOut = False proxy.config.dumpSOAPIn = False proxy.transport = self.http_transport _parseSOAP = SOAPpy.Parser._parseSOAP SOAPpy.Parser._parseSOAP = parseSOAP try: m = proxy.__getattr__(request_name) return m.__call__(**params) finally: SOAPpy.Parser._parseSOAP = _parseSOAP
def invoke(self, ns, request_name, params, auth_token, simplify=False): """ Invokes zimbra soap request. """ ZimbraClientTransport.invoke(self, ns, request_name, params, auth_token, simplify) headers = SOAPpy.Types.headerType() if auth_token.token != None: data={sconstant.E_AUTH_TOKEN: auth_token.token, sconstant.E_SESSION_ID: auth_token.session_id} context = SOAPpy.Types.structType(data=data, name=sconstant.CONTEXT) context._validURIs = [] context._ns = (zconstant.SOAP_DEFAULT_PREFIX, zconstant.NS_ZIMBRA_URL) headers.context = context proxy = SOAPpy.SOAPProxy(self.soap_url, ns, header=headers, noroot=1, simplify_objects=simplify) proxy.config.debug = self.log.isEnabledFor(logging.DEBUG) proxy.config.strictNamespaces = 0 proxy.config.buildWithNamespacePrefix = 0 proxy.config.returnAllAttrs = True proxy.config.dumpSOAPOut = False proxy.config.dumpSOAPIn = False proxy.transport = self.http_transport _parseSOAP = SOAPpy.Parser._parseSOAP SOAPpy.Parser._parseSOAP = parseSOAP try: m = proxy.__getattr__(request_name) return m.__call__(**params) finally: SOAPpy.Parser._parseSOAP = _parseSOAP
def __init__(self): ZimbraClientTransport.__init__(self) self.http_transport.transport = self self.log = logging.getLogger(__name__)
def __init__(self): ZimbraClientTransport.__init__(self) load_test_properties(self)