SEED Web services using Java in Eclipse

Here’s how to use SEED Web services in Eclipse:

You’ll likely need these plug-ins for Eclipse:

  • wsdl4j Download this, unzip, and copy the whole directory into your eclipse plugins directory.
  • axis.jar
  • org.apache.commons-discovery.jar
  • javax.wsdl.jar
  • jaxrpc.jar
  • org.apache.commons.logging
  • saaj.jar

Once you have these set up, create a Java project. Choose the folder, and select

  • New -> Other
  • Web Service Client

Enter the URL in the box. Note that it should provide a yellow warning triangle (which you can ignore). Click next, and then finish, and you will get the WSDL parsed and included into your project as a gov.anl.mcs.bioseed.* diirectory if you use this URL (its better than the one above):

http://bioseed.mcs.anl.gov/~redwards/FIG/wsdl_seed.cgi

Finally, import that in your code.

Take the jump to see example code.

 

 

 

 import gov.anl.mcs.bioseed.SeedWebServices.*;   public class ws {      public static void main(String[] args)     {         SeedWebServicesHandler ws = new SeedWebServicesHandlerProxy();          // this is a protein in E. coli see: http://www.theseed.org/linkin.cgi?id=fig|83333.1.peg.1345 //        String peg = "fig|83333.1.peg.1345";         String genomeid = "83334.1";          String [] trans={"undefined"};         try {             trans = ws.contigs_of(genomeid);         }         catch (Exception e)         {             // extremely bad error handling :)             System.err.println("Yikes, had an error");             e.printStackTrace();         }          for (String s : trans)             System.out.println(s);          String pegs = "";         try {             pegs = ws.pegs_of(genomeid);         }         catch (Exception e)         {             // extremely bad error handling :)             System.err.println("Yikes, had an error");             e.printStackTrace();         }                           System.out.println(pegs);       } }