JAVA - SOAP web services

Use the Axis framework to generate the web service client code using the following command line:

java org.apache.axis.wsdl.WSDL2Java "http://www.rcsb.org/pdb/services/pdbws?wsdl"

For a more detailed introduction into how to develop web services using the RCSB soap interface see the developing web services page.

Then you can run e.g. the code below to execute a BLAST search against PDB:

import java.io.PrintStream; import java.net.URL; import org.pdb.webservices.PdbWebService; import org.pdb.webservices.PdbWebServiceServiceLocator; public class BlastPDB { public static void main(String[] _args) { // call the blast method below using this sequence and the ecutoff value blastThePDB("VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKKVADALTNAVAHVDDMPL", 10); } private static void blastThePDB(String _sequence, double _eCutOff) { // build the service locator object. This object was created by Axis wsdl2java PdbWebServiceServiceLocator locator = new PdbWebServiceServiceLocator(); try { // construct my URL object String _url = "http://www.pdb.org/pdb/services/pdbws"; URL url = new URL(_url); // Get the web services interface (axis-generated interface) PdbWebService p = locator.getpdbws(url); // print some feedback to the standard out System.out.println("Blasting... "); // call the blast program on the PDB server using these parameters String output = p.blastPDB(_sequence, _eCutOff, "BLOSUM62" , "HTML"); // print the output System.out.println ( "output : " + output ); // save the output into f file File outputFile = new File ("MyBlastResults.html"); PrintStream printer = new PrintStream ( outputFile ); printer.print(output); printer.flush(); printer.close(); System.out.println("Blast is complete"); } catch (Exception _e) { _e.printStackTrace(); } } }