Expose a few methods of Client and WSTester as API for Jim, new distributables.
[jabaws.git] / website / man_dev.html
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE html PUBLIC "XHTML 1.0 Strict"\r
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
4 <html xmlns="http://www.w3.org/1999/xhtml">\r
5 <head>\r
6 <meta name="Last-modified" content="Mon, 4 Apr 2011 12:00:00 GMT"/>\r
7 <title>Java Bioinformatics Analyses Web Services (JABAWS) client developers manual</title>\r
8 <link href="ws.css" rel="stylesheet" type="text/css" media=\r
9 "screen, projection, handheld, tv" />\r
10 <link rel="stylesheet" type="text/css" media="print" href=\r
11 "print.css" />\r
12 <script type="text/javascript" src="prototype-1.6.0.3.js"></script>\r
13 </head>\r
14 <body>\r
15 <div id="page">\r
16 <div id="banner">\r
17 <table> \r
18 <tr><td style="width:130px;"><a href="http://www.dundee.ac.uk"><img src="images/uod_lt.gif"  alt="University of Dundee" class="logo"  title="University of Dundee" longdesc="http://www.dundee.ac.uk"/></a></td>\r
19 <td class="bg"><img src="images/jabaws.png" title="JABAWS:MSA" alt="JABAWS:MSA"/></td>\r
20 <td class="bg"><img src="images/align.png"/></td>\r
21 </tr>\r
22 </table></div><!-- banner end-->\r
23 \r
24 <div id="wrapper">\r
25 <div id="panel"><a href="index.html">Home</a> \r
26  <a href="quick_start.html">Getting Started</a> \r
27  <a class="selected" href="man_about.html">Manual</a> \r
28         <div id="submenu">\r
29                 <a href="man_about.html">About</a>\r
30                 <a href="man_servervm.html" title="JABAWS Server as Virtual Appliance">Server VA</a>\r
31                 <a href="man_serverwar.html" title="JABAWS Server as Web Application aRchive">Server WAR</a>\r
32                 <a href="man_configuration.html" >Server<br/>\r
33                 Configuration</a>\r
34                 <a href="man_client.html" title="JABAWS Command Line Client">CMD Client</a>\r
35                 <a class="selected" href="man_dev.html" title="Accessing JABAWS from your program">Accessing<br/>\r
36                 JABAWS</a>      \r
37         </div>\r
38 <a href="download.html">Download</a> \r
39 <a href="contacts.html">Contact Us</a>\r
40 <a href="http://www.compbio.dundee.ac.uk">Barton Group</a> \r
41 </div>\r
42 \r
43 <!-- panel end-->\r
44 <div id="content">\r
45 <h2 id="headtitle">JABAWS MANUAL</h2>\r
46 \r
47 <h2>Using JABAWS From Your Program </h2>\r
48 <ul>\r
49   <li><a href="#wsfunctions">Web services functions overview </a></li>\r
50   <li><a href="#templatestr">The template client structure</a></li>\r
51   <li><a href="#connectto">Connecting to JABAWS</a></li>\r
52   <li><a href="#validnames">Valid JABAWS service names and WSDL files</a></li>\r
53   <li><a href="#defalign">Aligning sequences</a></li>\r
54   <li><a href="#checkresults">Checking the status of the calculation </a></li>\r
55   <li><a href="#presetalign">Aligning with presets</a></li>\r
56   <li><a href="#customalign">Aligning with custom parameters</a></li>\r
57   <li><a href="#writingaltofile">Writing alignments to a file</a></li>\r
58   <li><a href="#compex">A complete client example </a></li>\r
59   <li><a href="#buildart">Building web services artifacts</a></li>\r
60 </ul>\r
61 <h3><a name="wsfunctions" id="wsfunctions"></a>Web services functions overview </h3>\r
62 <p>All JABA multiple sequence alignment web services comply to the same interface, thus the function described below are available from all the services. </p>\r
63 <p><strong>Functions for initiating the alignment </strong><span class="code">  String id = align(List&lt;FastaSequence&gt; list)<br />\r
64   String id = customAlign(List&lt;FastaSequence&gt; sequenceList, List&lt;Option&gt; optionList)<br />\r
65   String id = presetAlign(List&lt;FastaSequence&gt; sequenceList, Preset preset)</span></p>\r
66 <p><strong>Functions pertaining to job monitoring and control</strong><br />\r
67   <span class="code">JobStatus status = getJobStatus(String id)<br />\r
68   Alignment al = getResult(String id)<br />\r
69   boolean cancelled = cancelJob(String id)<br />\r
70   ChunkHolder chunk = pullExecStatistics(String id, long marker)</span></p>\r
71 <p><strong>Functions relating to service features discovery</strong><br />\r
72   <span class="code">RunnerConfig rc = getRunnerOptions()<br />\r
73   Limit limit = getLimit(String name)<br />\r
74   LimitsManager lm = getLimits()<br />\r
75   PresetManager pm = getPresets()</span></p>\r
76 <p>Please refer to a <a href="dm_javadoc/compbio/data/msa/MsaWS.html">data model  javadoc</a> for a detailed description of each methods. </p>\r
77 <h3><a name="templatestr" id="templatestr"></a>Structure of the template command line client</h3>\r
78 <table width="100%" border="1">\r
79   <tr>\r
80     <td style="width:19%"><strong>Packages</strong></td>\r
81     <td style="width:81%"><strong>Classes and Interfaces </strong></td>\r
82   </tr>\r
83   <tr>\r
84     <td>compbio.data.msa </td>\r
85     <td>MsaWS the interface for all multiple sequence alignment web services </td>\r
86   </tr>\r
87   <tr>\r
88     <td>compbio.data.sequence</td>\r
89     <td>JABAWS data types </td>\r
90   </tr>\r
91   <tr>\r
92     <td>compbio.metadata</td>\r
93     <td>JABAWS meta data types </td>\r
94   </tr>\r
95   <tr>\r
96     <td>compbio.ws.client</td>\r
97     <td>JABAWS command line client </td>\r
98   </tr>\r
99 </table>\r
100 <p>Additional utility libraries this client depend upon is the compbio-util-1.3.jar and compbio-annotation-1.0.jar. <br />\r
101   Please refer to a <a href="dm_javadoc/index.html">data model javadoc</a> for a detailed description of each class and its methods. </p>\r
102 <h3><a name="connectto" id="connectto"></a>Connecting to JABAWS</h3>\r
103 <p class="attention">For a complete working example of JABAWS command line client please see compbio.ws.client.Jws2Client class. JABAWS command line client source code is available from the <a href="download.html">download page</a>. Please note that for now all the examples are in Java other languages will follow given a sufficient demand. </p>\r
104 <p>Download a binary JABAWS client. Add the client to the class path. The following code excerpt will connect your program to Clustal web service deployed in the University of Dundee. </p>\r
105 <p class="code"> import java.net.URL;<br />\r
106   import javax.xml.namespace.QName;<br />\r
107   import javax.xml.ws.Service;<br />\r
108   ...............<br />\r
109   1) String qualifiedName = &quot;http://msa.data.compbio/01/01/2010/&quot;;<br />\r
110   2) URL url = new URL(&quot;http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl&quot;);<br />\r
111   3) QName qname = new QName(, &quot;ClustalWS&quot;);<br />\r
112   4) Service serv = Service.create(url, qname);<br />\r
113   5) MsaWS msaws = serv.getPort(new QName(qualifiedName, &quot;ClustalWSPort&quot;),\r
114   MsaWS.class);</p>\r
115 <p>Line 1 makes a qualified name for JABA web services.<br />\r
116   Line 2 \r
117   constructs the URL to the web services WSDL. <br />\r
118   Line 3 makes a qualified name instance for Clustal JABA web service. <br />\r
119   Line 4 creates a service instance.<br />\r
120   Line 5 makes a connection to the server. </p>\r
121 <p>A more generic connection method would look like this </p>\r
122 <p class="code"> import java.net.URL;<br />\r
123   import javax.xml.namespace.QName;<br />\r
124   import javax.xml.ws.Service;<br />\r
125   import compbio.ws.client.Services<br />\r
126   .............. <br />\r
127   String qualifiedServiceName = &quot;http://msa.data.compbio/01/01/2010/&quot;;<br />\r
128   String host = &quot;http://www.compbio.dundee.ac.uk/jabaws&quot;;<br />\r
129   // In real life the service name can come from args<br />\r
130   Services clustal = Services.ClustalWS;<br />\r
131   URL url = new URL(host + &quot;/&quot; + clustal.toString() + &quot;?wsdl&quot;);<br />\r
132   QName qname = new QName(qualifiedServiceName, clustal.toString());<br />\r
133   Service serv = Service.create(url, qname);<br />\r
134   MsaWS msaws = serv.getPort(new QName(qualifiedServiceName, clustal<br />\r
135   + &quot;Port&quot;), MsaWS.class);</p>\r
136 <p>Where Services is enumeration of JABAWS web services. All JABAWS multiple sequence alignment methods confirm to MsaWS specification, thus from the caller point of view all JABAWS web services can be represented by MsaWS interface. The full documentation of MsaWS functions is available from the <a href="dm_javadoc/compbio/data/msa/MsaWS.html">javadoc</a>. </p>\r
137 <h3><a name="validnames" id="validnames"></a>Valid JABAWS service names and WSDL files </h3>\r
138 <ul>\r
139   <li><a href="http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl">ClustalWS</a> (http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl) </li>\r
140   <li><a href="http://www.compbio.dundee.ac.uk/jabaws/MuscleWS?wsdl">MuscleWS</a> (http://www.compbio.dundee.ac.uk/jabaws/MuscleWS?wsdl) </li>\r
141   <li><a href="http://www.compbio.dundee.ac.uk/jabaws/MafftWS?wsdl">MafftWS</a> (http://www.compbio.dundee.ac.uk/jabaws/MafftWS?wsdl) </li>\r
142   <li><a href="http://www.compbio.dundee.ac.uk/jabaws/TcoffeeWS?wsdl">TcoffeeWS</a> (http://www.compbio.dundee.ac.uk/jabaws/TcoffeeWS?wsdl) </li>\r
143   <li><a href="http://www.compbio.dundee.ac.uk/jabaws/ProbconsWS?wsdl">ProbconsWS</a> (http://www.compbio.dundee.ac.uk/jabaws/ProbconsWS?wsdl) </li>\r
144 </ul>\r
145 <h3><a name="defalign" id="defalign"></a>Aligning sequences </h3>\r
146 <p>Given that <span class="hightlight">msaws</span> is web service proxy, created as described in &quot;Connecting to JABAWS&quot; section, the actual alignment can be obtained as follows: </p>\r
147 <p class="code">1) List&lt;FastaSequence&gt; fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />\r
148   2) String jobId = msaws.align(fastalist); <br />\r
149   3) Alignment alignment = msaws.getResult(jobId);</p>\r
150 <p>Line  one loads FASTA sequence from the file<br />\r
151   Line two submits them to web service represented by msaws proxy <br />\r
152   Line three retrieves the alignment from a web service. This line will block the execution until the result is available. Use this with caution. In general, you should make sure that the calculation has been completed before attempting retrieving results. This is to avoid keeping the connection to the server on hold for a prolonged periods of time. While this may be ok with your local server, our public server (<a href="http://www.compbio.dundee.ac.uk/jabaws">www.compbio.dundee.ac.uk/jabaws</a>) will not let you hold the connection for longer than 10 minutes. This is done to prevent excessive load on the server. The next section describes how to check the status of the calculation.<br />\r
153   Methods and classes mentioned in the excerpt are available from the JABAWS client library. </p>\r
154 <h3><a name="checkresults" id="checkresults"></a>Checking the status of the calculation </h3>\r
155 <p> You may have noticed that there was no pause between submitting the job and retrieving of the results. This is because <span class="hightlight">getResult(jobId)</span> method block the processing until the calculation is completed. However, taking into account that the connection holds server resources, our public server (<a href="http://www.compbio.dundee.ac.uk/jabaws">www.compbio.dundee.ac.uk/jabaws</a>) is configured to reset the connection after 10 minutes of waiting. To work around the connection reset you are encouraged to check whether the calculation has been completed before accessing the results.       You can do it like this: </p>\r
156 <p> <span class="code">while (msaws.getJobStatus(jobId) != JobStatus.FINISHED) {<br />\r
157   &nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(2000); // wait two  seconds, then recheck the status <br />\r
158   }</span></p>\r
159 <h3><a name="presetalign" id="presetalign"></a>Aligning with presets</h3>\r
160 <p class="code">1) PresetManager presetman = msaws.getPresets();<br />\r
161   2) Preset preset = presetman.getPresetByName(presetName);<br />\r
162   3) List&lt;FastaSequence&gt; fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />\r
163   4) String jobId = msaws.presetAlign(fastalist, preset);<br />\r
164   5) Alignment alignment = msaws.getResult(jobId);</p>\r
165 <p>Line one obtains the lists of presets supported by a web service.<br />\r
166   Line two return a particular Preset \r
167   by its name<br />\r
168   Lines three to five  are doing the same job as in the first <a href="#defalign"> aligning sequences example</a>.</p>\r
169 <h3><a name="customalign" id="customalign"></a>Aligning with  custom parameters</h3>\r
170 <p class="code"> 1) RunnerConfig options = msaws.getRunnerOptions();<br />\r
171   2) Argument matrix = options.getArgument(&quot;MATRIX&quot;);<br />\r
172   3) matrix.setValue(&quot;PAM300&quot;);<br />\r
173   4) Argument gapopenpenalty = options.getArgument(&quot;GAPOPEN&quot;);<br />\r
174   5) gapopenpenalty.setValue(&quot;20&quot;);<br />\r
175   6) List&lt;Argument&gt; arguments = new ArrayList&lt;Argument&gt;(); <br />\r
176   7) arguments.add(matrix);\r
177   arguments.add(gapopenpenalty);<br />\r
178   8) List&lt;FastaSequence&gt; fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />\r
179   9) String jobId = msaws.customAlign(fastalist, arguments);<br />\r
180   10) Alignment alignment = msaws.getResult(jobId);</p>\r
181 <p>Line one obtains the <span class="hightlight">RunnerConfig</span> object that holds information on supported parameters and their values<br />\r
182   Line two retrieve a particular parameter from the holder by its name<br />\r
183   Lines three sets a value to this parameter which will be used in the calculation. <br />\r
184   Line four and five do the same but for another parameter<br />\r
185   Line 6 makes a List to hold the parameters <br />\r
186   Line seven puts the parameters into that list<br />\r
187   Line eight \r
188   and ten is the same as in previous examples<br />\r
189   Line nine submit an alignment request with the sequences and the parameters <br />\r
190   The names of all the parameters supported by a web service e.g. &quot;PAM300&quot; can be obtained using <span class="hightlight">options.getArguments() </span>method. Further details on the methods available from <span class="hightlight">RunnerConfig</span> object are available from the <a href="dm_javadoc/index.html">javadoc</a>. </p>\r
191 <h3><a name="writingaltofile" id="writingaltofile"></a>Writing alignments to a file</h3>\r
192 <p>There is a utility method in the client library that does exactly that. </p>\r
193 <p> <span class="code">Alignment alignment = align(...) <br />\r
194   FileOutputStream outStream = new FileOutputStream(file);<br />\r
195   ClustalAlignmentUtil.writeClustalAlignment(outStream, align);</span></p>\r
196 <h3><a name="compex" id="compex"></a>A complete client example </h3>\r
197 <p>Finally, a complete example of the program that connects to JABAWS Clustal service and aligns sequences using one of the  Clustal web service preset. Three is also a <a href="Example_template.pdf">PDF version</a> of this example with syntax highlighted. The text comments are commented by block style comments e.g. /* comment */, the alternatives given in the code are line commented // comment. You may want to remove line style comments to test alternatives of the functions. All you need for this to work is a <a href="download.html">JABAWS binary client</a>. Please make sure that the client is in the Java class path before running this example.</p>\r
198 <pre class="code" style="line-height:1em;">\r
199 import java.io.ByteArrayInputStream;\r
200 import java.io.FileNotFoundException;\r
201 import java.io.IOException;\r
202 import java.net.URL;\r
203 import java.util.List;\r
204 \r
205 import javax.xml.namespace.QName;\r
206 import javax.xml.ws.Service;\r
207 \r
208 import compbio.data.msa.MsaWS;\r
209 import compbio.data.sequence.Alignment;\r
210 import compbio.data.sequence.FastaSequence;\r
211 import compbio.data.sequence.SequenceUtil;\r
212 import compbio.metadata.JobSubmissionException;\r
213 import compbio.metadata.LimitExceededException;\r
214 import compbio.metadata.Preset;\r
215 import compbio.metadata.PresetManager;\r
216 import compbio.metadata.ResultNotAvailableException;\r
217 import compbio.metadata.UnsupportedRuntimeException;\r
218 import compbio.metadata.WrongParameterException;\r
219 \r
220 public class Example {\r
221 \r
222         /*\r
223          * Input sequences for alignment\r
224          */\r
225         static final String input = &quot;&gt;Foo\r\n&quot;\r
226                         + &quot;MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAVARLGR&quot;\r
227                         + &quot;VRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQLLPEEPYITAQ&quot;\r
228                         + &quot;LLNWRRRLCDWRALDVLSAQVRAAVAQGVGAVEPFAFLSEDASAAEQLACARTRAQAIAASVRPL&quot;\r
229                         + &quot;APTRVRSKGPLRVGFVSNGFGAHPTGLLTVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQA&quot;\r
230                         + &quot;STLHDVTALGHLATAKHIRHHGIDLLFDLRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMD&quot;\r
231                         + &quot;YVLGDAFALPPALEPFYSEHVLRLQGAFQPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLN&quot;\r
232                         + &quot;PQSMARMLAVLREVPDSVLWLLSGPGEADARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHAD&quot;\r
233                         + &quot;LFLDTHPYNAHTTASDALWTGCPVLTTPGETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALAS&quot;\r
234                         + &quot;DPAALTALHARVDVLRRESGVFEMDGFADDFGALLQALARRHGWLGI\r\n&quot;\r
235                         + &quot;\r\n&quot;\r
236                         + &quot;&gt;Bar\r\n&quot;\r
237                         + &quot;MGDTTAGEMAVQRGLALHQQRHAEAAVLLQQASDAAPEHPGIALWLHALEDAGQAEAAAAYTRAH&quot;\r
238                         + &quot;QLLPEEPYITAQLLNAVAQGVGAVEPFAFLSEDASAAESVRPLAPTRVRSKGPLRVGFVSNGFGA&quot;\r
239                         + &quot;HPTGLLTVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQASTLHDVTALGHLATAKHIRHHG&quot;\r
240                         + &quot;IDLLFDLRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMDYVLGDAFALPPALEPFYSEHVL&quot;\r
241                         + &quot;RLQGAFQPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLNPQSMARMLAVLREVPDSVLWLL&quot;\r
242                         + &quot;SGPGEADARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHADLFLDTHPYNAHTTASDALWTGC&quot;\r
243                         + &quot;PVLTTPGETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALASDPAALTALHARVDVLRRESGV&quot;\r
244                         + &quot;FEMDGFADDFGALLQALARRHGWLGI\r\n&quot;\r
245                         + &quot;\r\n&quot;\r
246                         + &quot;&gt;Friends\r\n&quot;\r
247                         + &quot;MTADGPRELLQLRAAVRHRPQDVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAVARLGRV&quot;\r
248                         + &quot;RWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDHQLLPEEPYITAQLDVLSAQVRAAVAQG&quot;\r
249                         + &quot;VGAVEPFAFLSEDASAAEQLACARTRAQAIAASVRPLAPTRVRSKGPLRVGFVSNGFGAHPTGLL&quot;\r
250                         + &quot;TVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQASTLHDVTALGHLATAKHIRHHGIDLLFD&quot;\r
251                         + &quot;LRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMDYVLGDAFALPPALEPFYSEHVLRLQGAF&quot;\r
252                         + &quot;QPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLNPQSMARMLAVLREVPDSVLWLLSGPGEA&quot;\r
253                         + &quot;DARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHADLFLDTHPYNAHTTASDALWTGCPVLTTP&quot;\r
254                         + &quot;GETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALASDPAALTALHARVDVLRRESI&quot;;\r
255 \r
256         public static void main(String[] args) throws UnsupportedRuntimeException,\r
257                         LimitExceededException, JobSubmissionException,\r
258                         WrongParameterException, FileNotFoundException, IOException,\r
259                         ResultNotAvailableException, InterruptedException {\r
260 \r
261                 String qualifiedServiceName = &quot;http://msa.data.compbio/01/01/2010/&quot;;\r
262 \r
263                 /* Make a URL pointing to web service WSDL */\r
264                 URL url = new URL(\r
265                                 &quot;http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl&quot;);\r
266 \r
267                 /*\r
268                  * If you are making a client that connects to different web services\r
269                  * you can use something like this:\r
270                  */\r
271                 // URL url = new URL(host + &quot;/&quot; + Services.ClustalWS.toString() +\r
272                 // &quot;?wsdl&quot;);\r
273 \r
274                 QName qname = new QName(qualifiedServiceName, &quot;ClustalWS&quot;);\r
275                 Service serv = Service.create(url, qname);\r
276                 /*\r
277                  * Multiple sequence alignment interface for Clustal web service\r
278                  * instance\r
279                  */\r
280                 MsaWS msaws = serv.getPort(new QName(qualifiedServiceName, &quot;ClustalWS&quot;\r
281                                 + &quot;Port&quot;), MsaWS.class);\r
282 \r
283                 /* Get the list of available presets */\r
284                 PresetManager presetman = msaws.getPresets();\r
285 \r
286                 /* Get the Preset object by preset name */\r
287                 Preset preset = presetman\r
288                                 .getPresetByName(&quot;Disable gap weighting (Speed-oriented)&quot;);\r
289 \r
290                 /*\r
291                  * Load sequences in FASTA format from the file You can use something\r
292                  * like new FileInputStream(&lt;filename&gt;) to load sequence from the file\r
293                  */\r
294                 List&lt;FastaSequence&gt; fastalist = SequenceUtil\r
295                                 .readFasta(new ByteArrayInputStream(input.getBytes()));\r
296 \r
297                 /*\r
298                  * Submit loaded sequences for an alignment using preset. The job\r
299                  * identifier is returned by this method, you can retrieve the results\r
300                  * with it sometime later.\r
301                  */\r
302                 String jobId = msaws.presetAlign(fastalist, preset);\r
303 \r
304                 /* This method will block for the duration of the calculation */\r
305                 Alignment alignment = msaws.getResult(jobId);\r
306 \r
307                 /*\r
308                  * This is a better way of obtaining results, it does not involve\r
309                  * holding the connection open for the duration of the calculation,\r
310                  * Besides, as the University of Dundee public server will reset the\r
311                  * connection after 10 minutes of idling, this is the only way to obtain\r
312                  * the results of long running task from our public server.\r
313                  */\r
314                 // while (msaws.getJobStatus(jobId) != JobStatus.FINISHED) {\r
315                 // Thread.sleep(1000); // wait a second, then recheck the status\r
316                 // }\r
317 \r
318                 /* Output the alignment to standard out */\r
319                 System.out.println(alignment);\r
320 \r
321                 // Alternatively, you can record retrieved alignment into the file in\r
322                 // ClustalW format\r
323 \r
324                 // ClustalAlignmentUtil.writeClustalAlignment(new FileOutputStream(\r
325                 // &quot;output.al&quot;), alignment);\r
326 \r
327         }\r
328 }\r
329 </pre>\r
330 For a more detailed description of all available types and their functions please refer to the <a href="dm_javadoc/index.html">data model javadoc</a>.\r
331 <h3><a name="buildart" id="buildart"></a>Building web services artifacts</h3>\r
332 <p>JABAWS are the standard <a href="http://jax-ws.java.net/">JAX-WS</a> SOAP web services, which are <a href="http://www.ws-i.org/">WS-I</a> basic   profile compatible. This means that you could use whatever tool your language has to work with web services. Below is how you can generate portable artifacts to work with JABAWS from Java. However,  if programming in Java we recommend using our  client library as it provides a handful of useful methods in addition to plain data types. </p>\r
333 <p class="code">wsimport -keep http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl</p>\r
334 </div>\r
335 \r
336 <!-- content end-->\r
337 <div id="copyright">Last update: 1 April 2011<br />\r
338  Peter Troshin, Jim Procter and Geoff Barton, The Barton Group, University of\r
339 Dundee, UK</div>\r
340 </div>\r
341 \r
342 <!-- wrapper end-->\r
343 </div>\r
344 <!-- page end-->\r
345 \r
346 <!-- Google analitics -->\r
347 <script type="text/javascript">\r
348 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");\r
349 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));\r
350 </script>\r
351 <script type="text/javascript">\r
352 try{\r
353 var pageTracker = _gat._getTracker("UA-5356328-1");\r
354 pageTracker._trackPageview();\r
355 } catch(err) {}\r
356 </script>\r
357 </body>\r
358 </html>\r
359 \r