|
PDBe API Examples
To run and test the clients...
Example for Client of The PDBe SSM Web Service provides a result in XML format for a given XML string including input data, see Secondary Structure Matching Tool for details of this system. The sample of input XML string for this method is:
<SSMInput>
<program> SSM v1.38 // 30/06/2003 // by Eugene B. Krissinel, European Bioinformatics Institute, Hinxton, Cambridge CB1 9SD, UK </program> <query> <type>PDB entry</type> <pdbcode>1sar</pdbcode> </query> <target> <type>PDB archive</type> </target> <selection> <type>Chain(s)</type> <chains>*(all)</chains> </selection> <percent1>70</percent1> <percent2>70</percent2> <sepchains>Yes</sepchains> <connectivity>Yes</connectivity> <bestmatch>Yes</bestmatch> <uniquematch>Yes</uniquematch> <precision>Normal</precision> <sorting>RMSD</sorting> </SSMInput> The WSDL description of the SSM Web Service provides the following details: Endpoint URL: http://www.ebi.ac.uk/msd-srv/msdsoap SOAP action: "" Remote method namespace: urn:msd_soap_service Remote method name: msdSSM Input parameter: numofpars of type xsd:int inparams of type ns:ArrayOfanyType Output parameter: Result of type xsd:int Using the WSDL importer tool from your SOAP toolkit for your desired language, for example in Java you may use Apache Axis, or in Perl, use SOAP::Lite, or in PHP use NuSOAP you can import the WSDL file msd_soap_service.wsdl and generate SOAP wrappers ready to call from your application.
#!perl
use SOAP::Lite; print SOAP::Lite -> service('/msd/api/msd_soap_service.wsdl') -> msdSSM( 2 , ['<SSMInput>'. '<program>'. 'SSM v1.38 // 30/06/2003 // by Eugene B. Krissinel,'. 'European Bioinformatics Institute,'. 'Hinxton, Cambridge CB1 9SD, UK'. '</program>'. '<query>'. '<type>PDB entry</type>'. '<pdbcode>1sar</pdbcode>'. '</query>'. '<target>'. '<type>PDB archive</type>'. '</target>'. '<selection>'. '<type>Chain(s)</type>'. '<chains>*(all)</chains>'. '</selection>'. '<percent1>70</percent1>'. '<percent2>70</percent2>'. '<sepchains>Yes</sepchains>'. '<connectivity>Yes</connectivity>'. '<bestmatch>Yes</bestmatch>'. '<uniquematch>Yes</uniquematch>'. '<precision>Normal</precision>'. '<sorting>RMSD</sorting>'. '</SSMInput>', 'my_session_number' ]); Here is the Perl example with another method to get the SSM result as XML:
#!perl
use SOAP::Lite; use IO::File; my $service = SOAP::Lite ->uri('urn:msd_soap_service') ->proxy('http://www.ebi.ac.uk/msd-srv/msdsoap'); # Or: # -> service('/msd/api/msd_soap_service.wsdl'); my $query = '<SSMInput> <query> <type>PDB entry</type> <pdbcode>1sar</pdbcode>'. '</query> <target> <type>PDB archive</type>'. '</target> <selection> <type>Chain(s)</type>'. '<chains>*(all)</chains> </selection> <percent1>70</percent1>'. '<percent2>70</percent2> <sepchains>Yes</sepchains>'. '<connectivity>Yes</connectivity> <bestmatch>Yes</bestmatch>'. '<uniquematch>Yes</uniquematch> <precision>Normal</precision>'. '<sorting>RMSD</sorting> </SSMInput>'; my $sessionid = 'mysessionnumber'; my $array = [$query , $sessionid]; print "\nCalling method: msdSSM()\n"; my $result1 = $service->msdSSM(SOAP::Data->name('numofpars' => 2), SOAP::Data->name('inparams' => $array)); unless ($result1->fault) { print "\nmsdSSM() called successfully.\n"; print $result1->result(); }else{ print join ', ', $result1->faultcode, $result1->faultstring; } for ($i=1; $i > 0 ; $i++) { my $result2 = $service->msdGetSoapBase64Data(SOAP::Data->name('diyf')->type('xsd:int')->value(1), SOAP::Data->name('sessionid')->type('xsd:string')->value($sessionid)); unless ($result2->fault || ($result2->faultstring != 'Result fille not ready')) { $i=-1; print $result2->result(); $fh = new IO::File "> my_result.xml"; if (defined $fh){ print $fh $result2->result(); $fh->close; print "\nResult file created successfully:\n"; } }else{ print join ', ', "\nXML File not ready...retry: $i ", $result2->faultcode, $result2->faultstring; } sleep(5); } my $result3 = $service->msdSSMPurge(SOAP::Data->name('sessionid')->type('xsd:string')->value($sessionid)); unless ($result3->fault) { print "\nmsdSSMPurge() called successfully.\n"; print $result3->result(); }else{ print join ', ', $result3->faultcode, $result3->faultstring; }
Primary developer: Siamak Sobhany Document mantained by: Gaurav Sahni ![]() |