Ignore:
Timestamp:
14/12/07 14:59:41 (12 years ago)
Author:
lawrence
Message:

eggable version including elementtree 1.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/ndgSearch.py

    r3127 r3147  
    2323      fromString = staticmethod(expatbuilder.parseString) 
    2424      fromStream = staticmethod(expatbuilder.parse) 
    25   
     25# 
     26# Locator (this mimics the code which lives in the wsdl2py generated DiscoveryService_services, 
     27# but explicitly allowsa different port address) ... 
     28# 
     29 
     30default_HostAndPort="http://glue.badc.rl.ac.uk:8080/axis2/services/DiscoveryService" 
    2631 
    2732class ndgSearch: 
    2833    ''' Provides a client to the NDG discovery services methods exposed by the Discovery.wsdl ''' 
    2934     
    30     def __init__(self,logger=None,tracefile=None): 
    31         '''get an instance of the service''' 
    32         #how do we get a different backend provider? 
     35    def __init__(self,logger=None,tracefile=None,HostAndPort=default_HostAndPort): 
     36        '''Get an instance of the NDG Discovery Service.  
     37            Optional Keywords are:  
     38                logger -  a python logging instance, for collecting stats 
     39                tracefile - for collecting debug output 
     40                HostAndPort - the location of the SOAP web service (default is ndg Glue) 
     41        ''' 
     42        #Get a different backend provider via the url argument 
    3343        loc=DiscoveryServiceLocator() 
    34         #self.server=loc.getDiscovery(readerclass=ExpatReaderClass, 
    35         self.server=loc.getDiscoveryServicePortType(readerclass=ExpatReaderClass,tracefile=tracefile) 
     44        self.server=loc.getDiscoveryServicePortType(url=default_HostAndPort, 
     45                                    readerclass=ExpatReaderClass,tracefile=tracefile) 
    3646        self.serverSessionID=None 
    3747        self.logger=logger 
     48        if self.logger:  
     49            logger.info('Discovery web service connection to %s'%default_HostAndPort) 
    3850        self.__reset() 
    3951         
Note: See TracChangeset for help on using the changeset viewer.