File: weather.pl

package info (click to toggle)
libsoap-wsdl-perl 3.004-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,600 kB
  • sloc: perl: 8,433; xml: 1,769; java: 19; makefile: 15
file content (22 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Accessing the globalweather service at
# www.webservicex.net/GlobalWeather/GlobalWeather.asmx
#
# Note that the GlobalWeather web service returns a (quoted) XML structure - 
# don't be surprised by the response's format.
#
# I have no connection to www.webservicex.net
# Use this script at your own risk.
#
# This script demonstrates the use of a interface generated by wsdl2perl.pl

use lib 'lib/';
use MyInterfaces::GlobalWeather::GlobalWeatherSoap;
my $weather = MyInterfaces::GlobalWeather::GlobalWeatherSoap->new();
my $result = $weather->GetWeather({ CountryName => 'Germany', CityName => 'Munich' });

# boolean comparison overloaded
die $result->get_faultstring()->get_value() if not ($result);   

# The result is a XML string
# use get_value to avoid automatic entity encoding
print $result->get_GetWeatherResult()->get_value , "\n";