0
|
1 from creatorEngineComplex import *
|
|
2 from wsdl2path import *
|
|
3
|
|
4
|
|
5 if __name__=="__main__":
|
|
6 # filename='testforrindex.py'
|
|
7 # print filename[0:filename.rindex('.py')]
|
|
8
|
|
9 test1=wsdlLoader()
|
|
10 print 'stub file path generated by wsdl2py: \n', test1.wsdlUrl2path('http://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL', 'Temp')
|
|
11
|
|
12 ## print 'stub file path generated by wsdl2py: \n', test1.wsdlUrl2path('http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDbfetch.wsdl', 'dbfetch')
|
|
13 # print 'stub file path generated by wsdl2py: \n', test1.wsdlFile2path('../wsdl/WSDbfetch.wsdl', 'dbfetch')
|
|
14
|
|
15 test=ClientCreator()
|
|
16
|
|
17 ## print 'all operations: \n', test.path2Ops('dbfetch.WSDBFetchServerLegacyService_client').keys()
|
|
18 ## print 'inputs of fetchData:\n', test.opname2inputs('fetchData', 'dbfetch.WSDBFetchServerLegacyService_client')
|
|
19 ## inputDict={'_format':'fasta', '_query':'UNIPROT:ADH1A_HUMAN', '_style':'raw'}
|
|
20 ## print 'invoke the fetchData operation of web service and return: \n',test.invokeOp('fetchData', 'dbfetch.WSDBFetchServerLegacyService_client', inputDict)
|
|
21 print 'all operations: \n', test.path2Ops('Temp.TemperatureConversions_client').keys()
|
|
22 print 'inputs of fetchData:\n', test.opname2inputs('WindChillInCelcius', 'Temp.TemperatureConversions_client')
|
|
23 inputDict={'_nWindSpeed': 90, '_nCelcius': 40}
|
|
24 print 'invoke the fetchData operation of web service and return: \n',
|
|
25 result=test.invokeOp('WindChillInCelcius', 'Temp.TemperatureConversions_client', inputDict)
|
|
26 for r in result:
|
|
27 print r,':',result[r]
|
|
28 ##
|
|
29 # print 'all operations of wublast: \n', test.path2Ops('blast.WSWUBlast_client').keys()
|
|
30 # print 'inputs of runWUBlast operation \n', test.opname2inputs('runWUBlast', 'blast.WSWUBlast_client')
|
|
31 # print 'outputs of runWUBlast operation \n', test.opname2outputs('runWUBlast', 'blast.WSWUBlast_client')
|
|
32 #
|
|
33 # seq = """>Q8E5Q5_STRA3
|
|
34 # MKLSKRYRFWQKVIKALGVLALIATLVLVVYLYKLGILNDSNELKDLVHKYEFWGPMIFI
|
|
35 # VAQIVQIVFPVIPGGVTTVAGFLIFGPTLGFIYNYIGIIIGSVILFWLVKFYGRKFVLLF
|
|
36 # MDQKTFDKYESKLETSGYEKFFIFCMASPISPADIMVMITGLSNMSIKRFVTIIMITKPI
|
|
37 # SIIGYSYLWIYGGDILKNFLN"""
|
|
38 # inputDict={'_params':{ '_program' : 'blastp', '_database' :'swissprot', '_email' :'riververy@yahoo.com', '_async': 1}, '_content':[{'_type':'sequence', '_content':seq}]}
|
|
39 # print 'invoke runWUBlast operation and return: \n', test.invokeOp('runWUBlast', 'blast.WSWUBlast_client', inputDict)
|
|
40 |