johannes.globant has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying SOAP::Lite to get info from a simple Service:
#!/usr/bin/perl -w use strict; use warnings; use SOAP::Lite; my $service = SOAP::Lite -> service('http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL'); my $result = $service->GetWeatherInformation(); print "DONE\n";
That is all I have so far. The answer is the following and it looks like the module cannot interprete the returning xml. Any help is apreciated, thanks in advance Environment: Perl: v5.18.2 Ubuntu 14.04.1 64 bit Latest version of SOAP::Lite installed with 'make install'
defined(%hash) is deprecated at /usr/local/share/perl/5.18.2/SOAP/Lite +.pm line 444. (Maybe you should just omit the defined()?) defined(%hash) is deprecated at /usr/local/share/perl/5.18.2/SOAP/Lite +.pm line 2258. (Maybe you should just omit the defined()?) Odd number of elements in anonymous hash at /usr/local/share/perl/5.18 +.2/SOAP/Lite.pm line 1313. Can't use string ("1") as an ARRAY ref while "strict refs" in use at ( +eval 90) line 1. <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http: +//schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/20 +01/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">< +soap:Body><GetWeatherInformationResponse xmlns="http://ws.cdyne.com/W +eatherWS/"><GetWeatherInformationResult><WeatherDescription><WeatherI +D>1</WeatherID><Description>Thunder Storms</Description><PictureURL>h +ttp://ws.cdyne.com/WeatherWS/Images/thunderstorms.gif</PictureURL></W +eatherDescription><WeatherDescription><WeatherID>2</WeatherID><Descri +ption>Partly Cloudy</Description><PictureURL>http://ws.cdyne.com/Weat +herWS/Images/partlycloudy.gif</PictureURL></WeatherDescription><Weath +erDescription><WeatherID>3</WeatherID><Description>Mostly Cloudy</Des +cription><PictureURL>http://ws.cdyne.com/WeatherWS/Images/mostlycloud +y.gif</PictureURL></WeatherDescription><WeatherDescription><WeatherID +>4</WeatherID><Description>Sunny</Description><PictureURL>http://ws.c +dyne.com/WeatherWS/Images/sunny.gif</PictureURL></WeatherDescription> +<WeatherDescription><WeatherID>5</WeatherID><Description>Rain</Descri +ption><PictureURL>http://ws.cdyne.com/WeatherWS/Images/rain.gif</Pict +ureURL></WeatherDescription><WeatherDescription><WeatherID>6</Weather +ID><Description>Showers</Description><PictureURL>http://ws.cdyne.com/ +WeatherWS/Images/showers.gif</PictureURL></WeatherDescription><Weathe +rDescription><WeatherID>7</WeatherID><Description>Haze</Description>< +PictureURL>http://ws.cdyne.com/WeatherWS/Images/haze.gif</PictureURL> +</WeatherDescription><WeatherDescription><WeatherID>9</WeatherID><Des +cription>Partly Sunny</Description><PictureURL>http://ws.cdyne.com/We +atherWS/Images/mostlycloudy.gif</PictureURL></WeatherDescription><Wea +therDescription><WeatherID>10</WeatherID><Description>Mostly Sunny</D +escription><PictureURL>http://ws.cdyne.com/WeatherWS/Images/partlyclo +udy.gif</PictureURL></WeatherDescription><WeatherDescription><Weather +ID>11</WeatherID><Description>Clear</Description><PictureURL>http://w +s.cdyne.com/WeatherWS/Images/sunny.gif</PictureURL></WeatherDescripti +on><WeatherDescription><WeatherID>12</WeatherID><Description>Fair</De +scription><PictureURL>http://ws.cdyne.com/WeatherWS/Images/partlyclou +dy.gif</PictureURL></WeatherDescription><WeatherDescription><WeatherI +D>14</WeatherID><Description>Cloudy</Description><PictureURL>http://w +s.cdyne.com/WeatherWS/Images/mostlycloudy.gif</PictureURL></WeatherDe +scription><WeatherDescription><WeatherID>15</WeatherID><Description>N +/A</Description><PictureURL>http://ws.cdyne.com/WeatherWS/Images/na.g +if</PictureURL></WeatherDescription><WeatherDescription><WeatherID>17 +</WeatherID><Description>Drizzle</Description><PictureURL>http://ws.c +dyne.com/WeatherWS/Images/drizzle.gif</PictureURL></WeatherDescriptio +n><WeatherDescription><WeatherID>18</WeatherID><Description>Fog</Desc +ription><PictureURL>http://ws.cdyne.com/WeatherWS/Images/fog.gif</Pic +tureURL></WeatherDescription><WeatherDescription><WeatherID>20</Weath +erID><Description>Flurries</Description><PictureURL>http://ws.cdyne.c +om/WeatherWS/Images/blowingsnow.gif</PictureURL></WeatherDescription> +<WeatherDescription><WeatherID>21</WeatherID><Description>Snow and Fo +g</Description><PictureURL>http://ws.cdyne.com/WeatherWS/Images/blowi +ngsnow.gif</PictureURL></WeatherDescription><WeatherDescription><Weat +herID>26</WeatherID><Description>Blowing Snow and Fog</Description><P +ictureURL>http://ws.cdyne.com/WeatherWS/Images/blowingsnow.gif</Pictu +reURL></WeatherDescription><WeatherDescription><WeatherID>27</Weather +ID><Description>Snow</Description><PictureURL>http://ws.cdyne.com/Wea +therWS/Images/snow.gif</PictureURL></WeatherDescription><WeatherDescr +iption><WeatherID>28</WeatherID><Description>Rain and Fog</Descriptio +n><PictureURL>http://ws.cdyne.com/WeatherWS/Images/rain.gif</PictureU +RL></WeatherDescription><WeatherDescription><WeatherID>29</WeatherID> +<Description>Blowing Snow</Description><PictureURL>http://ws.cdyne.co +m/WeatherWS/Images/blowingsnow.gif</PictureURL></WeatherDescription>< +WeatherDescription><WeatherID>32</WeatherID><Description>Light Rain</ +Description><PictureURL>http://ws.cdyne.com/WeatherWS/Images/rain.gif +</PictureURL></WeatherDescription><WeatherDescription><WeatherID>33</ +WeatherID><Description>Heavy Rain</Description><PictureURL>http://ws. +cdyne.com/WeatherWS/Images/rain.gif</PictureURL></WeatherDescription> +<WeatherDescription><WeatherID>34</WeatherID><Description>Missing Dat +a</Description><PictureURL>http://ws.cdyne.com/WeatherWS/Images/na.gi +f</PictureURL></WeatherDescription><WeatherDescription><WeatherID>35< +/WeatherID><Description>Snow, Blowing Snow, and Fog</Description><Pic +tureURL>http://ws.cdyne.com/WeatherWS/Images/blowingsnow.gif</Picture +URL></WeatherDescription><WeatherDescription><WeatherID>36</WeatherID +><Description>Unknown Precipitation</Description><PictureURL>http://w +s.cdyne.com/WeatherWS/Images/na.gif</PictureURL></WeatherDescription> +<WeatherDescription><WeatherID>37</WeatherID><Description>AM CLOUDS</ +Description><PictureURL>http://ws.cdyne.com/WeatherWS/Images/partlycl +oudy.gif</PictureURL></WeatherDescription></GetWeatherInformationResu +lt></GetWeatherInformationResponse></soap:Body></soap:Envelope> at /h +ome/johannes/Documentos/PERL/epic_workspace/HelloWorldProject/src/tes +t7-Soap/70-SoapGet.pl line 10.

Replies are listed 'Best First'.
Re: SOAP::Lite cannot interpret response
by hippo (Archbishop) on Nov 12, 2014 at 12:28 UTC

    SOAP::Lite has quite a few bugs including 70234 which is similar to your report here - perhaps they are related?

    FWIW I gave up on SOAP::Lite a few years ago and none of my code in active use employs it. The reviews by others somewhat echo my experiences with it and, depending or your use case, it may be more productive to go with an alternative SOAP module or with a lower-level approach (which is usually what I end up doing).

    Good luck with it, either way.

      Hi, thanks for your replay. Do you have any recomendations for an "alternative SOAP module" ? Best, Johannes
        I haven't used it myself, but my colleagues were quite satisfied with XML::Compile. It might look complicated at the beginning, though.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ