import SOAP-WSDL 2.00_08 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_08 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_08.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
40e0e67e84
commit
312f3d6bbd
@@ -13,7 +13,7 @@ use base qw(
|
||||
);
|
||||
|
||||
|
||||
sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' }
|
||||
sub get_xmlns { 'http://www.webserviceX.NET' }
|
||||
|
||||
__PACKAGE__->__set_name('string');
|
||||
__PACKAGE__->__set_nillable(true);
|
||||
|
||||
@@ -38,220 +38,29 @@ http://www.webservicex.net/globalweather.asmx
|
||||
my $GetCitiesByCountry = $interface->GetCitiesByCountry();
|
||||
|
||||
|
||||
=head1 Service GlobalWeather
|
||||
=head1 METHODS
|
||||
|
||||
=head2 Service information:
|
||||
=head2 GetWeather
|
||||
|
||||
Port name: GlobalWeatherSoap
|
||||
Binding: tns:GlobalWeatherSoap
|
||||
Location: http://www.webservicex.net/globalweather.asmx
|
||||
Get weather report for all major cities around the world.
|
||||
|
||||
=head2 SOAP Operations
|
||||
SYNOPSIS:
|
||||
|
||||
B<Note:>
|
||||
|
||||
Input, output and fault messages are stated as perl hash refs.
|
||||
|
||||
These are only for informational purposes - the actual implementation
|
||||
normally uses object trees, not hash refs, though the input messages
|
||||
may be passed to the respective methods as hash refs and will be
|
||||
converted to object trees automatically.
|
||||
|
||||
|
||||
=head3 GetWeather
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
$service->GetWeather({
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
=head2 GetCitiesByCountry
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
Get all major cities by country name(full / part).
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
$service->GetCitiesByCountry({
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
|
||||
|
||||
=head3 GetCitiesByCountry
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
|
||||
=head2 Service information:
|
||||
|
||||
Port name: GlobalWeatherHttpGet
|
||||
Binding: tns:GlobalWeatherHttpGet
|
||||
Location:
|
||||
|
||||
=head2 SOAP Operations
|
||||
|
||||
B<Note:>
|
||||
|
||||
Input, output and fault messages are stated as perl hash refs.
|
||||
|
||||
These are only for informational purposes - the actual implementation
|
||||
normally uses object trees, not hash refs, though the input messages
|
||||
may be passed to the respective methods as hash refs and will be
|
||||
converted to object trees automatically.
|
||||
|
||||
|
||||
=head3 GetWeather
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
|
||||
|
||||
=head3 GetCitiesByCountry
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
|
||||
=head2 Service information:
|
||||
|
||||
Port name: GlobalWeatherHttpPost
|
||||
Binding: tns:GlobalWeatherHttpPost
|
||||
Location:
|
||||
|
||||
=head2 SOAP Operations
|
||||
|
||||
B<Note:>
|
||||
|
||||
Input, output and fault messages are stated as perl hash refs.
|
||||
|
||||
These are only for informational purposes - the actual implementation
|
||||
normally uses object trees, not hash refs, though the input messages
|
||||
may be passed to the respective methods as hash refs and will be
|
||||
converted to object trees automatically.
|
||||
|
||||
|
||||
=head3 GetWeather
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
|
||||
|
||||
=head3 GetCitiesByCountry
|
||||
|
||||
B<Input Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Output Message:>
|
||||
|
||||
{
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
B<Fault:>
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
my %typemap = (
|
||||
# SOAP 1.1 fault typemap
|
||||
'Fault' => 'SOAP::WSDL::SOAP::Typelib::Fault11',
|
||||
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::TOKEN',
|
||||
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
# generated typemap
|
||||
'GetWeather' => 'MyElements::GetWeather',
|
||||
# atomic complex type (sequence)
|
||||
'GetWeather/CityName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
@@ -24,12 +32,9 @@ my %typemap = (
|
||||
'GetCitiesByCountryResponse/GetCitiesByCountryResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
# end atomic complex type (sequence)
|
||||
Fault => 'SOAP::WSDL::SOAP::Typelib::Fault11',
|
||||
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
+10
-10
@@ -1,19 +1,19 @@
|
||||
# Accessing the fortune cookie service at
|
||||
# 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;
|
||||
my $webservice = MyInterfaces::GlobalWeather->new();
|
||||
my $weather = MyInterfaces::GlobalWeather->new();
|
||||
my $result = $weather->GetWeather({ CountryName => 'Germany', CityName => 'Munich' });
|
||||
|
||||
my $result = $webservice->GetWeather({ CountryName => 'Germany', CityName => 'Munich' });
|
||||
die $result->get_faultstring()->get_value() if not ($result); # boolean comparison overloaded
|
||||
|
||||
if ($result) {
|
||||
print $result->get_GetWeatherResult()->get_value(), "\n";
|
||||
}
|
||||
else {
|
||||
print $result;
|
||||
}
|
||||
print $result->get_GetWeatherResult()->get_value() "\n";
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# 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 SOAP::WSDL in SOAP::Lite style.
|
||||
|
||||
use lib 'lib/';
|
||||
use lib '../lib';
|
||||
use SOAP::WSDL;
|
||||
use File::Basename qw(dirname);
|
||||
use File::Spec;
|
||||
my $path = File::Spec->rel2abs( dirname __FILE__);
|
||||
|
||||
my $soap = SOAP::WSDL->new();
|
||||
my $som = $soap->wsdl("file:///$path/wsdl/globalweather.xml")
|
||||
->call('GetWeather', GetWeather => { CountryName => 'Germany', CityName => 'Munich' });
|
||||
|
||||
die $som->message() if $som->fault();
|
||||
|
||||
print $som->result();
|
||||
Reference in New Issue
Block a user