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

Hi monks.
I have recently started using the SOAP::Lite module, and am now trying to figure out the SOAP::WSDL module, to check it's advantages over SOAP::Lite. To get started, I tried converting the age old "hello world" program from SOAP::Lite to SOAP::WSDL. The code for SOAP::Lite is: (taken from here) with a slight rewrite
#!/exlibris/metalib/m4_b/product/bin/perl use SOAP::Lite; { my $soap_request = SOAP::Lite->new(); $soap_request->uri('http://www.soaplite.com/Demo'); $soap_request->proxy('http://services.soaplite.com/hibye.cgi'); my $soap_response = $soap_request->hi(); my $result = $soap_response->result; print "$result\n"; }
I have tried to write it according to the SOAP::WSDL module, as so:
#!/exlibris/metalib/m4_b/product/bin/perl use SOAP::WSDL; { my $soap_request=SOAP::WSDL->new(); $soap_request->wsdl('http://www.soaplite.com/Demo'); $soap_request->proxy('http://services.soaplite.com/hibye.cgi'); $soap_request->wsdlinit; my $soap_response = $soap_request->call('hi'); my $result = $soap_response->result; print "the result is: $result\n"; }
However, I get this error message:
Service description 'http://www.soaplite.com/Demo' can't be loaded: 40 +4 Not Found
According to the module documentation, SOAP::WSDL basically expands on SOAP::Lite, so what worked in SOAP::Lite should also work in SOAP::WSDL. Does anybody have any idea what might be the problem? Also, any info or examples about SOAP::WSDL will be highly appreciated.
Thanks in advance,
Guy Naamati


A truth that's told in bad intent beats all the lies you can invent

Replies are listed 'Best First'.
Re: SOAP::Lite and SOAP::WSDL
by jhourcle (Prior) on Jul 24, 2006 at 15:28 UTC

    The 'uri' in SOAP::Lite is not the same as the service descriptor (which is called with 'service'). SOAP::WSDL needs to be pointed at a WSDL document, which is an XML document that describes the calling and return syntax of a webservice.

    The URI for a SOAP call is just an identifier, and doesn't need to actually resolve to a document. (which in this particular case, it doesn't.) Ideally, when you have a WSDL document, you don't need to specify the URI or proxy, as they're already defined within the service description.

    Also, as I mentioned before, SOAP::WSDL was written because of lacking WSDL support in SOAP::Lite -- SOAP::Lite has since been improved, and SOAP::WSDL isn't being maintained, so I don't know how beneficial it is to use SOAP::WSDL.

      Thanks, that's very helpful advice about SOAP::WSDL. While we're on the subject, I understand from the documentation that one of SOAP::WSDL's greatest advantages over SOAP::Lite is that you can send the parameters in a hash. I didn't see anything similar in SOAP::Lite, and because I want to send a generic data structure in the SOAP request due to inheritence, the ability to use a hash was one of my main reasons to want to use SOAP::WSDL. Do you know if I can send a hash or something similar in SOAP::Lite? I am also posting these questions in the SOAP::Lite newsgroup due to your previous advice.
      Thanks again, Guy