1 # SOAP-specific code for SFA Client
3 from httplib import HTTPSConnection
4 from ZSI.client import Binding
6 def xmlrpc_like_callable (soap_callable, *x):
7 soap_result = soap_callable(*x)
8 xmlrpc_result = soap_result['Result']
12 def __init__(self, soap_callable):
13 self.soap_callable = soap_callable
15 def __call__(self, *args):
16 outer_result = self.soap_callable(*args)
17 return outer_result['Result']
20 class SFASoapBinding(Binding):
21 def __getattr__(self, attr):
22 soap_callable = Binding.__getattr__(self, attr)
23 return SFACallable(soap_callable)
26 def get_server(url, key_file, cert_file):
28 'transport' : HTTPSConnection,
29 'transdict' : {'cert_file' : cert_file,
34 return SFASoapBinding(url=url, **auth)