comparison WebServiceToolWorkflow/WebServiceTool_input_method.py~ @ 0:d5cd409b8a18 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author ganjoo
date Tue, 07 Jun 2011 18:00:50 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d5cd409b8a18
1 import warnings
2 import platform
3 import os,sys
4 from generateClient import *
5 from generateClient1 import *
6
7 '''input : wadl/wsdl/sawadl-url, method name
8 purpose:
9 1. Calls methods from generateClient1.py to generate client description for one-time invocation
10 of the Web service. This client description is added as a xml file under ./clients/
11 2. Calls methods from generateClient.py to generate client description for invocation of Web service
12 in a workflow. This client description is added as a xml file under ./workflowclients/
13 3. Adds the path to the above xml files to Galaxy tool-conf.xml file using call edit_tool_conf.py
14 '''
15
16 #read the url passed as an argument
17 url = sys.argv[2]
18 urllist = url.split('.')
19
20 clientGenerator = ClientGenerator(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5])
21 clientGenerator1 = ClientGenerator1(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5])
22
23 if urllist[len(urllist)-1]=='wadl' or urllist[len(urllist)-1]=='WADL':
24 javahome = os.environ.get('JAVA_HOME')
25 galaxyhome=os.environ.get('GALAXY_HOME')
26 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/bin'
27 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/lib/'
28 machine = platform.machine()
29
30 #start JVM depending on the machine. The location of libjvm.so is assumed to be standard.
31 #you can replace lines 32 to 41, with startJVM("LOCATION OF YOUR LIBJVM.SO","-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
32 if machine == 'x86_64' :
33 print 'a'
34 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
35 elif machine == 'i686' :
36 print 'b'
37 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
38 elif machine == 'sun4u' :
39 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
40 else :
41 System.exit("Could not identify machine, please specify path to libjvm.so")
42
43 clientGenerator1.wadlClient()
44 clientGenerator.wadlClient()
45
46 elif urllist[len(urllist)-1]=='wsdl' or urllist[len(urllist)-1]=='WSDL':
47 clientGenerator.wsdlClient()
48 clientGenerator1.wsdlClient()
49 elif urllist[len(urllist)-1]=='sawadl' or urllist[len(urllist)-1]=='SAWADL':
50
51 javahome = os.environ.get('JAVA_HOME')
52 galaxyhome=os.environ.get('GALAXY_HOME')
53 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/lib/SAWADLParser/bin'
54 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/lib/'
55 machine = platform.machine()
56
57 if machine == 'x86_64' :
58 print 'a'
59 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
60 elif machine == 'i686' :
61 print 'b'
62 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
63 elif machine == 'sun4u' :
64 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
65 else :
66 print 'c'
67 System.exit("Could not identify machine, please specify path to libjvm.so")
68
69 #f=open(sys.argv[5],'w')
70 #f.write('reached here 2 \t')
71 #f.close()
72
73 clientGenerator.sawadlClient()
74 clientGenerator1.sawadlClient()
75 #f=open(sys.argv[5],'w')
76 #f.write('reached here 3')
77 #f.close()
78
79 shutdownJVM()
80
81
82
83
84
85