00001 package ndfdXML;
00002
00003 # -- generated by SOAP::Lite (v0.60) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko --
00004 # -- generated from http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl [Tue Jun 13 14:37:18 2006]
00005
00006 my %methods = (
00007 NDFDgenByDay => {
00008 endpoint => 'http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php',
00009 soapaction => 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgenByDay',
00010 uri => 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl',
00011 parameters => [
00012 SOAP::Data->new(name => 'latitude', type => 'xsd:decimal', attr => {}),
00013 SOAP::Data->new(name => 'longitude', type => 'xsd:decimal', attr => {}),
00014 SOAP::Data->new(name => 'startDate', type => 'xsd:date', attr => {}),
00015 SOAP::Data->new(name => 'numDays', type => 'xsd:integer', attr => {}),
00016 SOAP::Data->new(name => 'format', type => 'typens:formatType', attr => {}),
00017 ],
00018 },
00019 NDFDgen => {
00020 endpoint => 'http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php',
00021 soapaction => 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgen',
00022 uri => 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl',
00023 parameters => [
00024 SOAP::Data->new(name => 'latitude', type => 'xsd:decimal', attr => {}),
00025 SOAP::Data->new(name => 'longitude', type => 'xsd:decimal', attr => {}),
00026 SOAP::Data->new(name => 'product', type => 'typens:productType', attr => {}),
00027 SOAP::Data->new(name => 'startTime', type => 'xsd:dateTime', attr => {}),
00028 SOAP::Data->new(name => 'endTime', type => 'xsd:dateTime', attr => {}),
00029 SOAP::Data->new(name => 'weatherParameters', type => 'typens:weatherParametersType', attr => {}),
00030 ],
00031 },
00032 );
00033
00034 use SOAP::Lite;
00035 use Exporter;
00036 use Carp ();
00037
00038 use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
00039 @ISA = qw(Exporter SOAP::Lite);
00040 @EXPORT_OK = (keys %methods);
00041 %EXPORT_TAGS = ('all' => [@EXPORT_OK]);
00042
00043 no strict 'refs';
00044 for my $method (@EXPORT_OK) {
00045 my %method = %{$methods{$method}};
00046 *$method = sub {
00047 my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
00048 ? ref $_[0] ? shift # OBJECT
00049 # CLASS, either get self or create new and assign to self
00050 : (shift->self || __PACKAGE__->self(__PACKAGE__->new))
00051 # function call, either get self or create new and assign to self
00052 : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));
00053 $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified") unless $self->proxy;
00054 my @templates = @{$method{parameters}};
00055 my $som = $self
00056 -> endpoint($method{endpoint})
00057 -> uri($method{uri})
00058 -> on_action(sub{qq!"$method{soapaction}"!})
00059 -> call($method => map {@templates ? shift(@templates)->value($_) : $_} @_);
00060 UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result
00061 : $som;
00062 }
00063 }
00064
00065 sub AUTOLOAD {
00066 my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
00067 return if $method eq 'DESTROY';
00068
00069 die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n";
00070 }
00071
00072 1;