#!/usr/bin/php # Description: Client script in PHP running the RNAmmer Web Service # Author: Karunakar Bayyapu # Email: karun@cbs.dtu.dk # Version: 1.2 ws1 # Date: 2012-04-23 ### for installation and usage notes please see below ### client code starts here 1)); #runService --You need to change the sequences and ids as per your requirement. #organism and method are optional as per wsdl document $param = array( 'parameters'=>array('sequencedata'=>array( 'sequence'=> array( array('id' => 'IPI:IPI00000021.5', 'seq'=> 'GAASRKRPPPALWARTPGWAFGGHTGPAAPSRRTTEAPGPNTSCRPTPQTTCGPGPGHLV PARMTVRGTDGAPAYSIYGRPRRSAPFLTPGPGRYFPERAGNATYPSAPRHTIAPRNWGV QAEQQSPGPAAYTVPSLLGPRVIGKVSAPTCSIYGRRAAGSFFEDLSKTPGPCAYQVVSP GVYKSRAPQFTILARTSLPQDNTRKPGPAAYNVDQHRKPRGWSFGIRHSDYLAPLVTDAD N'), array('id' => 'IPI:IPI00000013.1', 'seq'=> 'MNLSLVLAAFCLGIASAVPKFDQNLDTKWYQWKATHRRLYGANEEGWRRAVWEKNMKMIE LHNGEYSQGKHGFTMAMNAFGDMTNEEFRQMMGCFRNQKFRKGKVFREPLFLDLPKSVDW RKKGYVTPVKNQKQCGSCWAFSATGALEGQMFRKTGKLVSLSEQNLVDCSRPQGNQGCNG GFMARAFQYVKENGGLDSEESYPYVAVDEICKYRPENSVANDTGFTVVAPGKEKALMKAV ATVGPISVAMDAGHSSFQFYKSGIYFEPDCSSKNLDHGVLVVGYGFEGANSNNSKYWLVK NSWGPEWGSNGYVKIAKDKNNHCGIATAASYPNV') ) ) ) ); $result = $client->runService($param); echo("\nDumping request headers:\n".$client->__getLastRequestHeaders()); echo("\nDumping request:\n".$client->__getLastRequest()); echo("\nDumping response headers:\n".$client->__getLastResponseHeaders()); echo("\nDumping response:\n".$client->__getLastResponse()); #pollQueue --jobid needs to be changed as which you got from runService $param=array('job'=>array('jobid'=>'7BC44408-4041-11E1-AF58-C0FF935B49F0')); $result=$client->pollQueue($param); echo("\nDumping request headers:\n".$client->__getLastRequestHeaders()); echo("\nDumping request:\n".$client->__getLastRequest()); echo("\nDumping response headers:\n".$client->__getLastResponseHeaders()); echo("\nDumping response:\n".$client->__getLastResponse()); #fetchResult --jobid needs to be changed as which you got from runService $param=array('job'=>array('jobid'=>'3D996364-727A-11E1-864F-F32F2EB4B995')); $request=$client->fetchResult($param); echo("\nDumping request headers:\n".$client->__getLastRequestHeaders()); echo("\nDumping request:\n".$client->__getLastRequest()); echo("\nDumping response headers:\n".$client->__getLastResponseHeaders()); echo("\nDumping response:\n".$client->__getLastResponse()); ?> ### client code ends here ######################################################################################### ############################# ############################# ############################# DOCUMENTATION ############################# ############################# ############################# ######################################################################################### # Introduction: # To create a SOAP client to access CBS web services is easy and no need to install any # extra libraries while you use PHP newer versions # Installation: # Required/tested version : PHP 5.2.14 # You can download PHP from php.net/downloads.php or you can activate on your linux machine # Access Web sevices: # Ths RNAmmer service code access to see one method results at once. If you would like to # see runService method results then you would need to comment the rest of the methods code # and for rest also same. In the runService, you need to submit required fileds like one id # and corresponding sequence or more ids and their corresponding sequences as a input(STDIN) # data to convert FASTA format to get the results. # For input data/FASTA format see example: # http://www.cbs.dtu.dk/ws/RNAmmer/examples/example) # After getting jobid from runService then you would need to submit jobid in the pollQueue # to know the status of the job. After knowing the status of the job from pollQueue then # you need to submit jobid in the fetchResult to see complete final results. # It means you can only see final results in the fetchResult since RNAmmer is implemented # in asynchronous way # Compile: # Once you saved client code in your local machine, run this command at the same time you make sure #t hat you are in the same directory. # >php client.php # Results: # We can see SOAP Request and Response with header since we are dumping headers also