當前位置: 首頁>>代碼示例>>Python>>正文


Python Client.__init__方法代碼示例

本文整理匯總了Python中suds.client.Client.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.__init__方法的具體用法?Python Client.__init__怎麽用?Python Client.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在suds.client.Client的用法示例。


在下文中一共展示了Client.__init__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
    def __init__(self, WSDL_URI=BIOMODELS_WSDL_URI):
	"""Initialize the client with the available queries listed in
	the WSDL file. All the queries can be executed using the following syntax:
	
	client.service.queryToBeExecuted()
	"""
	try:
	    Client.__init__(self, WSDL_URI)
	except Exception, e:
	    print e
開發者ID:BhallaLab,項目名稱:moose-thalamocortical,代碼行數:12,代碼來源:biomodelsclient.py

示例2: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
 def __init__(self, WSDL_URI=BIOMODELS_WSDL_URI):
     """Initialize the client with the available queries listed in
     the WSDL file. All the queries can be executed using the following syntax:
     
     client.service.queryToBeExecuted()
     """
     try:
         Client.__init__(self, WSDL_URI,proxy=proxyOpts)
         #Client.__init__(self, WSDL_URI,transport=HttpTransport())
     except Exception as e:
         print(e)
開發者ID:dilawar,項目名稱:moose-gui,代碼行數:13,代碼來源:biomodelsclient.py

示例3: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
 def __init__(self, table, instance):
     self.__table = table
     self.__instance = instance
     username = Config.getUsername(instance)
     password = Config.getPassword(instance)
     SLogger.debug("Connecting to %s to download from table %s" % (instance, table))
     try:
         Client.__init__(self,
                         instance + table + "_list.do?WSDL",
                         username=username,
                         password=password,
                         timeout=Config.getTimeout())
     except URLError, e:
         SnowClient.__processURLError(e)
開發者ID:Aspediens,項目名稱:codesync,代碼行數:16,代碼來源:soapClient.py

示例4: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
 def __init__(self, wsdl_url, username, password, servicename = None):
     #create parser and download the WSDL document
     self.url = wsdl_url
     self.username = username
     self.password = password
     self.servicename = servicename
     if servicename:
         self.url = self.get_service_url()     
     if is_https(self.url):
         logger.info("Creating secure connection")
         from suds.transport.http import HttpAuthenticated
         http_transport = HttpAuthenticated(username=self.username, password=self.password)
     else:
         from suds.transport.http import HttpAuthenticated
         http_transport = HttpAuthenticated(username=self.username, password=self.password)
     
     #Client.__init__(self, self.url, transport=http_transport, plugins=[SoapFixer()]) # uncomment after testing
     #schema_import = Import(schema_url)
     #schema_doctor = ImportDoctor(schema_import)
 
     Client.__init__(self, self.url, transport=http_transport, plugins=[SoapFixer()]) # added for testing purpose
開發者ID:SadamAnsari,項目名稱:Web-services-Integration,代碼行數:23,代碼來源:soapclient.py

示例5: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
    def __init__(self,options,config_file=None,session="DWE"):
        """Datastream SOAP Client

        >>> ds=Datastream()
        """

        _set_debug(logging.WARN,
                   'suds.resolver',
                   'suds.metrics',
                   'suds.xsd.sxbasic',
                   'suds.xsd.query',
                   'suds.client',
                   'suds.wsdl',
                   'suds.transport.http',
                   'suds.mx.core',
                   'suds.umx.typed',
                   'suds.xsd.schema',
                   'suds.xsd.sxbase',
                   'suds.mx.literal')

        if config_file is None:
            if exists(expanduser('~/.dwe.conf')):
                config_file = expanduser('~/.dwe.conf')
                os.chmod(config_file,stat.S_IRUSR | stat.S_IWUSR)
            else:
                config_file = DEFAULT_DSTREAM_CONF_FILE

        config_file = expanduser(expandvars(config_file))

        self._options = options

        if not exists(config_file):
            LOGGER.info('no configuration for datastream (%s). using BITS path',config_file)
            config_file = join(BITS_ETC,DEFAULT_BITS_CONF_FILE)

        self.config_file = config_file

        if not exists(self.config_file):
            raise IOError, 'Datastream Configuration File not Found %s' % config_file

        
        dstream_info = get_session(config_file,session,
                                   secure=True,
                                   url='http://dataworks.thomson.com/dataworks/enterprise/1.0/webServiceClient.asmx?WSDL',
                                   user=(None,ValueError),
                                   password=(None,ValueError),
                                   realm=''
                                   )
        self._auth=dstream_info

        t = HttpTransport()


        ### Proxy if any
        #
        proxy_info = get_proxy()        
        if proxy_info:
            pip={
                'http':proxy_info['proxy'],
                'https':proxy_info['proxy'],
                }
            proxy = urllib2.ProxyHandler(pip)
            # opener = urllib2.build_opener(SocksiPyHandler(socks.PROXY_TYPE_SOCKS4, 'localhost', 8080))
            opener = urllib2.build_opener(proxy)
            urllib2.install_opener(opener)
            t.urlopener = opener
            LOGGER.debug('proxy info for http: %s',pip['http'])
        #
        #
        ###
        try:
            Client.__init__(self,self._auth['url'],transport=t)
        except urllib2.URLError, exc:
            LOGGER.error('{}: No connection to {}'.format(self._options.job,self._auth['url']))
            raise exc
開發者ID:exedre,項目名稱:e4t.new,代碼行數:77,代碼來源:DatastreamProvider.py

示例6: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
 def __init__(self, url, slug=None, related_objects=None, session=None, transport=None, timeout=None, **kwargs):
     transport = transport or SecurityRequestsTransport(slug=slug, related_objects=related_objects, session=session,
                                                        timeout=timeout)
     DefaultClient.__init__(self, url, transport=transport, **kwargs)
開發者ID:matllubos,項目名稱:django-security,代碼行數:6,代碼來源:security_suds.py

示例7: __init__

# 需要導入模塊: from suds.client import Client [as 別名]
# 或者: from suds.client.Client import __init__ [as 別名]
 def __init__(self,*args,**kwargs):
     self.is_local = False
     self.subdomains = []
     # super(Client,self).__init__(*args,**kwargs)
     Client.__init__(self,*args,**kwargs)
開發者ID:mvavalis,項目名稱:multidomain_multiphysics,代碼行數:7,代碼來源:hmc_remoteclient.py


注:本文中的suds.client.Client.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。