mythsgreeks has asked for the wisdom of the Perl Monks concerning the following question:

HI ALL!!! I'm new with Perl in general, a newbie!! I want to write a perl client for calling this web service : http://bioinformatics.istge.it:8080/axis/services/cabri.getBacteriaById?wsdl its a Soap web service RPC/encoded. Please could some of you tell me how to write such a script?!!? normally it works with an input with 2 arguments (key-value): libs and id (for example : libs = DSMZ_BACT , id = DSM_SP_9849). I'm not sure how to get the outpus ('result) Thank you very much regards I tried in this way but it seems not to work!
#!perl -w # Enable Perl warnings use strict; use warnings; # SOAP::Lite module use SOAP::Lite; my %params = ( "libs" => "DSMZ_BACT" , "id" => "DSM_SP_9849" ); #my %output = ( "output" => "" ); # WSDbfetch WSDL URL my $WSDL = 'http://bioinformatics.istge.it:8080/axis/services/cabri.ge +tBacteriaById?wsdl'; # Create the service interface my $soap = new SOAP::Lite->service($WSDL); my %output = $soap->runAndWaitFor(%params); #my $result = $output->valueof('//output'); #print $result ; #print $output->{'output'}; print %output;

Replies are listed 'Best First'.
Re: Perl client for soap web service rpc
by rmflow (Beadle) on Jan 18, 2010 at 12:11 UTC
    to see what data comes out try
    use Data::Dumper;
    and then print Dumper %output
      if I use
      use Data::Dumper; and print Dumper %output; (in this way?) I got no output but if i use : use SOAP::Lite +trace;
      on the screen I got this stuff :
      SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Parser::DESTROY: () SOAP::Transport::HTTP::Client::new: () SOAP::Lite::call: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: runAndWaitFor SOAP::Data=HASH(0x3c3bedc) D +SM_SP_9849 libs DSMZ_BACT SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x3bac +aac) SOAP::Transport::HTTP::Client::send_receive: POST http://bioinformatic +s.istge.it :8080/axis/services/cabri.getBacteriaById HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 960 Content-Type: text/xml; charset=utf-8 SOAPAction: "" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="ht +tp://gowla b.SoaplabServer.ebi.embl.org" xmlns:wsdlsoap="http://schemas.xmlsoap.o +rg/wsdl/so ap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" soap:encodingSt +yle="http: //schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlso +ap.org/soa p/envelope/" xmlns:tns1="http://SoaplabShare.ebi.embl.org" xmlns:impl= +"http://bi oinformatics.istge.it:8080/axis/services/cabri.getBacteriaById" xmlns: +wsdl="http ://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSch +ema-instan ce" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs +d="http:// www.w3.org/2001/XMLSchema"><soap:Body><namesp1:runAndWaitFor><in0 xsi: +nil="true" xsi:type="apachesoap:Map" /><c-gensym4 xsi:type="xsd:string">DSM_SP_9 +849</c-gen sym4><c-gensym6 xsi:type="xsd:string">libs</c-gensym6><c-gensym8 xsi:t +ype="xsd:s tring">DSMZ_BACT</c-gensym8></namesp1:runAndWaitFor></soap:Body></soap +:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x3af +e4ec) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Ser +ver Error Connection: close Date: Mon, 18 Jan 2010 10:58:35 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Mon, 18 Jan 2010 11:02:49 GMT Client-Peer: 10.2.0.92:8080 Client-Response-Num: 1 <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv= +"http://sc hemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XM +LSchema" x mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><so +apenv:Faul t><faultcode>Server.userException</faultcode><faultstring>No such oper +ation 'run AndWaitFor'</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.a +pache.org/ axis/">ml570.istge.it</ns1:hostname></detail></soapenv:Fault></soapenv +:Body></so apenv:Envelope> SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () SOAP::SOM::new: () SOAP::SOM::DESTROY: () SOAP::Lite::DESTROY: () SOAP::Serializer::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Transport::HTTP::Client::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Parser::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: ()
      I don't know exactly what to do is for the input type definitions !? or the call to the specific operation through the wsdl!? thanks