about sitemap home home
Databases Data Formats Database Search Genome Browser RNA Secondary Structure Alignments Primer Design WebServices
Technology Simple Client Asynchronity
Demo Java Client Exercise WS choreography Exercise Combining WS
Bielefeld University Center of Biotechnoloy Institute of Bioinformatics BiBiServ
 
Simple Client - Example 1: Manual 'choreography'
In this exercise, the task is to combine the Perl example client from the first WebServices exercise (which calls the EBI dbfetch WebService) with a Java client based on the one from the demonstration to transform the FASTA formatted output of dbfetch into the SequenceML XML format using the BioDOM WebService. To achieve this goal, you are required to modify the example Java clientto either

 - accept a FASTA formatted input file on the command line
OR
 - read it's input data from the standard input

If you choose the first option, you will have to save the Perl client's FASTA output into a separate file and then call your Java client with this file as input.
If you should choose the second way, you could simply feed the Perl client's output into your program using the standard UNIX pipe-operator ('|'), thereby saving yourself the work of saving and reloading the data.

HINTs:

  • Reading newline characters from STDIN or command line arguments with java makes problems. You should replace \n in the perl-scripts output wih e.g. #. The Perl code for doing this is $output=~ s/\n/#/gi; To reset the change in the java code you can use foo = foo.replace("#", "\n");
  • Take a look at the other example clients for the BioDOM Webservice on the BioDOM web page!
  • check the Java API documentation for System.in, InputStream, File and FileInputStream