1 # SOAP-specific code for SFA Client
4 from ZSI.client import Binding
5 from httplib import HTTPSConnection
7 def xmlrpc_like_callable (soap_callable, *x):
8 soap_result = soap_callable(*x)
9 xmlrpc_result = soap_result['Result']
13 def __init__(self, soap_callable):
14 self.soap_callable = soap_callable
16 def __call__(self, *args):
17 outer_result = self.soap_callable(*args)
18 return outer_result['Result']
21 class SFASoapBinding(Binding):
22 def __getattr__(self, attr):
23 soap_callable = Binding.__getattr__(self, attr)
24 return SFACallable(soap_callable)
27 def get_server(url, key_file, cert_file):
29 'transport' : HTTPSConnection,
30 'transdict' : {'cert_file' : cert_file,
35 return SFASoapBinding(url=url, **auth)