def __init__(self, endpoint, header_handler, packer,
               proxy_config, timeout, version, cache=None):
    """Initializes a zeep service proxy.

    Args:
      endpoint: A URL for the service.
      header_handler: A HeaderHandler responsible for setting the SOAP and HTTP
          headers on the service client.
      packer: An optional subclass of googleads.common.SoapPacker that provides
        customized packing logic.
      proxy_config: A ProxyConfig that represents proxy settings.
      timeout: An integer to set the connection timeout.
      version: the version of the current API, e.g. 'v201811'
      cache: An instance of zeep.cache.Base to pass to the underlying SOAP
          library for caching. A file cache by default. To disable, pass
          googleads.common.ZeepServiceProxy.NO_CACHE.

    Raises:
      GoogleAdsValueError: The wrong type was given for caching.
    """
    super(ZeepServiceProxy, self).__init__(header_handler, packer, version)

    if cache and not (isinstance(cache, zeep.cache.Base) or
                      cache == self.NO_CACHE):
      raise googleads.errors.GoogleAdsValueError(
          'Must use a proper zeep cache with zeep.')

    transport = _ZeepProxyTransport(timeout, proxy_config, cache)
    plugins = [_ZeepAuthHeaderPlugin(header_handler),
               googleads.util.ZeepLogger()]
    try:
      self.zeep_client = zeep.Client(
          endpoint, transport=transport, plugins=plugins)
    except requests.exceptions.HTTPError as e:
      raise googleads.errors.GoogleAdsSoapTransportError(str(e))

    first_service = list(self.zeep_client.wsdl.services.itervalues())[0]
    first_port = list(first_service.ports.itervalues())[0]
    self._method_bindings = first_port.binding
def __init__ ( self , endpoint , header_handler , packer , proxy_config , timeout , version , cache = None ) : super ( ZeepServiceProxy , self ) . __init__ ( header_handler , packer , version ) if cache and not ( isinstance ( cache , zeep . cache . Base ) or cache == self . NO_CACHE ) : raise googleads . errors . GoogleAdsValueError ( 'Must use a proper zeep cache with zeep.' ) transport = _ZeepProxyTransport ( timeout , proxy_config , cache ) plugins = [ _ZeepAuthHeaderPlugin ( header_handler ) , googleads . util . ZeepLogger ( ) ] try : self . zeep_client = zeep . Client ( endpoint , transport = transport , plugins = plugins ) except requests . exceptions . HTTPError as e : raise googleads . errors . GoogleAdsSoapTransportError ( str ( e ) ) first_service = list ( self . zeep_client . wsdl . services . itervalues ( ) ) [ 0 ] first_port = list ( first_service . ports . itervalues ( ) ) [ 0 ] self . _method_bindings = first_port . binding
Initializes a zeep service proxy.

    Args:
      endpoint: A URL for the service.
      header_handler: A HeaderHandler responsible for setting the SOAP and HTTP
          headers on the service client.
      packer: An optional subclass of googleads.common.SoapPacker that provides
        customized packing logic.
      proxy_config: A ProxyConfig that represents proxy settings.
      timeout: An integer to set the connection timeout.
      version: the version of the current API, e.g. 'v201811'
      cache: An instance of zeep.cache.Base to pass to the underlying SOAP
          library for caching. A file cache by default. To disable, pass
          googleads.common.ZeepServiceProxy.NO_CACHE.

    Raises:
      GoogleAdsValueError: The wrong type was given for caching.