http://www.perlmonks.org?node_id=756393


in reply to SOAP WSDL and perl

From your comment about saving it as a CGI file, I suspect that you're running into the same problem as Webservices and browsers

Replies are listed 'Best First'.
Re^2: SOAP WSDL and perl
by secura (Initiate) on Nov 11, 2009 at 12:17 UTC
    I am running a local StockQuoteService , http://localhost:8080/axis2/services/StockQuoteService?wsdl
    $stockprice=SOAP::Lite ->service('http://localhost:8080/axis2/service/StockQuoteService?w +sdl') ->getPrice('IBM'); print Dumper($stockprice);
    The result returns $VAR1 = undef; I am getting a undef value , what is the correct way to call a webservice using Perl?
      I usually use this:

      #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use SOAP::Lite; use SOAP::WSDL; my $service = SOAP::Lite ->service('http://localhost:8080/axis2/service/StockQuoteSer +vice?wsdl'); print Dumper "IBM ", $service->getQuote('IBM'), "\n";
        The URL you have I guess is wrong. It is "services" not "service". When I run the code with URL I get the following SOAP message returned
        <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv= +"http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa +="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.w3.org +/2005/08/addressing/soap/fault</wsa:Action></soapenv:Header><soapenv: +Body><soapenv:Fault><faultcode>VersionMismatch</faultcode><faultstrin +g>Only SOAP 1.1 or SOAP 1.2 messages are supported in the system</fau +ltstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
        What could be the error?