diff --git a/Build.PL b/Build.PL index f0eaeb5..f12441c 100644 --- a/Build.PL +++ b/Build.PL @@ -2,7 +2,7 @@ use Module::Build; Module::Build->new( dist_abstract => 'SOAP with WSDL support', dist_name => 'SOAP-WSDL', - dist_version => '2.00_06', + dist_version => '2.00_07', module_name => 'SOAP::WSDL', license => 'artistic', requires => { @@ -16,26 +16,25 @@ Module::Build->new( 'XML::LibXML' => 0, 'XML::SAX::Base' => 0, 'XML::SAX::ParserFactory' => 0, - 'XML::Parser::Expat' => 0, + 'XML::Parser::Expat' => 0, }, buildrequires => { 'Benchmark' => 0, 'Cwd' => 0, 'Test::More' => 0, - 'SOAP::Lite' => 0, + 'SOAP::Lite' => 0, 'Class::Std' => 0.0.8, 'Class::Std::Storable' => 0, - 'List::Util' => 0, - 'File::Basename' => 0, - 'File::Path' => 0, - 'XML::XPath' => 0, - 'XML::Simple' => 0, - 'XML::LibXML' => 0, - 'XML::Parser::Expat' => 0, - 'XML::SAX::Base' => 0, - 'XML::SAX::ParserFactory' => 0, - 'Pod::Simple::Text' => 0, - 'XML::SAX::ParserFactory' => 0, + 'List::Util' => 0, + 'File::Basename' => 0, + 'File::Path' => 0, + 'XML::Simple' => 0, + 'XML::LibXML' => 0, + 'XML::Parser::Expat' => 0, + 'XML::SAX::Base' => 0, + 'XML::SAX::ParserFactory' => 0, + 'Pod::Simple::Text' => 0, + 'XML::SAX::ParserFactory' => 0, }, recursive_test_files => 1, )->create_build_script; diff --git a/HACKING b/HACKING index d72d385..d680422 100644 --- a/HACKING +++ b/HACKING @@ -13,12 +13,8 @@ you as co-author. The (my) current roadmap for SOAP::WSDL is: -1.2*: Bugfixes and support for more XSD variants -1.3: Bindings support - -Development of the 1.* tree has stopped - I won't get past 1.2x anymore... - -2.*: WSDL -> Perl Class factory with offline WSDL processing +1.* Development of the 1.* tree has stopped - I won't get past 1.2x anymore... +2.* WSDL -> Perl Class factory with offline WSDL processing 2.01 - WSDL support for the most common type definitions diff --git a/MANIFEST b/MANIFEST index df4092b..1b3a813 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,5 +1,29 @@ +bin/wsdl2perl.pl Build.PL CHANGES +example/fortune.pl +example/lib/MyElements/CountCookies.pm +example/lib/MyElements/CountCookiesResponse.pm +example/lib/MyElements/GetCitiesByCountry.pm +example/lib/MyElements/GetCitiesByCountryResponse.pm +example/lib/MyElements/GetFortuneCookie.pm +example/lib/MyElements/GetFortuneCookieResponse.pm +example/lib/MyElements/GetSpecificCookie.pm +example/lib/MyElements/GetSpecificCookieResponse.pm +example/lib/MyElements/GetWeather.pm +example/lib/MyElements/GetWeatherResponse.pm +example/lib/MyElements/int.pm +example/lib/MyElements/readNodeCount.pm +example/lib/MyElements/readNodeCountResponse.pm +example/lib/MyElements/string.pm +example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm +example/lib/MyInterfaces/GlobalWeather.pm +example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm +example/lib/MyTypemaps/GlobalWeather.pm +example/weather.pl +example/wsdl/FortuneCookie.xml +example/wsdl/genericbarcode.xml +example/wsdl/globalweather.xml HACKING lib/SOAP/WSDL.pm lib/SOAP/WSDL/Base.pm @@ -10,6 +34,8 @@ lib/SOAP/WSDL/Definitions.pm lib/SOAP/WSDL/Envelope.pm lib/SOAP/WSDL/Expat/MessageParser.pm lib/SOAP/WSDL/Expat/MessageStreamParser.pm +lib/SOAP/WSDL/Manual.pod +lib/SOAP/WSDL/Manual/Glossary.pod lib/SOAP/WSDL/Message.pm lib/SOAP/WSDL/Operation.pm lib/SOAP/WSDL/OpMessage.pm @@ -153,3 +179,4 @@ t/SOAP/WSDL/10_performance.t t/SOAP/WSDL/11_helloworld.NET.t t/SOAP/WSDL/12_binding.pl t/SOAP/WSDL/XSD/Typelib/Builtin/001_string.t +TODO diff --git a/META.yml b/META.yml index ee07e95..eb107ca 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SOAP-WSDL -version: 2.00_06 +version: 2.00_07 author: abstract: SOAP with WSDL support license: artistic @@ -32,7 +32,6 @@ provides: file: lib/SOAP/WSDL/Client.pm SOAP::WSDL::Client::Base: file: lib/SOAP/WSDL/Client/Base.pm - version: 0.1 SOAP::WSDL::Definitions: file: lib/SOAP/WSDL/Definitions.pm SOAP::WSDL::Envelope: diff --git a/TODO b/TODO new file mode 100644 index 0000000..e7ecf53 --- /dev/null +++ b/TODO @@ -0,0 +1,27 @@ +- remove benchmarks from tests. Create benchmark/ directory and store benchmarks in. +- SOAP::WSDL::Definitions::create creates bad interface docs. Fix it. +- add tests for SOAP::WSDL::Definitions::create + - test for correct creation + - test against web service (fullerdata.com?) +- Improve docs +- Remove SOAP::Lite dependency - for now, just support HTTP(s) via LWP::UserAgent. +- write inheritance Test for all XSD::Typelib::Builtin::* classes +- Check & probably fix simpleType support. +The WS at http://www.webservicex.net/genericbarcode.asmx?wsdl should make up a good example for simpleType +definitions. +- update all Builtin Types to new constructor BEGIN block (Class::Std unfortunately is way slow) + - DONE. +- Remove useless (but on CPAN annoying) doc from Builtin::* classes + - DONE +- add example WS scripts + - DONE. +- SOAP::WSDL::XSD::Typelib::Builtin::string does not unescape XML builtin entities on get_value() + - WONTFIX. + Entities are unescaped by XML parser. + If you want the plain value, you have to use get_value, as XML conversion is overloaded on stringification. +- Make callin WS easier: implent WS-I-based SOAP::WSDL::Client::WSI + - WONTFIX - SOAP::WSDL::Base should behave equal +- add capability to create request objects based on input part definitions to SOAP::WSDL::Client::Base + - DONE. + + diff --git a/bin/wsdl2perl.pl b/bin/wsdl2perl.pl new file mode 100644 index 0000000..3388939 --- /dev/null +++ b/bin/wsdl2perl.pl @@ -0,0 +1,134 @@ +#!/usr/bin/perl -w +use strict; +use warnings; +use Fcntl; +use IO::File; +use Pod::Usage; +use Getopt::Long; +use LWP::Simple qw(get); +use SOAP::WSDL::SAX::WSDLHandler; +use XML::LibXML; + +my %opt = ( + url => '', + prefix => undef, + type_prefix => 'MyTypes::', + element_prefix => 'MyElements::', + typemap_prefix => 'MyTypemaps::', + interface_prefix => 'MyInterfaces::', + base_path => 'lib/', +); + +GetOptions(\%opt, + qw( + url|u=s + prefix|p=s + type_prefix|t=s + element_prefix|e=s + typemap_prefix|m=s + base_path|b=s + typemap_include|mi=s + help|h + ) +); + +my $url = $ARGV[0]; + +pod2usage( -exit => 1 , verbose => 2 ) if ($opt{help}); +pod2usage( -exit => 1 , verbose => 1 ) if not ($url); + +my $handler = SOAP::WSDL::SAX::WSDLHandler->new(); +my $parser = XML::LibXML->new(); + +my $xml = get($url) or die "Could not load WSDL schema $url\n"; + +$parser->set_handler( $handler ); +$parser->parse_string( $xml ); + +my $wsdl = $handler->get_data(); + +if ($opt{typemap_include}) { + my $fh = IO::File->new($opt{typemap_include} , O_RDONLY) + or die "cannot open typemap_include file $opt{typemap_include}\n"; + $opt{custom_types} = join q{}, $fh->getlines(); + $fh->close(); + delete $opt{typemap_include}; +} + +$wsdl->create({ %opt }); + +=pod + +=head1 NAME + +wsdl2perl.pl - create perl bindings for SOAP webservices. + +=head1 SYNOPSIS + + wsdl2perl.pl -t TYPE_PREFIX -e ELEMENT_PREFIX -m TYPEMAP_PREFIX \ + -i INTERFACE_PREFIX -b BASE_DIR URL + +=head1 OPTIONS + + NAME SHORT DESCRITPION + ---------------------------------------------------------------------------- + prefix p Prefix for both type and element classes. + type_prefix t Prefix for type classes. Should end with '::' + Default: MyTypes:: + element_prefix e Prefix for element classes. Should end with '::' + Default: MyElements:: + typemap_prefix m Prefix for typemap classes. Should end with '::' + Default: MyTypemaps:: + interface_prefix i Prefix for interface classes. Should end with '::' + Default: MyInterfaces:: + base_path b Path to create classes in. + Default: ./lib + typemap_include mi File to include in typemap. + help h Show help content + +=head1 DESCRIPTION + +Generates a interface class for a SOAP web service described by a WSDL +definition. + +The following classes are created: + +=over + +=item * A interface class for every service + +Interface classes are what you will mainly deal with: They provide a method +for accessing every web service method. + +=item * A typemap for every service + +Typemaps are used internally by SOAP::WSDL for parsing the SOAP message into +object trees. + +If the WSDL definition is incomplete, you may need to add some lines to +your typemap. Especially definitions for faults are sometimes left out. + +Additional typemap content may be included by passing a file name as +typemap_include (mi) option. + +=item * A type class for every element, complexType or simpleType definition + +You may need to write additional type classes if your WSDL is incomplete. + +For writing your own lib classes, see L, +L and L. + +=back + +=head1 LICENSE + +Copyright 2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 AUTHOR + +Martin Kutter Emartin.kutter fen-net.deE + +=cut diff --git a/example/fortune.pl b/example/fortune.pl new file mode 100644 index 0000000..ee41e66 --- /dev/null +++ b/example/fortune.pl @@ -0,0 +1,33 @@ +# Accessing the fortune cookie service at +# www.fullerdata.com/FortuneCookie/FortuneCookie.asmx +# +# I have no connection to www.fullerdata.com +# +# Use this script at your own risk. + +# Run before: +# D:\Eigene Dateien\Martin\SOAP-WSDL\trunk>perl -I../lib wsdl2perl.pl "file:///D:/ +# Eigene Dateien/Martin/SOAP-WSDL/trunk/bin/FortuneCookie.xml" + +use lib 'lib/'; +use MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie; +use MyElements::GetFortuneCookie; +my $cookieService = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie->new(); + +my $cookie = $cookieService->GetFortuneCookie(); + +if ($cookie) { + print $cookie->get_GetFortuneCookieResult()->get_value, "\n"; +} +else { + print $cookie; +} + +$cookie = $cookieService->GetSpecificCookie({ index => 23 }); +if ($cookie) { + print $cookie + ->get_GetSpecificCookieResult(), "\n"; +} +else { + print $cookie; +} diff --git a/example/lib/MyElements/CountCookies.pm b/example/lib/MyElements/CountCookies.pm new file mode 100644 index 0000000..abd3e09 --- /dev/null +++ b/example/lib/MyElements/CountCookies.pm @@ -0,0 +1,71 @@ +package MyElements::CountCookies; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('CountCookies'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::CountCookies + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element CountCookies. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/CountCookiesResponse.pm b/example/lib/MyElements/CountCookiesResponse.pm new file mode 100644 index 0000000..6168dc4 --- /dev/null +++ b/example/lib/MyElements/CountCookiesResponse.pm @@ -0,0 +1,85 @@ +package MyElements::CountCookiesResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CountCookiesResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CountCookiesResult + ) ], + { + CountCookiesResult => \%CountCookiesResult_of, + + }, + { + + CountCookiesResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('CountCookiesResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::CountCookiesResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element CountCookiesResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CountCookiesResult + +=head1 Object structure + + CountCookiesResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'CountCookiesResponse'=> { + 'CountCookiesResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetCitiesByCountry.pm b/example/lib/MyElements/GetCitiesByCountry.pm new file mode 100644 index 0000000..2591842 --- /dev/null +++ b/example/lib/MyElements/GetCitiesByCountry.pm @@ -0,0 +1,85 @@ +package MyElements::GetCitiesByCountry; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CountryName_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CountryName + ) ], + { + CountryName => \%CountryName_of, + + }, + { + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetCitiesByCountry'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetCitiesByCountry + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetCitiesByCountry. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CountryName + +=head1 Object structure + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetCitiesByCountry'=> { + 'CountryName' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetCitiesByCountryResponse.pm b/example/lib/MyElements/GetCitiesByCountryResponse.pm new file mode 100644 index 0000000..64f87b8 --- /dev/null +++ b/example/lib/MyElements/GetCitiesByCountryResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetCitiesByCountryResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetCitiesByCountryResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetCitiesByCountryResult + ) ], + { + GetCitiesByCountryResult => \%GetCitiesByCountryResult_of, + + }, + { + + GetCitiesByCountryResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetCitiesByCountryResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetCitiesByCountryResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetCitiesByCountryResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetCitiesByCountryResult + +=head1 Object structure + + GetCitiesByCountryResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetCitiesByCountryResponse'=> { + 'GetCitiesByCountryResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetFortuneCookie.pm b/example/lib/MyElements/GetFortuneCookie.pm new file mode 100644 index 0000000..fd6c4d6 --- /dev/null +++ b/example/lib/MyElements/GetFortuneCookie.pm @@ -0,0 +1,71 @@ +package MyElements::GetFortuneCookie; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetFortuneCookie'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetFortuneCookie + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetFortuneCookie. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/GetFortuneCookieResponse.pm b/example/lib/MyElements/GetFortuneCookieResponse.pm new file mode 100644 index 0000000..638f15e --- /dev/null +++ b/example/lib/MyElements/GetFortuneCookieResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetFortuneCookieResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetFortuneCookieResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetFortuneCookieResult + ) ], + { + GetFortuneCookieResult => \%GetFortuneCookieResult_of, + + }, + { + + GetFortuneCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetFortuneCookieResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetFortuneCookieResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetFortuneCookieResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetFortuneCookieResult + +=head1 Object structure + + GetFortuneCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetFortuneCookieResponse'=> { + 'GetFortuneCookieResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetSpecificCookie.pm b/example/lib/MyElements/GetSpecificCookie.pm new file mode 100644 index 0000000..cd26c3d --- /dev/null +++ b/example/lib/MyElements/GetSpecificCookie.pm @@ -0,0 +1,85 @@ +package MyElements::GetSpecificCookie; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %index_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + index + ) ], + { + index => \%index_of, + + }, + { + + index => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetSpecificCookie'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetSpecificCookie + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetSpecificCookie. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + index + +=head1 Object structure + + index => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetSpecificCookie'=> { + 'index' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetSpecificCookieResponse.pm b/example/lib/MyElements/GetSpecificCookieResponse.pm new file mode 100644 index 0000000..af90c63 --- /dev/null +++ b/example/lib/MyElements/GetSpecificCookieResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetSpecificCookieResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetSpecificCookieResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetSpecificCookieResult + ) ], + { + GetSpecificCookieResult => \%GetSpecificCookieResult_of, + + }, + { + + GetSpecificCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetSpecificCookieResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetSpecificCookieResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetSpecificCookieResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetSpecificCookieResult + +=head1 Object structure + + GetSpecificCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetSpecificCookieResponse'=> { + 'GetSpecificCookieResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetWeather.pm b/example/lib/MyElements/GetWeather.pm new file mode 100644 index 0000000..e132fb9 --- /dev/null +++ b/example/lib/MyElements/GetWeather.pm @@ -0,0 +1,97 @@ +package MyElements::GetWeather; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CityName_of :ATTR(:get); + +my %CountryName_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CityName + + CountryName + ) ], + { + CityName => \%CityName_of, + CountryName => \%CountryName_of, + + }, + { + + CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetWeather'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetWeather + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetWeather. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CityName + CountryName + +=head1 Object structure + + CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetWeatherResponse.pm b/example/lib/MyElements/GetWeatherResponse.pm new file mode 100644 index 0000000..13ba765 --- /dev/null +++ b/example/lib/MyElements/GetWeatherResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetWeatherResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetWeatherResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetWeatherResult + ) ], + { + GetWeatherResult => \%GetWeatherResult_of, + + }, + { + + GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetWeatherResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetWeatherResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetWeatherResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetWeatherResult + +=head1 Object structure + + GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetWeatherResponse'=> { + 'GetWeatherResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/int.pm b/example/lib/MyElements/int.pm new file mode 100644 index 0000000..7872abf --- /dev/null +++ b/example/lib/MyElements/int.pm @@ -0,0 +1,60 @@ +package MyElements::int; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# +# definition +# + +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::Builtin::int +); + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('int'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::int + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element int. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'int' => $someValue, + + +=cut + diff --git a/example/lib/MyElements/readNodeCount.pm b/example/lib/MyElements/readNodeCount.pm new file mode 100644 index 0000000..995aa8c --- /dev/null +++ b/example/lib/MyElements/readNodeCount.pm @@ -0,0 +1,71 @@ +package MyElements::readNodeCount; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('readNodeCount'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::readNodeCount + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element readNodeCount. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/readNodeCountResponse.pm b/example/lib/MyElements/readNodeCountResponse.pm new file mode 100644 index 0000000..1ae98f3 --- /dev/null +++ b/example/lib/MyElements/readNodeCountResponse.pm @@ -0,0 +1,85 @@ +package MyElements::readNodeCountResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %readNodeCountResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + readNodeCountResult + ) ], + { + readNodeCountResult => \%readNodeCountResult_of, + + }, + { + + readNodeCountResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('readNodeCountResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::readNodeCountResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element readNodeCountResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + readNodeCountResult + +=head1 Object structure + + readNodeCountResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'readNodeCountResponse'=> { + 'readNodeCountResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/string.pm b/example/lib/MyElements/string.pm new file mode 100644 index 0000000..097e5ff --- /dev/null +++ b/example/lib/MyElements/string.pm @@ -0,0 +1,60 @@ +package MyElements::string; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# +# definition +# + +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::Builtin::string +); + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('string'); +__PACKAGE__->__set_nillable(true); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::string + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element string. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'string' => $someValue, + + +=cut + diff --git a/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm new file mode 100644 index 0000000..fcc2be9 --- /dev/null +++ b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm @@ -0,0 +1,327 @@ +package MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie; +use strict; +use warnings; +use MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; +use base 'SOAP::WSDL::Client::Base'; + +sub new { + my $class = shift; + my $arg_ref = shift || {}; + my $self = $class->SUPER::new({ + class_resolver => 'MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie', + proxy => 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx', + %{ $arg_ref } + }); + return bless $self, $class; +} + +__PACKAGE__->__create_methods( + GetSpecificCookie => [ 'MyElements::GetSpecificCookie', ], + CountCookies => [ 'MyElements::CountCookies', ], + readNodeCount => [ 'MyElements::readNodeCount', ], + GetFortuneCookie => [ 'MyElements::GetFortuneCookie', ], + +); + +1; + +__END__ + +=pod + +=head1 NAME + +MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie - SOAP interface to FullerData_x0020_Fortune_x0020_Cookie at +http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx + +=head1 SYNOPSIS + + my $interface = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie->new(); + my $CountCookies = $interface->CountCookies(); + + +=head1 Service FullerData_x0020_Fortune_x0020_Cookie + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieSoap + Binding: tns:FullerData_x0020_Fortune_x0020_CookieSoap + Location: http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx + +=head2 SOAP Operations + +B + + 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 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieHttpGet + Binding: tns:FullerData_x0020_Fortune_x0020_CookieHttpGet + Location: + +=head2 SOAP Operations + +B + + 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 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieHttpPost + Binding: tns:FullerData_x0020_Fortune_x0020_CookieHttpPost + Location: + +=head2 SOAP Operations + +B + + 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 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + + + +=cut + diff --git a/example/lib/MyInterfaces/GlobalWeather.pm b/example/lib/MyInterfaces/GlobalWeather.pm new file mode 100644 index 0000000..1b95456 --- /dev/null +++ b/example/lib/MyInterfaces/GlobalWeather.pm @@ -0,0 +1,259 @@ +package MyInterfaces::GlobalWeather; +use strict; +use warnings; +use MyTypemaps::GlobalWeather; +use base 'SOAP::WSDL::Client::Base'; + +sub new { + my $class = shift; + my $arg_ref = shift || {}; + my $self = $class->SUPER::new({ + class_resolver => 'MyTypemaps::GlobalWeather', + proxy => 'http://www.webservicex.net/globalweather.asmx', + %{ $arg_ref } + }); + return bless $self, $class; +} + +__PACKAGE__->__create_methods( + GetWeather => [ 'MyElements::GetWeather', ], + GetCitiesByCountry => [ 'MyElements::GetCitiesByCountry', ], + +); + +1; + +__END__ + +=pod + +=head1 NAME + +MyInterfaces::GlobalWeather - SOAP interface to GlobalWeather at +http://www.webservicex.net/globalweather.asmx + +=head1 SYNOPSIS + + my $interface = MyInterfaces::GlobalWeather->new(); + my $GetCitiesByCountry = $interface->GetCitiesByCountry(); + + +=head1 Service GlobalWeather + +=head2 Service information: + + Port name: GlobalWeatherSoap + Binding: tns:GlobalWeatherSoap + Location: http://www.webservicex.net/globalweather.asmx + +=head2 SOAP Operations + +B + + 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 + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + + +=head3 GetCitiesByCountry + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + +=head2 Service information: + + Port name: GlobalWeatherHttpGet + Binding: tns:GlobalWeatherHttpGet + Location: + +=head2 SOAP Operations + +B + + 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 + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + + +=head3 GetCitiesByCountry + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + +=head2 Service information: + + Port name: GlobalWeatherHttpPost + Binding: tns:GlobalWeatherHttpPost + Location: + +=head2 SOAP Operations + +B + + 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 + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + + +=head3 GetCitiesByCountry + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + { + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + } + + +B + + + + + +=cut + diff --git a/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm new file mode 100644 index 0000000..2e41302 --- /dev/null +++ b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm @@ -0,0 +1,49 @@ +package MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; +use strict; +use warnings; + +my %typemap = ( +'readNodeCount' => 'MyElements::readNodeCount', +'readNodeCountResponse' => 'MyElements::readNodeCountResponse', +# atomic complex type (sequence) +'readNodeCountResponse/readNodeCountResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetFortuneCookie' => 'MyElements::GetFortuneCookie', +'GetFortuneCookieResponse' => 'MyElements::GetFortuneCookieResponse', +# atomic complex type (sequence) +'GetFortuneCookieResponse/GetFortuneCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'CountCookies' => 'MyElements::CountCookies', +'CountCookiesResponse' => 'MyElements::CountCookiesResponse', +# atomic complex type (sequence) +'CountCookiesResponse/CountCookiesResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetSpecificCookie' => 'MyElements::GetSpecificCookie', +# atomic complex type (sequence) +'GetSpecificCookie/index' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetSpecificCookieResponse' => 'MyElements::GetSpecificCookieResponse', +# atomic complex type (sequence) +'GetSpecificCookieResponse/GetSpecificCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) + + + + +); + +sub get_class { + my $name = join '/', @{ $_[1] }; + exists $typemap{ $name } or die "Cannot resolve $name via " . __PACKAGE__; + return $typemap{ $name }; +} + +1; + +__END__ + diff --git a/example/lib/MyTypemaps/GlobalWeather.pm b/example/lib/MyTypemaps/GlobalWeather.pm new file mode 100644 index 0000000..1bb6dbf --- /dev/null +++ b/example/lib/MyTypemaps/GlobalWeather.pm @@ -0,0 +1,45 @@ +package MyTypemaps::GlobalWeather; +use strict; +use warnings; + +my %typemap = ( +'GetWeather' => 'MyElements::GetWeather', +# atomic complex type (sequence) +'GetWeather/CityName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', +'GetWeather/CountryName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetWeatherResponse' => 'MyElements::GetWeatherResponse', +# atomic complex type (sequence) +'GetWeatherResponse/GetWeatherResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetCitiesByCountry' => 'MyElements::GetCitiesByCountry', +# atomic complex type (sequence) +'GetCitiesByCountry/CountryName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetCitiesByCountryResponse' => 'MyElements::GetCitiesByCountryResponse', +# atomic complex type (sequence) +'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', + +); + +sub get_class { + my $name = join '/', @{ $_[1] }; + exists $typemap{ $name } or die "Cannot resolve $name via " . __PACKAGE__; + return $typemap{ $name }; +} + +1; + +__END__ + diff --git a/example/weather.pl b/example/weather.pl new file mode 100644 index 0000000..43650bb --- /dev/null +++ b/example/weather.pl @@ -0,0 +1,19 @@ +# Accessing the fortune cookie service at +# www.webservicex.net/GlobalWeather/GlobalWeather.asmx +# +# I have no connection to www.webservicex.net +# +# Use this script at your own risk. + +use lib 'lib/'; +use MyInterfaces::GlobalWeather; +my $webservice = MyInterfaces::GlobalWeather->new(); + +my $result = $webservice->GetWeather({ CountryName => 'Germany', CityName => 'Munich' }); + +if ($result) { + print $result->get_GetWeatherResult()->get_value(), "\n"; +} +else { + print $result; +} diff --git a/example/wsdl/FortuneCookie.xml b/example/wsdl/FortuneCookie.xml new file mode 100644 index 0000000..f35f93f --- /dev/null +++ b/example/wsdl/FortuneCookie.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple XML-based fortune cookie + + + + + + + + + + + \ No newline at end of file diff --git a/example/wsdl/genericbarcode.xml b/example/wsdl/genericbarcode.xml new file mode 100644 index 0000000..7082b70 --- /dev/null +++ b/example/wsdl/genericbarcode.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WebserviceX.NET barcode library that provides the means to create barcodes for printing and display in any internet enabled applications. This web service supports Code 128, Industrial 2 of 5, Interleaved 2 of 5, Code 2 5 Matrix, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Codabar, EAN13, EAN8, MSI, Postnet, Supp2, Supp5, UPC A, UPC E0 and UPC E1 barcode formats. This Barcodes returns byte image. It supports following image format JPEG, GIF, PNG, BMP, EMF, EXIF, ICON, MEMORY BMP, TIFF and WMF. + + + + + + + + + + + + + + + + + + + + + + + + + + Barcode generator + + + + + + + + + + + \ No newline at end of file diff --git a/example/wsdl/globalweather.xml b/example/wsdl/globalweather.xml new file mode 100644 index 0000000..e5001cc --- /dev/null +++ b/example/wsdl/globalweather.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/SOAP/WSDL/Binding.pm b/lib/SOAP/WSDL/Binding.pm index f082030..fed3546 100644 --- a/lib/SOAP/WSDL/Binding.pm +++ b/lib/SOAP/WSDL/Binding.pm @@ -2,6 +2,7 @@ package SOAP::WSDL::Binding; use strict; use warnings; use Class::Std::Storable; +use List::Util qw(first); use base qw(SOAP::WSDL::Base); my %operation_of :ATTR(:name :default<()>); @@ -22,18 +23,17 @@ sub explain { ) or die 'portType not found: ' . $self->get_type(); my $txt = <<"EOT"; - Transport: $transport_of{ ident $self } -=head2 METHODS +=head2 SOAP Operations B Input, output and fault messages are stated as perl hash refs. - These are only for informational purposes - the actual implementation - may be 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. + 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. EOT @@ -42,7 +42,7 @@ EOT my $operation_name = $operation->get_name(); my $operation_style = $operation->get_style() || q{}; - my ($port_operation) = grep { $_->get_name eq $operation_name } + my $port_operation = first { $_->get_name eq $operation_name } @{ $portType->get_operation() } or die "operation not found:" . $operation->get_name(); diff --git a/lib/SOAP/WSDL/Client.pm b/lib/SOAP/WSDL/Client.pm index 9691777..fe80bf0 100644 --- a/lib/SOAP/WSDL/Client.pm +++ b/lib/SOAP/WSDL/Client.pm @@ -42,29 +42,32 @@ BEGIN { } sub call { - my $self = shift; - my $method = shift; - my $data = ref $_[0] ? $_[0] : { @_ }; + my $self = shift; + my $method = shift; + my $data = ref $_[0] ? $_[0] : { @_ }; my $content = q{}; my ($envelope, $soap_action); - if (blessed $data + if (blessed $data && $data->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')) { $envelope = SOAP::WSDL::Envelope->serialize( $method, $data ); - # TODO replace by something derived from binding - this is just a # workaround... $soap_action = join '/', $data->get_xmlns(), $method; + } + else { + $envelope = SOAP::WSDL::Envelope->serialize( $method, $data ); + # $soap_action = $self->on_action( $method ); + } + - } - - return $envelope if $self->no_dispatch(); - + return $envelope if $self->no_dispatch(); + # warn $envelope; - # get response via transport layer - # TODO remove dependency from SOAP::Lite and use a + # get response via transport layer + # TODO remove dependency from SOAP::Lite and use a # SAX-based filter using XML::LibXML to get the # result. # Filter should have the following methods: @@ -83,7 +86,7 @@ sub call { ); # warn 'Received ' . length($response) . ' bytes of content'; - return $response if ($self->outputxml() ); + return $response if ($self->outputxml() ); $PARSER->class_resolver( $self->get_class_resolver() ); @@ -97,7 +100,7 @@ sub call { warn "could not deserialize response: $@"; } else { - return $MESSAGE_HANDLER->get_data(); + return $PARSER->get_data(); } }; diff --git a/lib/SOAP/WSDL/Client/Base.pm b/lib/SOAP/WSDL/Client/Base.pm index 9e31d52..33ce549 100644 --- a/lib/SOAP/WSDL/Client/Base.pm +++ b/lib/SOAP/WSDL/Client/Base.pm @@ -1,31 +1,48 @@ -#!/usr/bin/perl -w package SOAP::WSDL::Client::Base; - -################################################################################## -## Internetteam -## Martin Kutter -## 25.10.2006 -## -## Base client for WSDL-based SOAP access -## Automatisch gefüllt: -## $HeadURL:$ -## $Revision:$ -################################################################################ - use strict; -use Log::Log4perl; +use warnings; +use base 'SOAP::WSDL::Client'; -use Class::Accessor; +sub __create_new { + my ($package, %args_of) = @_; + + no strict qw(refs); + + *{ "$package\::new" } = sub { + my $class = shift; + my $self = $class->SUPER::new({ + proxy => $args_of{ proxy }, + class_resolver => $args_of{ class_resolver } + }); + bless $self, $class; + return $self; + } + +} -use base qw/Class::Accessor/; +sub __create_methods { + my ($package, %parts_of) = @_; + + no strict qw(refs); + + for my $method (keys %parts_of){ + *{ "$package\::$method" } = sub { + my $self = shift; + my @param = map { + my $data = shift || {}; + eval "require $_"; + $_->new( $data ); + } @{ $parts_of{ $method } }; + + $self->call( $method, @param ); + } + } -$SOAP::WSDL::Client::Base::VERSION = sprintf("0.%d", q$LastChangedRevision: 1$ =~/(\d+)/ ); +} -__PACKAGE__->mk_accessors( - qw// -); +1; -my $log = undef; # Global logger to speed up performance +__END__ =pod @@ -35,93 +52,9 @@ SOAP::WSDL::Client::Base - Base client for WSDL-based SOAP access =head1 SYNOPSIS + package MySoapClient; use SOAP::WSDL::Client::Base; - -# TODO Add more Synopsis information - -=head1 DESCRIPTION - -# TODO Add Description - -=cut - -=pod - -=head2 new - -=over - -=item SYNOPSIS - - my $obj = ->new(); - -=item DESCRIPTION - -Constructor. - -=back - -=cut - -sub new -{ - my $proto = shift; - my $class = ref $proto || $proto; - my $self = { - soapBindingStyle => 'rpc', - }; - bless $self, $class; - $self->init(@_); - return $self; -} - -sub soapBindingStyle -{ - my $self = shift; - my $style = shift; - if ($style) - { - die "Binding style must be one of rpc|document" - if (not( $style=~m/^(rpc|document)$/)); - $self->{ soapBindingStyle } = $style; - } - return $self->{ soapBindingStyle }; -} - -sub init -{ -} - -sub call -{ - my $self = shift; - my $method = shift; - my $data = shift; - my $content; -} - -1; - -__END__ - -=pod - -=head1 AUTHOR - -Martin Kutter - -=head1 COPYING - -Copyright (c) 2005 SIEMENS AG. All rights reserved. - -=head1 Repository information - - $ID: $ - - $LastChangedDate: $ - $LastChangedRevision: $ - $LastChangedBy: $ - - $HeadURL: $ + __PACKAGE__->__create_methods( qw(one two three) ); + 1; =cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/Definitions.pm b/lib/SOAP/WSDL/Definitions.pm index a4df4bc..7972ff8 100644 --- a/lib/SOAP/WSDL/Definitions.pm +++ b/lib/SOAP/WSDL/Definitions.pm @@ -72,7 +72,7 @@ sub to_typemap { map { $_->to_typemap( $opt ) } @{ $service_of{ ident $self } }; } -sub create_interface { +sub create { my $self = shift; my $opt = shift; @@ -82,12 +82,13 @@ sub create_interface { $opt->{ type_prefix } ||= $opt->{ prefix }; $opt->{ element_prefix } ||= $opt->{ prefix }; $opt->{ typemap_prefix } or die 'Required argument typemap_prefix missing'; - + mkpath $base_path; for my $service (@{ $service_of{ ident $self } }) { warn "creating typemap $opt->{ typemap_prefix }". $service->get_name() . "\n"; $self->_create_typemap({ %{ $opt }, service => $service }); + $self->_create_interface({ %{ $opt }, service => $service }); } my @schema = @{ $self->first_types()->get_schema() }; @@ -95,9 +96,110 @@ sub create_interface { warn 'creating class for '. $type->get_name() . "\n"; $type->to_class( { %$opt, wsdl => $self } ); } - 1; } +sub _create_interface { + my $self = shift; + my $opt = shift; + my $service_name = $opt->{ service }->get_name(); + my $file_name = "$opt->{ base_path }/$opt->{ interface_prefix }/$service_name.pm"; + $file_name =~s{::}{/}gms; + my $path = dirname $file_name; + my $name = basename $file_name; + my $binding = $self->find_binding( $self->_expand( $opt->{ service }->first_port()->get_binding() ) ); + my $portType = $self->find_portType( $self->_expand( $binding->get_type() ) ); + my $portType_operation_from_ref = $portType->get_operation(); + my $operation_ref = $binding->get_operation(); + $operation_ref = [ $operation_ref ] if ref $operation_ref ne 'ARRAY'; + my %operations = map { + do { + my $operation_name = $_->get_name(); + my $port_op = first { $_->get_name eq $operation_name } @{ $portType_operation_from_ref }; + my $input = $port_op->first_input()->get_message(); + my $message = $self->find_message( $self->_expand( $input ) ); + my $parts = $message->get_part; + ( $operation_name => [ + map { + do { + my $name; + ($name = $_->get_element()) + ? do { + my ($prefix, $localname) = split m{:}xms , $name; + "$opt->{ element_prefix }$localname"; + } + : ($name = $_->get_type()) + ? do { + my ($prefix, $localname) = split m{:}xms , $name; + "$opt->{ type_prefix }$localname"; + } + : () + } + } @{ $parts } + ] ); + }; + } @{ $operation_ref }; + +# use Data::Dumper; +# die Dumper \%operations; + + my $template = <<'EOT'; +package [% interface_prefix %][% service.get_name %]; +use strict; +use warnings; +use [% typemap_prefix %][% service.get_name %]; +use base 'SOAP::WSDL::Client::Base'; + +sub new { + my $class = shift; + my $arg_ref = shift || {}; + my $self = $class->SUPER::new({ + class_resolver => '[% typemap_prefix %][% service.get_name %]', + proxy => '[% service.first_port.get_location %]', + %{ $arg_ref } + }); + return bless $self, $class; +} + +__PACKAGE__->__create_methods( + [% FOREACH name = operations.keys -%] + [% name %] => [ [% FOREACH class = operations.$name %]'[% class %]', [% END %]], + [% END %] +); + +1; + +__END__ + +=pod + +=head1 NAME + +[% interface_prefix %][% service.get_name %] - SOAP interface to [% service.get_name %] at +[% service.first_port.get_location %] + +=head1 SYNOPSIS + + my $interface = [% interface_prefix %][% service.get_name %]->new(); + my $[% operations.keys.1 %] = $interface->[% operations.keys.1 %](); + + +[% service.explain({ wsdl => wsdl }) %] + +=cut + +EOT + + require Template; + my $tt = Template->new( + OUTPUT_PATH => $path, + ); + $tt->process(\$template, { %{ $opt }, operations => \%operations, binding => $binding, wsdl => $self }, $name) + or die $tt->error(); + return 1; +} + + + sub _create_typemap { my $self = shift; my $opt = shift; @@ -140,6 +242,13 @@ EOT } +sub listify { + my $data = shift; + return if not defined $data; + return [ $data ] if not ref $data; + return [ $data ] if not ref $data eq 'ARRAY'; + return $data; +} 1; diff --git a/lib/SOAP/WSDL/Manual.pod b/lib/SOAP/WSDL/Manual.pod new file mode 100644 index 0000000..0d8caad --- /dev/null +++ b/lib/SOAP/WSDL/Manual.pod @@ -0,0 +1,79 @@ +=pod + +=head1 NAME + +SOAP::WSDL::Manual - accessing WSDL based web services + +=head1 Intro: Accessing a WSDL-based web service + +=head2 Quick walk-through for the unpatient + +=over + +=item * Create WSDL bindings + + perl wsdl2perl.pl -b base_dir URL + +=item * Look what has been generated + +Check the results of the generator. There should be one +MyInterface/SERVICE_NAME.pm file per service. + +=item * Write script + + use MyInterface::SERVICE_NAME; + my $service = MyInterface::SERVICE_NAME->new(); + + my $result = $service->SERVICE_METHOD(); + die $result if not $result; + + print $result; + +C should give you some overview about +the service's interface structure. + +The results of all calls to your service object's methods (except new) +are objects based on SOAP::WSDL's XML schema implementation. + +These objects are false in boolean context, and serialize to XML when +printed. + +To access the object's properties use get_NAME / set_NAME getter/setter +methods whith NAME corresponding to the XML tag name. + +=item * Run script + +=back + +=head2 Instrumenting web services with interface classes + +SOAP::WSDL (starting from 2.00) instruments WSDL based web services with +interface classes. This means that SOAP::WSDL features a code generator +which creates one class for every web service you want to access. + +Moreover, the data types from the WSDL definitions are also wrapped into +classes and returned to the user as objects. + +To find out which class a particular XML node should be, SOAP::WSDL uses +typemaps. For every Web service, there's also a typemap created. + +=head1 SEE ALSO + +L The meaning of all these words + +L Basic client for SOAP::WSDL based interfaces + +L an interpreting WSDL based SOAP client + +=head1 LICENSE + +Copyright 2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 AUTHOR + +Martin Kutter Emartin.kutter fen-net.deE + +=cut diff --git a/lib/SOAP/WSDL/Manual/Glossary.pod b/lib/SOAP/WSDL/Manual/Glossary.pod new file mode 100644 index 0000000..c0e4bc1 --- /dev/null +++ b/lib/SOAP/WSDL/Manual/Glossary.pod @@ -0,0 +1,51 @@ +=head1 NAME + +SOAP::WSDL::Manual::Glossary - Those acronyms and stuff + +=head1 Glossary + +=head2 web service + +Web services are RPC (Remote Procedure Call) interfaces accessible via +the internet, typically via HTTP(S). + +=head2 SOAP + +SOAP (the Simple Object Access Protocol) is a specification for +defining RPC interfaces, including (but not neccessarily limited to) +web services. + +While one of the constituting aspects of a web service is its +reachability via some internet protocol, you might as well define +SOAP services accessible via postcards. + +Despite it's name, SOAP has nothing more to do with objects than +cars have with pets - SOAP messages may, but not neccessarily do +carry object, very much like your car may, but does not need to +carry your pet. + +=head2 WSDL + +WSDL (Web Service Definition Language) is a XML-based markup language +for defining web service interfaces. + +=head2 WS-I + +WS-I (Web Service Interoperability) is a industry consortium dedicated +to finding interoperability rules for web services. + +SOAP::WSDL aims to be a WS-I compliant SOAP client. + +=head1 LICENSE + +Copyright 2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 AUTHOR + +Martin Kutter Emartin.kutter fen-net.deE + +=cut + diff --git a/lib/SOAP/WSDL/Parser.pod b/lib/SOAP/WSDL/Parser.pod index 8b21461..7fb9077 100644 --- a/lib/SOAP/WSDL/Parser.pod +++ b/lib/SOAP/WSDL/Parser.pod @@ -57,18 +57,22 @@ To parse a WSDL file, use one of the following variants: =head2 SOAP messages parser All SOAP message handler use class resolvers for finding out which class -a particular XML element should be of and type libs containing these classes. +a particular XML element should be of, and type libs containing these classes. -=head3 Writing a class resolver +=head3 Creating a class resolver + +The easiest way for creating a class resolver is to run SOAP::WSDL's generator. + +See wsdl2perl.pl -The class resolver must returned a method "get_class", which is passed a list -ref of the current element's XPath (relative to Body), split by /. +The class resolver must implement a class method "get_class", which is passed +a list ref of the current element's XPath (relative to Body), split by /. This method must return a class name appropriate for a XML element. A class resolver package might look like this: - package FakeResolver; + package ClassResolver; my %class_list = ( 'EnqueueMessage' => 'Typelib::TEnqueueMessage', @@ -77,7 +81,7 @@ A class resolver package might look like this: 'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Builtin::string', ); - sub new { return bless {}, 'FakeResolver' }; + sub new { return bless {}, 'ClassResolver' }; sub get_class { my $name = join('/', @{ $_[1] }); @@ -86,59 +90,20 @@ A class resolver package might look like this: }; 1; -=head3 Writing type library classes +=head3 Creating type lib classes Every element must have a correspondent one in the type library. -Type library classes must provide the following methods: - Builtin types should be resolved as SOAP::WSDL::XSD::Builtin::* classes - -=over - -=item * new - -Constructor - -=item * add_FOO - -The add_FOO method is called for every child element of the XML node. - -Characters are regarded as child element of the last XML node. - -=back - -A tyelib class implemented as Inside-Out object using Class::Std::Storable -as base class would look like this: - - package Typelib::TEnqueueMessage; - use strict; - use Class::Std::Storable; - - my %MMessage_of :ATTR(:name :default<()>); - - sub add_MMessage { - my ($self, $value) = @_; - my $ident = ident $self; - - # we're the first value - return $MMessage_of{ $ident } = $value - if not defined $MMessage_of{ $ident }; - - # we're the second value - return $MMessage_of{ $ident } = [ - $MMessage_of{ $ident }, $value ] - if not ref $MMessage_of{ $ident } eq 'ARRAY'; - - # we're third or later - push @{ $MMessage_of{ $ident } }, $value; - return $MMessage_of{ $ident }; - } - } - 1; - -Of course one could use a method factory for these add_FOO methods - see -t/lib/Typelib/Base.pm for an example. + +Creating a type lib is easy: Just run SOAP::WSDL's generator - it will +create both a typemap and the type lib classes for a WSDL file. + +Sometimes it is nessecary to create type lib classes by hand - not all +WSDL definitions are complete. + +For writing your own lib classes, see L, +L and L. =head3 Parser implementations diff --git a/lib/SOAP/WSDL/Port.pm b/lib/SOAP/WSDL/Port.pm index 7e922fc..61164c8 100644 --- a/lib/SOAP/WSDL/Port.pm +++ b/lib/SOAP/WSDL/Port.pm @@ -28,15 +28,15 @@ sub explain { } sub to_typemap { - my $self = shift; my $opt = shift; - my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() }; - - my ($prefix, $localname) = split /:/ , $self->get_binding(); + + # skip non-SOAP ports (could be http, email or whatever...) + return q{} if not $location_of{ ident $self }; + my $binding = $opt->{ wsdl }->find_binding( - $ns_map{ $prefix }, $localname - ) or die "binding $prefix:$localname not found !"; + $opt->{wsdl}->_expand( $binding_of{ ident $self } ) + ) or die 'binding ' . $binding_of{ ident $self } .' not found!'; return $binding->to_typemap($opt); } diff --git a/lib/SOAP/WSDL/SAX/WSDLHandler.pm b/lib/SOAP/WSDL/SAX/WSDLHandler.pm index 013e97a..6b1da16 100644 --- a/lib/SOAP/WSDL/SAX/WSDLHandler.pm +++ b/lib/SOAP/WSDL/SAX/WSDLHandler.pm @@ -153,6 +153,10 @@ sub end_element { $current_of{ $ident } = pop @{ $order_of{ $ident } }; } } + +sub fatal_error { + die @_; +} sub get_data { my $self = shift; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm index 41e6db9..3b3135c 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm @@ -172,6 +172,130 @@ decimal, float and double (and derived classes) return their value in numeric context. =back + +=head1 Subclasses + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::anyType + +Base class for all types + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType + +Base class for all simple types + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::anyURI + +Type representing URIs + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::boolean + +Represents boolean data. + +Serializes to "true" or "false". + +Everything true in perl and not "false" is deserialized as true. + +Returns true/false in boolean context. + +Returns 1 / 0 in numeric context. + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::byte + +byte integer objects. + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::date + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::dateTime + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::decimal + +decimal is the base of all non-float numbers + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::double + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::duration + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::ENTITY + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::float + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::gDay + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::gMonth + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::gYear + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::hexBinary + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::ID + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::IDREF + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::IDREFS + +Derived by SOAP::WSDL::XSD::Typelib::Builtin::list. + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::int + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::integer + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::language + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::list + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::long + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::Name + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::NCName + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::normalizedString + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::NOTATION + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::QName + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::short + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::string + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::time + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::token + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong + +=head2 SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort + +=head1 CAVEATS + +=over + +=item * set_value + +In contrast to Class::Std-generated mutators (setters), set_value does +not return the last value. + +This is for speed reasons: SOAP::WSDL never needs to know the last value +when calling set_calue, but calls it over and over again... + +=back =head1 BUGS AND LIMITATIONS diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm index 3794dd8..6728edc 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm @@ -1,27 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::ENTITY; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::NCName); -1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::ENTITY - ENTITY objects - -=head1 LICENSE +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::NCName); -Copyright 2004-2007 Martin Kutter. + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +}; -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file +1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm index ffcfcad..72c9a22 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm @@ -5,22 +5,3 @@ use Class::Std::Storable; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::NCName); 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::ID - ID objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm index 50f2253..a7f06c1 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm @@ -5,22 +5,3 @@ use Class::Std::Storable; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::ID); 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::IDREF - IDREF objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm index 6c4f85c..2c4a7cd 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm @@ -7,26 +7,3 @@ use base qw( SOAP::WSDL::XSD::Typelib::Builtin::IDREF); 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::IDREFS - IDREFS objects - -=head1 DESCRIPTION - -IDREFS is a list datatype implemented by list derivation from IDREF. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm index e29b02b..0257bee 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm @@ -1,26 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::NCName; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::Name); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::Name); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::NCName - NCName objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm index 1acd5bc..8fd2ff9 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm @@ -1,26 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN - NMTOKEN objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm index 7661864..970128d 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm @@ -1,33 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS; use strict; use warnings; -use Class::Std::Storable; -use base qw( - SOAP::WSDL::XSD::Typelib::Builtin::list - SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::list + SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS - NMTOKENS objects - -=head1 DESCRIPTION - -List of NMTOKEN objects. - -Implemented by derivation via SOAP::WSDL::XSD::Typelib::Builtin::list. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm index 2cff34a..faa676e 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::NOTATION; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %length_of :ATTR(:name :default<()>); my %minLength_of :ATTR(:name :default<()>); @@ -10,36 +8,26 @@ my %maxLength_of :ATTR(:name :default<()>); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); my %whiteSpace_of :ATTR(:name :default<()>); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::NOTATION - NOTATION object - -=head1 DESCRIPTION - -NOTATION represents the NOTATION attribute type from -XML 1.0 (Second Edition) - -=head1 BUGS AND LIMITATIONS - -Facets are implemented but don't have any influence yet. - -No constraints are implemented yet. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm index 847c71a..0758aae 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm @@ -1,26 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::Name; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +}; 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::Name - Name objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm index 22bd506..41f7600 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm @@ -1,8 +1,27 @@ package SOAP::WSDL::XSD::Typelib::Builtin::QName; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} my %length_of :ATTR(:name :default<()>); my %minLength_of :ATTR(:name :default<()>); @@ -13,33 +32,3 @@ my %whiteSpace_of :ATTR(:name :default<()>); 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::QName - qualified Name object - -=head1 DESCRIPTION - -QName represents XML qualified names. The �value space� of QName -is the set of tuples {namespace name, local part}, where namespace -name is an anyURI and local part is an NCName. - -=head1 BUGS AND LIMITATIONS - -Facets are implemented but don't have any influence yet. - -No constraints are implemented yet. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm index 9dd6f16..d28d40c 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm @@ -33,38 +33,3 @@ Class::Std::initialize(); # make :BOOLIFY overloading serializable 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType - All builtin and all simpleType types inherit from anySimpleType - -=head1 CAVEATS - -=over - -=item * set_value - -In contrast to Class::Std-generated mutators (setters), set_value does -not return the last value. - -This is for speed reasons: SOAP::WSDL never needs to know the last value -when calling set_calue, but calls it over and over again... - -=back - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm index ae20483..583515f 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm @@ -27,23 +27,3 @@ Class::Std::initialize(); # make :STRINGIFY overloading serializable 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::anyType - Base of all XSD Types - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm index b380ba2..bb175f0 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm @@ -1,8 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::anyURI; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} my %length_of :ATTR(:name :default<()>); my %minLength_of :ATTR(:name :default<()>); @@ -13,36 +31,3 @@ my %whiteSpace_of :ATTR(:name :default<()>); 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::anyURI - URI object - -=head1 DESCRIPTION - -anyURI represents a Uniform Resource Identifier Reference (URI). -An anyURI value can be absolute or relative, and may have an optional -fragment identifier (i.e., it may be a URI Reference). - -=head1 BUGS AND LIMITATIONS - -Facets are implemented but don't have any influence yet. - -No constraints are implemented yet. - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm index e5c6dd5..184cee3 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm @@ -1,8 +1,28 @@ package SOAP::WSDL::XSD::Typelib::Builtin::base64Binary; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} my %length_of :ATTR(:name :default<()>); my %minLength_of :ATTR(:name :default<()>); @@ -13,23 +33,3 @@ my %whiteSpace_of :ATTR(:name :default<()>); 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::base64Binary - base64 encoded binary objects - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm index d0447c8..786e142 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm @@ -2,17 +2,16 @@ package SOAP::WSDL::XSD::Typelib::Builtin::boolean; use strict; use warnings; +my %pattern_of :ATTR(:name :default<()>); +my %whiteSpace_of :ATTR(:name :default<()>); +my %value_of :ATTR(:get :init_attr :default<()>); + + # Speed up. Class::Std::new is slow - and we don't need it's functionality... BEGIN { use Class::Std::Storable; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); -} -my %pattern_of :ATTR(:name :default<()>); -my %whiteSpace_of :ATTR(:name :default<()>); -my %value_of :ATTR(:get :init_attr :default<()>); - -{ no warnings qw(redefine); no strict qw(refs); @@ -26,7 +25,6 @@ my %value_of :ATTR(:get :init_attr :default<()>); } return $self; }; - } @@ -59,34 +57,3 @@ sub set_value { Class::Std::initialize(); # make :BOOLIFY overloading serializable 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::boolean - boolean objects - -=head1 DESCRIPTION - -Serializes to "true" or "false". - -Everything true in perl and not "false" is deserialized as true. - -Returns true/false in boolean context. - -Returns 1 / 0 in numeric context. - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm index 860270b..5dd06eb 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm @@ -1,33 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::byte; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::short); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::short); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::byte - byte integer objects - -=head1 DESCRIPTION - -Subclass of short. - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm index a975f80..cef704b 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::date; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +10,26 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} + 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::date - date objects - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm index 8811404..e065c0c 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm @@ -12,26 +12,26 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} + + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::dateTime - dateTime objects - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut - diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm index 0728b2c..ea99642 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::decimal; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %totalDigits_of :ATTR(:name :default<()>); my %fractionDigits_of :ATTR(:name :default<()>); @@ -13,6 +11,27 @@ my %maxInclusive_of :ATTR(:name :default<()>); my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +} sub as_num :NUMERIFY :BOOLIFY { return $_[0]->get_value(); @@ -21,24 +40,3 @@ sub as_num :NUMERIFY :BOOLIFY { Class::Std::initialize(); # make :NUMERIFY :BOOLIFY overloading serializable 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::decimal - decimal object, base of all non-float numbers - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm index b4fb667..49520f3 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm @@ -1,9 +1,27 @@ package SOAP::WSDL::XSD::Typelib::Builtin::double; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + sub as_num :NUMERIFY { return $_[0]->get_value(); } @@ -11,46 +29,3 @@ sub as_num :NUMERIFY { Class::Std::initialize(); # make :NUMERIFY overloading serializable 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::double - double precision float objects - -=head1 DESCRIPTION - -The double datatype corresponds to IEEE double-precision 64-bit floating point type. -The basic �value space� of double consists of the values m � 2^e, where m is an -integer whose absolute value is less than 2^53, and e is an integer between --1075 and 970, inclusive. - -In addition to the basic �value space� described above, the �value space� of double -also contains the following special values: positive and negative zero, positive and -negative infinity and not-a-number. The �order-relation� on double is: - - x < y iff y - x is positive. - -Positive zero is greater than negative zero. - -Not-a-number equals itself and is greater than all double values including -positive infinity. - -=head1 BUGS AND LIMITATIONS - -None of the "special" behaviours and values are implemented yet. - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm index a69dd5f..9929601 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm @@ -1,8 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::duration; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +30,5 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::duration - duration objects - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm index 70b56c2..94e60f5 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::float; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,6 +10,26 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; sub as_num :NUMERIFY { return $_[0]->get_value(); @@ -21,23 +39,3 @@ Class::Std::initialize(); # make :NUMERIFY overloading serializable 1; -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::float - float objects - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm index 64b2eb5..bd80f44 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::gDay; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +10,25 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); -1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::gDay - day objects - -=head1 LICENSE +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); -Copyright 2004-2007 Martin Kutter. + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file +1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm index fba7a91..0b13bc6 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::gMonth; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +10,25 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); -1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::gMonth - month objects - -=head1 LICENSE +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); -Copyright 2004-2007 Martin Kutter. + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file +1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm index 1dfbb1c..fbc4faf 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +10,25 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); -1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay - month day objects - -=head1 LICENSE +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); -Copyright 2004-2007 Martin Kutter. + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file +1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm index 721a2e4..eaa510b 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::gYear; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,25 +10,25 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); -1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::gYear - year objects - -=head1 LICENSE +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); -Copyright 2004-2007 Martin Kutter. + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file +1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm index 6eadb6f..c271c5a 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,23 +10,24 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth - year and month objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm index 8e0318a..1dee4ec 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm @@ -1,8 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::hexBinary; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +}; my %length_of :ATTR(:name :default<()>); my %minLength_of :ATTR(:name :default<()>); @@ -12,22 +30,3 @@ my %enumeration_of :ATTR(:name :default<()>); my %whiteSpace_of :ATTR(:name :default<()>); 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::hexBinary - hex encoded binary objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm index a946f9b..d05e860 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm @@ -24,26 +24,3 @@ BEGIN { }; 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::int - int objects - -=head1 DESCRIPTION - -Subclass of long. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm index 4ddf1c9..918eae9 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm @@ -31,22 +31,3 @@ sub as_num :NUMERIFY { Class::Std::initialize(); # make :NUMERIFY overloading serializable 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::integer - integer objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm index 28e0647..5cb64a4 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm @@ -1,26 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::language; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::language - language objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm index 92f8159..e67aab3 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm @@ -20,31 +20,6 @@ BEGIN { } return $self; }; - }; - 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::long - long integer objects - -=head1 DESCRIPTION - -Subclass of integer. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm index 842213e..6d49c19 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm @@ -1,30 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::egativeInteger - negative integer objects - -=head1 DESCRIPTION - -Subclass of integer. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm index 8c5cc7b..5d52233 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm @@ -1,30 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger - non negative integer objects - -=head1 DESCRIPTION - -Subclass of integer. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm index bd0ef4a..b4edbbe 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm @@ -1,30 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger - nonPositiveInteger objects - -=head1 DESCRIPTION - -Subclass of integer. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm index 90a04be..99469c7 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm @@ -1,26 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::normalizedString; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::string); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::string); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; + +}; 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::normalizedString - normalizedString objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm index e48fdd9..1aa5e03 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm @@ -1,31 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger); + + no warnings qw(redefine); + no strict qw(refs); + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger - positive integer objects - -=head1 DESCRIPTION - -Subclass of nonNegativeInteger. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm index 495871b..bd8a337 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm @@ -1,31 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::short; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::int); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::int); + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::short - short int objects - -=head1 DESCRIPTION - -Subclass of int. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm index c567e8f..2c0ec62 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm @@ -38,8 +38,7 @@ my %char2entity = ( q{>} => q{>}, q{"} => q{&qout;}, q{'} => q{'}, -); - +); sub serialize { my ($self, $opt) = @_; @@ -59,27 +58,3 @@ sub serialize { } 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::string - string objects - -=head1 DESCRIPTION - -String objects. XML entities (&, E E " ') are encoded on -serialization. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm index 0b859c6..87edec2 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm @@ -1,8 +1,6 @@ package SOAP::WSDL::XSD::Typelib::Builtin::time; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my %pattern_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -12,23 +10,24 @@ my %maxExclusive_of :ATTR(:name :default<()>); my %minInclusive_of :ATTR(:name :default<()>); my %minExclusive_of :ATTR(:name :default<()>); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} + 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::time - time objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm index 1cb8284..73b686f 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm @@ -1,26 +1,24 @@ package SOAP::WSDL::XSD::Typelib::Builtin::token; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::normalizedString); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::normalizedString); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::token - token objects - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm index f3a0ed2..eea955d 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm @@ -1,31 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort); + + no warnings qw(redefine); + no strict qw(refs); + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte - unsigned byte objects - -=head1 DESCRIPTION - -Subclass of unsignedShort. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm index eae2bc1..42c86a8 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm @@ -1,32 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt; use strict; -use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong); +use warnings; + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong); + + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt - unsigned int objects - -=head1 DESCRIPTION - -Subclass of unsignedLong. - -=head1 LICENSE - -Copyright 2004-2007 Martin Kutter. - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm index bc23420..603325d 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm @@ -1,10 +1,26 @@ package SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger); +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger); + no warnings qw(redefine); + no strict qw(refs); + + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; __END__ diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm index 957ecf1..2b7b74d 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm @@ -1,31 +1,25 @@ package SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort; use strict; use warnings; -use Class::Std::Storable; -use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt); + +# Speed up. Class::Std::new is slow - and we don't need it's functionality... +BEGIN { + use Class::Std::Storable; + use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt); + + no warnings qw(redefine); + no strict qw(refs); + # Yes, I know it's ugly - but this is the fastest constructor to write + # for Class::Std-Style inside out objects.. + *{ __PACKAGE__ . '::new' } = sub { + my $self = bless \do { my $foo } , shift; + if (@_) { + $self->set_value( $_[0]->{ value } ) + if exists $_[0]->{ value } + } + return $self; + }; +} 1; - -__END__ - -=pod - -=head1 NAME - -SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort - unsigned short integer objects - -=head1 DESCRIPTION - -Subclass of unsignedInt. - -=head1 LICENSE - -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself - -=head1 AUTHOR - -Martin Kutter Emartin.kutter fen-net.deE - -=cut \ No newline at end of file diff --git a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm index 7c747a6..4959551 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm @@ -117,8 +117,9 @@ sub _factory { # complextypes, as well as for or # . # But what about choice, group, extension ? - # - *{ "$class\::_serialize" } = sub { + # + } + *{ "$class\::_serialize" } = sub { my $ident = ident $_[0]; # my $class = ref $_[0]; @@ -154,7 +155,7 @@ sub _factory { } (@{ $ELEMENTS_FROM{ $class } }); }; - *{ "$class\::serialize" } = sub { + *{ "$class\::serialize" } = sub { my ($self, $opt) = @_; $opt ||= {}; @@ -163,9 +164,8 @@ sub _factory { if not defined $ELEMENTS_FROM{ $class } or not @{ $ELEMENTS_FROM{ $class } }; return join q{}, $self->start_tag($opt), $self->_serialize(), $self->end_tag(); - } - - } + } + } 1; diff --git a/t/009_data_classes.t b/t/009_data_classes.t index 3bc95b4..af7bb70 100644 --- a/t/009_data_classes.t +++ b/t/009_data_classes.t @@ -4,7 +4,6 @@ use Test::More tests => 5; use lib 't/lib'; use lib '../lib'; use lib 'lib'; -use Benchmark; use XML::Simple; use SOAP::WSDL::SAX::WSDLHandler; use Cwd; @@ -49,11 +48,6 @@ $soap->servicename('MessageGateway'); ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" ); ok( $soap->readable( 0 ) , "Set readable"); -timethese 100, { - 'ClassParser' => sub { $parser->parse_string( xml() ); }, - 'XML::Simple' => sub { return XMLin( xml() ) }, -}; - sub xml { q{parse_string( xml() ); my $wsdl; ok( $wsdl = $filter->get_data() , "get object tree"); -ok $wsdl->create_interface({ +$wsdl->create({ base_path => "$path/testlib", typemap_prefix => "Test::Typemap::", type_prefix => "Test::Type::", diff --git a/t/098_pod.t b/t/098_pod.t index f52784f..4fbcfb0 100644 --- a/t/098_pod.t +++ b/t/098_pod.t @@ -8,7 +8,7 @@ my $dir = cwd; if ( $dir =~ /t$/ ) { - @directories = ('../lib/'); + @directories = ('../lib/', '../bin/'); } else { diff --git a/t/SOAP/WSDL/XSD/Typelib/Builtin/001_string.t b/t/SOAP/WSDL/XSD/Typelib/Builtin/001_string.t index 69bf1e2..15fd711 100644 --- a/t/SOAP/WSDL/XSD/Typelib/Builtin/001_string.t +++ b/t/SOAP/WSDL/XSD/Typelib/Builtin/001_string.t @@ -1,4 +1,4 @@ -use Test::More tests => 3; +use Test::More tests => 4; use strict; use warnings; use lib '../lib'; @@ -9,7 +9,7 @@ my $obj; $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new(); $obj->set_value( '& "Aber" '); - +is $obj->get_value() , '& "Aber" '; is $obj, '& &qout;Aber&qout; <test>' , 'escape text on serialization';