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