Finally, the new web services are working
[jabaws.git] / how_to_add_new_webservice.txt
1 How To add a new executable\r
2 \r
3 1) Add executable to the binaries folder. If it has source code and can be recompiled for different platforms include it under binaries/src \r
4 Edit binaries/src setexecutableflag.sh and compilebin.sh scripts accordingly. \r
5 \r
6 2) Make sure all the dependencies of the software being installed are satisfied. If there are other binaries they should be included as well. Keep the dependant binaries in subfolder for the main executable. Update compily and setexecflag scripts accordigly. \r
7 \r
8 3) Make sure executable \r
9    - Does not have any hard links to its dependencies, e.g. is able to run from any installation folder and does not contain any hardcoded paths. (TODO examples...) \r
10 \r
11 4) Describe executable in conf/Exectuable.properties. \r
12 \r
13 5) Add <ExecutableName>Limit.xml, <ExecutableName>Parameters.xml and <ExecutableName>Presets.xml. All but Limits are optional. \r
14 \r
15 6) Create a Java wrapper class for your executable. Create it within runner source directory.\r
16 \r
17 7) Create a testcase suit for your wrapper and run the test cases. \r
18 \r
19 8) Create parser for the output files of your executable. Suggested location compbio.data.sequence.SequenceUtil  \r
20 \r
21 9) Test the parser\r
22 \r
23 10) Decide which interface your executable is going to match. \r
24     For example it what the executable produces can be represented as Annotations \r
25     to the sequence file or alignment, then SequenceAnnotation interface might be appropriate. \r
26     For multiple sequence alignment an Msa interface should be used. \r
27 \r
28 11) If matching interface is found, then implement a web service confirming to it within \r
29     a webservices source folder \r
30 \r
31 12) Register web service in WEB-INF/ web.xml and sun-jaxws.xml\r
32 \r
33 13) Add generated wsdl to wsbuild.xml ant script to generate the stubs\r
34 \r
35 14) Run build-server task in wsbuild file. Watch for errors. If cannot compile that means \r
36 that JAXB cannot serialize some of the data structures. Add appropriate annotations to your data types.\r
37 Check that \r
38   - you do not have interfaces to serialize. JAXB cannot serialize them.\r
39   - you have a default no args constructor (can be private if you do not need it)\r
40   - JAXB cannot serialize a Map, use custom data structure instead!\r
41   - Enum cannot be serialized as its abstract class (do not confuse with enum which is fine)\r
42   - Fields serialization leave a little more space for manuevre, so use it. If you do you then \r
43   can accept and return interfaces, e.g. List, Map; abstract classes etc, from your methods. \r
44   \r
45 If you have the data on the server side, but nothing is coming through to the client, \r
46 this is a JAXB serialization problem. They tend to be very silent and thus hard to debug. Check your \r
47 data structure can be serialized! \r
48 \r
49 13) Modify the client to work with your web service. \r
50 \r
51 14) Test. \r
52 \r
53 15) Testing on the cluster...\r
54 \r
55 \r
56 \r
57 If executable does not support parameters do not add a reference to the XXXParameter.xml \r
58 file into the Executable.properties file. Do the same for Presets\r
59 \r
60 \r
61  \r
62 \r
63 \r