Create a method wrapping an invocation to the SOAP service.

    Args:
      method_name: A string identifying the name of the SOAP method to call.

    Returns:
      A callable that can be used to make the desired SOAP request.
432682
def _CreateMethod(self, method_name):
    
    soap_service_method = self.zeep_client.service[method_name]

    def MakeSoapRequest(*args):
      AddToUtilityRegistry('zeep')
      soap_headers = self._GetZeepFormattedSOAPHeaders()
      packed_args = self._PackArguments(method_name, args)
      try:
        return soap_service_method(
            *packed_args, _soapheaders=soap_headers)['body']['rval']
      except zeep.exceptions.Fault as e:
        error_list = ()
        if e.detail is not None:
          underlying_exception = e.detail.find(
              '{%s}ApiExceptionFault' % self._GetBindingNamespace())
          fault_type = self.zeep_client.get_element(
              '{%s}ApiExceptionFault' % self._GetBindingNamespace())
          fault = fault_type.parse(
              underlying_exception, self.zeep_client.wsdl.types)
          error_list = fault.errors or error_list
        raise googleads.errors.GoogleAdsServerFault(
            e.detail, errors=error_list, message=e.message)
    return MakeSoapRequest
910917
def _apply(self, method_name, *args, **kwargs):
        

        return [
            getattr(member, method_name)(*args, **kwargs)
            for member in self.forms
        ]
635630
def create_method(self):
        
        temp_method = self.temp('method', skipping=True, n_indents=1)
        return temp_method.format(class_name=self.class_name,
                                  method_name=self.method_name,
                                  n_features=self.n_inputs,
                                  n_classes=self.n_outputs)
1254097
def build_request(method, options)
      builder  = underscore("build_#{method}")
      self.respond_to?(builder) ? self.send(builder, options) :
                                  soap_envelope(options).target!
    end
784800
def _soap_client_call(method_name, *args):
    """"""
    # a new client instance is built for threading issues
    soap_client = _build_soap_client()
    soap_args = _convert_soap_method_args(*args)
    # if pysimplesoap version requires it, apply a workaround for
    # https://github.com/pysimplesoap/pysimplesoap/issues/31
    if PYSIMPLESOAP_1_16_2:
        return getattr(soap_client, method_name)(*soap_args)
    else:
        return getattr(soap_client, method_name)(soap_client, *soap_args)
613715
def _get_method(self, request):
        
        methodname = request.method.lower()
        method = getattr(self, methodname, None)
        if not method or not callable(method):
            raise errors.MethodNotAllowed()
        return method
1275023
def _wrap(method: Callable, wrapper: Callable) -> Callable:
        
        def wrapped(*args, **kwargs):
            return wrapper(method, *args, **kwargs)
        return wrapped
1230708
def bind(self, container, method_name):
        
        instance = super(Entrypoint, self).bind(container)
        instance.method_name = method_name
        return instance
304533
public SoapClient setMethod(Name name, Map<String, Object> params, boolean useMethodPrefix) {
		return setMethod(new QName(name.getURI(), name.getLocalName(), name.getPrefix()), params, useMethodPrefix);
	}
1176151
def queue_name_for_method(method_name)
      return queue_names[method_name] if queue_names[method_name]

      queue_name = generate_queue_name(method_name)
      queue_for(method_name, queue_name)
      return queue_name
    end
688717
def soap(func=None, name=None, returns=None, args=None, doc=None, target='SOAP'):
    
    global __soap_functions__
    
    returns = _fix_soap_kwargs(returns)
    args = _fix_soap_kwargs(args)
    
    if isinstance(func, str) and not name:
        return partial(soap, name=func, returns=returns, args=args, doc=doc, target=target)
    
    if not func:
        return partial(soap, name=name, returns=returns, args=args, doc=doc, target=target)

    target_functions = __soap_functions__.setdefault(target, {})
    if inspect.isfunction(func):
        f_name = func.__name__
        if name:
            f_name = name
        target_functions[f_name] = endpoint = ('.'.join([func.__module__, func.__name__]), returns, args, doc)
        func.soap_endpoint = (f_name, endpoint)
    elif inspect.isclass(func):
        if not name:
            name = func.__name__
        for _name in dir(func):
            f = getattr(func, _name)
            if (inspect.ismethod(f) or inspect.isfunction(f)) and not _name.startswith('_'):
                f_name = name + '.' + f.__name__
                endpoint = ('.'.join([func.__module__, func.__name__, _name]), returns, args, doc)
                if hasattr(f, 'soap_endpoint'):
                    #the method has already been decorate by soap 
                    _n, _e = f.soap_endpoint
                    target_functions[name + '.' + _n] = endpoint
                    del target_functions[_n]
                else:
                    target_functions[f_name] = endpoint
    else:
        raise Exception("Can't support this type [%r]" % func)
    return func
941016
def view_call(method_name, *args, **kwargs):
    

    def view_call(_value, context, **_params):
        method = getattr(context["view"], method_name)
        return _call(method, args, kwargs)

    return view_call
1163437
def _create_api_method(cls, name, api_method):
    
    def _api_method(self, **kwargs):
        # lookup the command
        command = api_method['name']
        if kwargs:
            return self._make_request(command, kwargs)
        else:
            kwargs = {}
            return self._make_request(command, kwargs)
    _api_method.__doc__ = api_method['description']
    _api_method.__doc__ += _add_params_docstring(api_method['params'])
    _api_method.__name__ = str(name)
    setattr(cls, _api_method.__name__, _api_method)
230092
def method_by_name(self, method_name):
        

        #        print("METHODS FOR MODULE: %s " % self.path)
        for m in self.methods:
            if m.full_name == method_name or m.name == method_name:
                return m

        return None
139839
def createMethodBody(msgInName, msgOutName, **kw):
        '''
        '''
        body = []
        if msgInName is not None:
            body.append('request = ps.Parse(%s.typecode)' %msgInName)
            
        if msgOutName is not None:
            body.append('return request,%s()' %msgOutName)
        else: 
            body.append('return request,None')
            
        return tuple(body)
1277885
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                    dyn_kwargs=None, lineno=None):
        
        if args is None:
            args = []
        if kwargs is None:
            kwargs = []
        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
                          dyn_args, dyn_kwargs, lineno=lineno)
101885
def _WsdlHasMethod(self, method_name):
    
    return method_name in self.suds_client.wsdl.services[0].ports[0].methods