00001 #!perl
00002 #---------------------------------------------------
00003 # WSPerlClient.pl
00004 #
00005 # Project: PDBe API Framework
00006 # Module: Perl Client for PDBe API Webservice (SOAP) Server
00007 # This client call msdSSM method for specified PDB file in specific location.
00008 # SOAP User Layer
00009 # Last updated: 25 February 2004 10:17
00010 # (C) Siamak Sobhany
00011 #---------------------------------------------------
00012
00013 use SOAP::Lite;
00014 use IO::File;
00015
00016 my $service = SOAP::Lite
00017 ->uri('urn:msd_soap_service')
00018 ->proxy('http:
00019 # -> service('http:
00020 my $query = '<SSMInput>'.
00021 '<program>'.
00022 'SSM v1.38
00023 'Bioinformatics Institute, Hinxton, Cambridge CB1 9SD, UK'.
00024 '</program>'.
00025 '<query>'.
00026 '<type>Coordinate file</type>'.
00027 '<file>/tmp_mnt/net_nfs5/vol4/research-thornton/ssmout/profunc18020.pdb</file>'.
00028 '<selection>'.
00029 '<type>Chain(s)</type>'.
00030 '<chains>A</chains>'.
00031 '</selection>'.
00032 '</query>'.
00033 '<target>'.
00034 '<type>PDB archive</type>'.
00035 '</target>'.
00036 '<percent1>70</percent1>'.
00037 '<percent2>70</percent2>'.
00038 '<sepchains>Yes</sepchains>'.
00039 '<connectivity>Yes</connectivity>'.
00040 '<bestmatch>Yes</bestmatch>'.
00041 '<uniquematch>Yes</uniquematch>'.
00042 '<precision>Normal</precision>'.
00043 '<sorting>Q-score</sorting>'.
00044 '</SSMInput>';
00045
00046 my $sessionid = 'profunc18020';
00047 my $array = [$query , $sessionid];
00048 print "\nCalling method: msdSSM()\n";
00049 my $result1 = $service->msdSSM(SOAP::Data->name('numofpars' => 2),
00050 SOAP::Data->name('inparams' => $array));
00051 unless ($result1->fault) {
00052 print "\nmsdSSM() called successfully.\n";
00053 print $result1->result();
00054 }else{
00055 print join ', ',
00056 $result1->faultcode,
00057 $result1->faultstring;
00058 }
00059 for ($i=1; $i > 0 ; $i++)
00060 { my $result2 =
00061 $service->msdGetSoapBase64Data(SOAP::Data->name('diyf')->type('xsd:int')->value(1), # 0
00062
00063 SOAP::Data->name('sessionid')->type('xsd:string')->value($sessionid));
00064 unless ($result2->fault || ($result2->faultstring != 'Result fille notready')) {
00065 $i=-1;
00066 print $result2->result();
00067 $fh = new IO::File "> my_result.xml";
00068 if (defined $fh) {
00069 print $fh $result2->result();
00070 $fh->close;
00071 print "\nResult file created successfully:\n";
00072 }
00073 }else{
00074 print join ', ',
00075 "\nXML File not ready...retry: $i ",
00076 $result2->faultcode,
00077 $result2->faultstring;
00078 }
00079 sleep(5);
00080 }
00081 my $result3 =
00082 $service->msdSSMPurge(SOAP::Data->name('sessionid')->type('xsd:string')->value($sessionid));
00083 unless ($result3->fault) {
00084 print "\nmsdSSMPurge() called successfully.\n";
00085 print $result3->result();
00086 }else{
00087 print join ', ',
00088 $result3->faultcode,
00089 $result3->faultstring;
00090 }