Exemplo n.º 1
0
 def func(**kwargs):
     try:
         args = self.create_args(method, kwargs)
         res = self.call_function(name, *args)
         if isinstance(res, RequestContext):
             return res
         elif res.__class__ is not tuple:
             return Factory.rebuild(res)
         code, soap = res
         return Factory.rebuild(soap)
     except WebFault, e:
         obj = Factory.rebuild(e.fault)
         raise SoapException(obj)
Exemplo n.º 2
0
 def getEnvelope(self, obj, method='CreateAdspace', client=None):
     if not client:
         client = self.client
     soapObject = Factory.build(client.client.factory, obj)
     method = getattr(client.client.service, method)
     c = SoapClient(method.client, method.method)
     return str(c.method.binding.input.get_message(c.method, ('name', 'pwd', 'opId', soapObject, ), {}))
Exemplo n.º 3
0
 def create_args(self, method, kwargs):
     args = []
     for param_name, t in method:
         if isinstance(kwargs[param_name], SoapObject):
             args.append(Factory.build(self.client.factory, kwargs[param_name]))
         else:
             args.append(kwargs[param_name])
     return args
Exemplo n.º 4
0
 def create(self, soap_object_name, **kwargs):
     soapObject = Factory.rebuild(self.client.factory.create(soap_object_name))
     for k, v in kwargs.iteritems():
         setattr(soapObject, k, v)
     return soapObject