def get_pnode(): import socket user=os.environ['OS_USERNAME'] password=os.environ['OS_PASSWORD'] type="NICE" endpoint = "https://network.cern.ch/sc/soap/soap.fcgi?v=5" ns = "http://network.cern.ch/NetworkService" SOAPserver=SOAPpy.SOAPProxy(endpoint, namespace=ns) #Get the auth token atoken=SOAPserver.getAuthToken(user,password,type) #Build the auth header authStruct=SOAPpy.structType(data = {"token" :atoken}) #authStruct._ns1=("ns1","urn:NetworkService") authHeader=SOAPpy.headerType(data = {"Auth":authStruct}) hostname = os.environ['HOSTNAME'] SOAPserver.header=authHeader return SOAPserver.vmGetInfo(hostname).VMParent
outputs = 'UniGene ID, PDB ID' biodbnet = WSDL.Proxy( 'http://biodbnet.abcc.ncifcrf.gov/webServices/bioDBnet.wsdl') #inputResult = biodbnet.getInputs() #print "inputResult : " + inputResult #outputResult = biodbnet.getOutputsForInput(input_type) #print "outputResult : " + outputResult #directOutputResult = biodbnet.getDirectOutputsForInput(input_type) #print "directOutputResult : " + directOutputResult db2dbParams = SOAPpy.structType({ 'input': input_type, 'inputValues': input_value, 'outputs': outputs }) db2dbResult = biodbnet.db2db(db2dbParams) result = db2dbResult.split("\n") result[0] = result[0].split("\t") result[1] = result[1].split("\t") for a, b, c in result[0:2]: print a.ljust(25) + b.ljust(25) + c.ljust(25) else: print """This is a script for converting Ensembl IDs to Uniprot and/or PDB Please specify what type of input Ensembl ID is provided (gene, protein or transcript). Usage: python db2db_converter.py [gene|protein|transcript] [Ensembl ID]
def soap_struct(self): return SOAPpy.structType({"a": "c"})
headers.debug_association_type = "NotAssociated" #headers.debug_association_type = "Active" #else: #headers.debug_association_type = "Active" # Set service connection service = SOAPpy.SOAPProxy( server + "/api/adsense/v3/AccountService", namespace="http://www.google.com/api/adsense/v3", header=headers) # To view xml request/response set service.config.debug = 1 service.config.debug = 0 # Set the parameters login_email = SOAPpy.Types.untypedType(name="loginEmail", data=loginEmail) entity_type = SOAPpy.structType(name="entityType") entity_type._addItem("value","Individual") website_url = SOAPpy.Types.untypedType(name="websiteUrl", data=profile_url) website_locale = SOAPpy.Types.untypedType(name="websiteLocale", data="en") users_preferred_locale = SOAPpy.Types.untypedType(name="usersPreferredLocale", data="en_US") email_promotion_preferences = SOAPpy.Types.untypedType(name="emailPromotionsPreference", data="true") syn_service_types0 = SOAPpy.structType(name="synServiceTypes") syn_service_types0._addItem(name="value",value="ContentAds") syn_service_types1 = SOAPpy.structType(name="synServiceTypes") syn_service_types1._addItem(name="value",value="SearchAds") developer_url = SOAPpy.Types.untypedType(name="developerUrl", data=developerUrl) # Create an adsense account, might throw a soap exception # on user input or error upon trying to connect
print "Incorrect parameter " + input_type sys.exit(0) outputs = 'UniGene ID, PDB ID' biodbnet = WSDL.Proxy('http://biodbnet.abcc.ncifcrf.gov/webServices/bioDBnet.wsdl') #inputResult = biodbnet.getInputs() #print "inputResult : " + inputResult #outputResult = biodbnet.getOutputsForInput(input_type) #print "outputResult : " + outputResult #directOutputResult = biodbnet.getDirectOutputsForInput(input_type) #print "directOutputResult : " + directOutputResult db2dbParams = SOAPpy.structType({'input': input_type, 'inputValues': input_value, 'outputs': outputs}) db2dbResult = biodbnet.db2db(db2dbParams) result = db2dbResult.split("\n") result[0] = result[0].split("\t") result[1] = result[1].split("\t") for a,b,c in result[0:2]: print a.ljust(25) + b.ljust(25) + c.ljust(25) else: print """This is a script for converting Ensembl IDs to Uniprot and/or PDB Please specify what type of input Ensembl ID is provided (gene, protein or transcript). Usage: python db2db_converter.py [gene|protein|transcript] [Ensembl ID] For example: python db2db_converter.py transcript ENST00000248342
# Sample code to add a generate ad code snippet through Adsense API # ##################################################################### import sys import SOAPpy dev_email = sys.argv[1] dev_password = sys.argv[2] server = sys.argv[3] client_id = sys.argv[4] # Set headers headers = SOAPpy.Types.headerType() headers.developer_email = dev_email headers.developer_password = dev_password headers.client_id = client_id # Set service connection service = SOAPpy.SOAPProxy( server + "/api/adsense/v3/AccountService", namespace="http://www.google.com/api/adsense/v3", header=headers) service.config.debug = 0 syn_service_types0 = SOAPpy.structType(name="synServiceTypes") syn_service_types0._addItem(name="value",value="ContentAds") response = service.addSyndicationService(syn_service_types0) print response
import sys sys.path.insert(1, "..") import SOAPpy import time dep = SOAPpy.dateTimeType((2004, 3, 24, 12, 30, 59, 4, 86, 0)) ret = SOAPpy.dateTimeType((2004, 3, 26, 12, 30, 59, 4, 86, 0)) in0 = SOAPpy.structType() in0._addItem('outwardDate', dep) in0._addItem('returnDate', ret) in0._addItem('originAirport', 'den') in0._addItem('destinationAirport', 'iad') x = SOAPpy.buildSOAP( in0, method="getAirFareQuote", namespace="urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk" ) wsdl = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl' proxy = SOAPpy.WSDL.Proxy(wsdl)
import sys sys.path.insert(1, "..") import SOAPpy import time dep = SOAPpy.dateTimeType((2004, 3, 24, 12, 30, 59, 4, 86, 0)) ret = SOAPpy.dateTimeType((2004, 3, 26, 12, 30, 59, 4, 86, 0)) in0 = SOAPpy.structType() in0._addItem('outwardDate', dep) in0._addItem('returnDate', ret) in0._addItem('originAirport', 'den') in0._addItem('destinationAirport', 'iad') x = SOAPpy.buildSOAP( in0, method="getAirFareQuote", namespace="urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk") wsdl = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl' proxy = SOAPpy.WSDL.Proxy(wsdl)