From 3de318be405debb1efebdf6d94ab9096bdc7b0ed Mon Sep 17 00:00:00 2001 From: Martin Kutter Date: Wed, 3 Dec 2008 13:40:56 -0800 Subject: [PATCH] import SOAP-WSDL 2.00.06 from CPAN git-cpan-module: SOAP-WSDL git-cpan-version: 2.00.06 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.06.tar.gz --- Build.PL | 2 +- Changes | 33 +++++++- MANIFEST | 5 -- META.yml | 10 +-- Makefile.PL | 3 +- TEST_COVERAGE | 4 +- bin/wsdl2perl.pl | 32 +++++-- covered_by.pl | 20 ----- covering.pl | 58 ------------- example/leaktest/hello_wsdl.pl | 45 ---------- example/leaktest/leak.pl | 28 ------- example/leaktest/parse.pl | 16 ---- example/lib/MyElements/CountCookies.pm | 35 +++++++- .../lib/MyElements/CountCookiesResponse.pm | 50 +++++++++-- example/lib/MyElements/GetFortuneCookie.pm | 35 +++++++- .../MyElements/GetFortuneCookieResponse.pm | 50 +++++++++-- example/lib/MyElements/GetSpecificCookie.pm | 50 +++++++++-- .../MyElements/GetSpecificCookieResponse.pm | 50 +++++++++-- example/lib/MyElements/int.pm | 11 ++- example/lib/MyElements/readNodeCount.pm | 35 +++++++- .../lib/MyElements/readNodeCountResponse.pm | 50 +++++++++-- example/lib/MyElements/string.pm | 17 ++-- ...llerData_x0020_Fortune_x0020_CookieSoap.pm | 83 ++++++++++++------- .../FullerData_x0020_Fortune_x0020_Cookie.pm | 5 +- lib/SOAP/WSDL.pm | 8 +- lib/SOAP/WSDL/Client.pm | 8 +- lib/SOAP/WSDL/Client/Base.pm | 2 +- lib/SOAP/WSDL/Definitions.pm | 2 +- lib/SOAP/WSDL/Deserializer/Hash.pm | 2 +- lib/SOAP/WSDL/Deserializer/SOM.pm | 2 +- lib/SOAP/WSDL/Deserializer/XSD.pm | 2 +- lib/SOAP/WSDL/Expat/MessageParser.pm | 2 +- lib/SOAP/WSDL/Expat/MessageStreamParser.pm | 2 +- lib/SOAP/WSDL/Expat/WSDLParser.pm | 2 +- lib/SOAP/WSDL/Factory/Serializer.pm | 2 +- lib/SOAP/WSDL/Factory/Transport.pm | 2 +- .../WSDL/Generator/Template/Plugin/XSD.pm | 4 +- lib/SOAP/WSDL/Generator/Template/XSD.pm | 3 + .../Template/XSD/Interface/POD/Operation.tt | 14 +++- .../XSD/complexType/POD/complexContent.tt | 6 +- .../XSD/complexType/complexContent.tt | 6 +- .../Template/XSD/complexType/extension.tt | 17 ++-- .../WSDL/Generator/Template/XSD/element.tt | 32 +++++++ lib/SOAP/WSDL/Manual/Glossary.pod | 2 +- lib/SOAP/WSDL/Manual/Parser.pod | 2 +- lib/SOAP/WSDL/Manual/WS_I.pod | 2 +- lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm | 2 +- lib/SOAP/WSDL/Serializer/XSD.pm | 15 ++-- lib/SOAP/WSDL/Server/CGI.pm | 6 +- lib/SOAP/WSDL/Transport/HTTP.pm | 13 +-- lib/SOAP/WSDL/XSD/ComplexType.pm | 5 +- lib/SOAP/WSDL/XSD/Schema/Builtin.pm | 2 +- .../WSDL/XSD/Typelib/Builtin/anySimpleType.pm | 1 - lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm | 11 +-- lib/SOAP/WSDL/XSD/Typelib/Element.pm | 2 +- lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm | 2 +- t/006_client.t | 2 +- t/SOAP/WSDL/Client.t | 4 +- t/SOAP/WSDL/Generator/XSD.t | 17 +++- .../WSDL/Generator/XSD_nested_complextype.t | 8 +- t/SOAP/WSDL/Serializer/XSD.t | 17 ++-- t/SOAP/WSDL/Transport/HTTP.t | 20 ++++- t/SOAP/WSDL/XSD/ComplexType.t | 5 +- t/SOAP/WSDL/XSD/Typelib/ComplexType.t | 10 ++- t/acceptance/wsdl/generator_test.wsdl | 59 +++++++++++++ t/acceptance/wsdl/nested_complextype.wsdl | 48 +++++++++++ 66 files changed, 758 insertions(+), 342 deletions(-) delete mode 100644 covered_by.pl delete mode 100644 covering.pl delete mode 100644 example/leaktest/hello_wsdl.pl delete mode 100644 example/leaktest/leak.pl delete mode 100644 example/leaktest/parse.pl diff --git a/Build.PL b/Build.PL index c1b82ee..236d22f 100644 --- a/Build.PL +++ b/Build.PL @@ -5,7 +5,7 @@ $build = Module::Build->new( create_makefile_pl => 'small', dist_abstract => 'SOAP with WSDL support', dist_name => 'SOAP-WSDL', - dist_version => '2.00.05', + dist_version => '2.00.06', module_name => 'SOAP::WSDL', license => 'artistic', requires => { diff --git a/Changes b/Changes index fa25727..6d80db4 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -Release notes for SOAP::WSDL 2.00.05 +Release notes for SOAP::WSDL 2.00.06 ------- I'm proud to present a new release of SOAP::WSDL. @@ -27,7 +27,7 @@ Features: * SOAP::Lite like look and feel o Where possible, SOAP::WSDL mimics SOAP::Lite's API to allow easy migration * XML schema based class library for creating data objects - * High-performance XML parser + * High-performance SOAP Message parser * Plugin support. SOAP::WSDL can be extended through plugins in various aspects. The following plugins are supported: o Transport plugins via SOAP::WSDL::Factory::Transport @@ -36,7 +36,34 @@ Features: The following changes have been made: -2.00.05 +2.00.06 - Dec 03 2008 + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): +The numbers with # are CPAN RT IDs (http://rt.cpan.org/). + + * #40658 wsdl2perl - prefix option + The prefix option is now changed to behave more practical + * #40802 wsdl2perl problems with special url + The "fixed" attribute caused an error. + * #40650 Deserialization on inherited types + The inherited complexType variety (sequence/all/choice...) did not get + propagated to derived complexTypes. Thus, derived complexTypes which did + not add elements lost all inherited elements. + * #40108 Test failure on Cygwin + Fixes a test failure on Cygwin due to a malformed file:// URL + * #40021 charset: utf-8 + Removed duplicate charset in HTTP requests issued by + SOAP::WSDL::Transport::HTTP. Replaced the utf8 by utf-8 in HTTP requests + * #39715 Error with complexType extension base without child elements + A rather subtle error caused by a wrong init value (undef) for the list + of child elements in a complexType sequence. + * [ 2005693 ] causes error + * [ 2023797 ] type extensions not handled correctly + ComplexType objects now test their elements with ->isa, not with ref + * [ 2021755 ] Generating nested complexType extensions throws errors + +2.00.05 - Jul 13 2008 The following bugs have been fixed (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): diff --git a/MANIFEST b/MANIFEST index 6a862ff..caa1822 100644 --- a/MANIFEST +++ b/MANIFEST @@ -13,8 +13,6 @@ benchmark/XSD/strftime.pl bin/wsdl2perl.pl Build.PL Changes -covered_by.pl -covering.pl example/cgi-bin/helloworld.pl example/cgi-bin/person.pl example/fortune.pl @@ -22,9 +20,6 @@ example/genericbarcode.pl example/hello.pl example/hello_compile.pl example/hello_lite.pl -example/leaktest/hello_wsdl.pl -example/leaktest/leak.pl -example/leaktest/parse.pl example/lib/MyElements/CountCookies.pm example/lib/MyElements/CountCookiesResponse.pm example/lib/MyElements/GenerateBarCode.pm diff --git a/META.yml b/META.yml index 523a406..f0f4889 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SOAP-WSDL -version: 2.00.05 +version: 2.00.06 author: - 'Martin Kutter ' abstract: SOAP with WSDL support @@ -41,7 +41,7 @@ build_requires: provides: SOAP::WSDL: file: lib/SOAP/WSDL.pm - version: 2.00.05 + version: 2.00.06 SOAP::WSDL::Base: file: lib/SOAP/WSDL/Base.pm version: 2.00.05 @@ -161,7 +161,7 @@ provides: version: 2.00.05 SOAP::WSDL::Server::CGI: file: lib/SOAP/WSDL/Server/CGI.pm - version: 2.00.05 + version: 2.00.06 SOAP::WSDL::Server::Mod_Perl2: file: lib/SOAP/WSDL/Server/Mod_Perl2.pm version: 2.00.05 @@ -197,7 +197,7 @@ provides: version: 2.00.05 SOAP::WSDL::XSD::ComplexType: file: lib/SOAP/WSDL/XSD/ComplexType.pm - version: 2.00.05 + version: 2.00.06 SOAP::WSDL::XSD::Element: file: lib/SOAP/WSDL/XSD/Element.pm version: 2.00.05 @@ -365,7 +365,7 @@ provides: SOAP::WSDL::XSD::WhiteSpace: file: lib/SOAP/WSDL/XSD/WhiteSpace.pm version: 2.00.05 -generated_by: Module::Build version 0.2808 +generated_by: Module::Build version 0.3 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 diff --git a/Makefile.PL b/Makefile.PL index 2d25812..74907f3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,5 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.03 +# Note: this file was auto-generated by Module::Build::Compat version 0.30 +require 5.8.0; use Module::Build::Compat 0.02; Module::Build::Compat->run_build_pl(args => \@ARGV); diff --git a/TEST_COVERAGE b/TEST_COVERAGE index 8e6ad76..5c7f6c0 100644 --- a/TEST_COVERAGE +++ b/TEST_COVERAGE @@ -7,7 +7,7 @@ # don't have it, comment out the line noted below # -perl -It/lib -MTAP::Harness -MFile::Find::Rule -e ' +perl -Ilib -It/lib -MTAP::Harness -MFile::Find::Rule -e ' local $ENV{TEST_VERBOSE} = 1; TAP::Harness->new({ merge => 1, @@ -17,7 +17,7 @@ perl -It/lib -MTAP::Harness -MFile::Find::Rule -e ' ' # Devel::CoverX::Covered -covered runs +# covered runs cover -coverage="statement" -coverage=condition -coverage=subroutine -coverage="branch" diff --git a/bin/wsdl2perl.pl b/bin/wsdl2perl.pl index 44f5dac..f6db18f 100644 --- a/bin/wsdl2perl.pl +++ b/bin/wsdl2perl.pl @@ -10,13 +10,13 @@ use Term::ReadKey; my %opt = ( url => '', - prefix => undef, - attribute_prefix => 'MyAttributes', - type_prefix => 'MyTypes', - element_prefix => 'MyElements', - typemap_prefix => 'MyTypemaps', - interface_prefix => 'MyInterfaces', - server_prefix => 'MyServer', + prefix => 'My', + attribute_prefix => undef, + type_prefix => undef, + element_prefix => undef, + typemap_prefix => undef, + interface_prefix => undef, + server_prefix => undef, base_path => 'lib/', proxy => undef, generator => 'XSD', @@ -91,6 +91,20 @@ my $parser = SOAP::WSDL::Expat::WSDLParser->new({ user_agent => $lwp, }); +# resolve the default prefix options +map { + my $opt_key = $_; + if ( $opt_key =~ / (\w+) _prefix $/xms # relevant option + && !$opt{ $opt_key } # that hasn't already been explicitly set + ) + { + my $prefix_type = $1; + $opt{ $opt_key } = $opt{prefix} . # My + ucfirst( $prefix_type ) . # Typemap + ( $prefix_type eq 'server' ? '' : 's' ); # s + } +} keys %opt; + my $definitions = $parser->parse_uri( $url ); my %typemap = (); @@ -150,7 +164,9 @@ wsdl2perl.pl - create perl bindings for SOAP webservices. NAME SHORT DESCRITPION ---------------------------------------------------------------------------- - prefix p Prefix for both type and element classes. + prefix p Prefix for all generated classes. If you set "-p=Foo", + you will get "FooAttributes", "FooTypes", + "FooElements" and so on. attribute_prefix a Prefix for XML attribute classes. Default: MyAttributes type_prefix t Prefix for type classes. diff --git a/covered_by.pl b/covered_by.pl deleted file mode 100644 index dadb146..0000000 --- a/covered_by.pl +++ /dev/null @@ -1,20 +0,0 @@ -use Getopt::Long; -use Pod::Usage; -use File::Basename; -use POSIX; -use Data::Dumper; -use Path::Class; - -use Devel::CoverX::Covered::Db; -my $db = Devel::CoverX::Covered::Db->new( - dir => dir('./cover_db')->absolute(), -); - -print( "* Covered *\nVersion: " . Devel::CoverX::Covered->VERSION . "\n" ); - -my @test_file_from = $db->test_files(); -for my $test_file (sort @test_file_from) { - print "$test_file\n"; - print( "\t", join("\n\t", $db->source_files_covered_by($test_file)) , "\n\n" ); -} - diff --git a/covering.pl b/covering.pl deleted file mode 100644 index 2c3d427..0000000 --- a/covering.pl +++ /dev/null @@ -1,58 +0,0 @@ -use strict; -use Getopt::Long; -use Pod::Usage; -use File::Basename; -use POSIX; -use Data::Dumper; -use Path::Class; - -use Devel::CoverX::Covered::Db; -my $db = Devel::CoverX::Covered::Db->new( - dir => dir('./cover_db')->absolute(), -); - -sub covered_subs { - my $db = shift; - my ($covered_file_name, $calling_file_name) = @_; - - my %sub_covered; - map { push @{ $sub_covered{ $_->[1] } }, $_->[0] } $db->db->query( - qq{ - SELECT ccm.covered_row, ccm.covered_sub_name - FROM covered_calling_metric ccm, file f_covered, file f_calling - WHERE - f_covered.name = ? - AND f_calling.name = ? - AND ccm.calling_file_id = f_calling.file_id - AND ccm.covered_file_id = f_covered.file_id - AND ccm.metric_type_id = ? - GROUP BY ccm.covered_row - ORDER by ccm.covered_sub_name - }, - $covered_file_name, - $calling_file_name, - $db->get_metric_type_id("subroutine"), - )->arrays; - - return \%sub_covered; -} - -print( "* Covered *\nVersion: " . Devel::CoverX::Covered->VERSION . "\n" ); - -my @covered_files = sort { $a cmp $b } $db->covered_files(); -for my $covered_file (sort @covered_files) { - next if $covered_file =~m{\.t$}x; - print "$covered_file\n"; -# print( "\t", join("\n\t", $db->test_files_covering($covered_file)) , "\n\n" ); - - my @test_files = $db->test_files_covering($covered_file); - for my $test_file (@test_files) { - print "\t$test_file\n"; - - my $covered_subs_of_ref = covered_subs($db, $covered_file, $test_file); - for my $covered_sub (sort keys %{ $covered_subs_of_ref }) { - print "\t\t$covered_sub (line ", join(q{, }, @{ $covered_subs_of_ref->{ $covered_sub } }), ")\n"; - } - } -} - diff --git a/example/leaktest/hello_wsdl.pl b/example/leaktest/hello_wsdl.pl deleted file mode 100644 index b07fd7b..0000000 --- a/example/leaktest/hello_wsdl.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -w -use strict; -use warnings; -# use SOAP::Lite 'trace'; -use Devel::Leak; -use Devel::Cycle; -use SOAP::WSDL; -my $path = `pwd`; chomp $path; -# I have to lookup the URL from the WSDL - -use SOAP::WSDL::Factory::Transport; -SOAP::WSDL::Factory::Transport->register('http' => 'SOAP::WSDL::Transport::HTTP'); - -my $table; -my $count = Devel::Leak::NoteSV($table); - -for (1..10) { - my $soap; - $soap = SOAP::WSDL->new( - wsdl => "file://$path/../wsdl/11_helloworld.wsdl", - ); - $count = Devel::Leak::NoteSV($table); - print "SVs: $count\n"; - - $soap->wsdlinit(); - # $count = Devel::Leak::NoteSV($table); - # print "SVs: $count\n"; - # $soap->autotype(0); - -my $som = $soap->call( - "sayHello", - 'sayHello', => { 'name' => 'Your Name', - 'givenName' => 'Your given name', - } -); - -die $som->fault->{ faultstring } if ($som->fault); - -print $som->result, "\n"; - undef $som; -# $count = Devel::Leak::NoteSV($table); -# print "SVs: $count\n"; -} -#} -sleep 500; diff --git a/example/leaktest/leak.pl b/example/leaktest/leak.pl deleted file mode 100644 index 0ccb953..0000000 --- a/example/leaktest/leak.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -w -use strict; -use warnings; -# use SOAP::Lite 'trace'; -use Devel::Leak; -use SOAP::WSDL; -use SOAP::WSDL::Definitions; -use SOAP::WSDL::Binding; -my $path = `pwd`; chomp $path; -# I have to lookup the URL from the WSDL - -my $table; -my $count = Devel::Leak::NoteSV($table); -for (1..3) { -print "SVs: $count\n"; -my $definitions = SOAP::WSDL::Definitions->new({ - annotation => 'Foo', -}); - -$definitions->set_binding( - SOAP::WSDL::Binding->new({ parent => $definitions }) -); - -undef $definitions; -$count = Devel::Leak::NoteSV($table); -} -print "SVs: $count\n"; - diff --git a/example/leaktest/parse.pl b/example/leaktest/parse.pl deleted file mode 100644 index b9fc6d7..0000000 --- a/example/leaktest/parse.pl +++ /dev/null @@ -1,16 +0,0 @@ -use SOAP::WSDL::Expat::WSDLParser; -use Devel::Leak; -my $xml = `cat ../wsdl/11_helloworld.wsdl`; - -my ($table, $count); - - -for (1..5) { - $count = Devel::Leak::NoteSV($table); - print "SV: $count \n"; - my $parser = SOAP::WSDL::Expat::WSDLParser->new(); - $parser->parse_string($xml); - my $data = $parser->get_data(); - undef $parser; - undef $data; -} diff --git a/example/lib/MyElements/CountCookies.pm b/example/lib/MyElements/CountCookies.pm index 02bea8f..5954562 100644 --- a/example/lib/MyElements/CountCookies.pm +++ b/example/lib/MyElements/CountCookies.pm @@ -1,3 +1,4 @@ + package MyElements::CountCookies; use strict; use warnings; @@ -17,13 +18,30 @@ use base qw( SOAP::WSDL::XSD::Typelib::ComplexType ); +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + + + +# There's no variety - empty complexType +use Class::Std::Fast::Storable constructor => 'none'; +use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); + +__PACKAGE__->_factory(); + } # end of BLOCK + + + 1; -# __END__ =pod @@ -36,6 +54,21 @@ MyElements::CountCookies Perl data type class for the XML Schema defined element CountCookies from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/CountCookiesResponse.pm b/example/lib/MyElements/CountCookiesResponse.pm index 630551a..d05b9a6 100644 --- a/example/lib/MyElements/CountCookiesResponse.pm +++ b/example/lib/MyElements/CountCookiesResponse.pm @@ -1,3 +1,4 @@ + package MyElements::CountCookiesResponse; use strict; use warnings; @@ -16,6 +17,14 @@ use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); + +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); @@ -26,14 +35,18 @@ Class::Std::initialize(); my %CountCookiesResult_of :ATTR(:get); __PACKAGE__->_factory( - [ qw( - CountCookiesResult + [ qw( CountCookiesResult + ) ], { - CountCookiesResult => \%CountCookiesResult_of, + 'CountCookiesResult' => \%CountCookiesResult_of, }, { - CountCookiesResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + 'CountCookiesResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + }, + { + + 'CountCookiesResult' => 'CountCookiesResult', } ); @@ -44,11 +57,12 @@ __PACKAGE__->_factory( - } # end of BLOCK + + + 1; -# __END__ =pod @@ -61,6 +75,30 @@ MyElements::CountCookiesResponse Perl data type class for the XML Schema defined element CountCookiesResponse from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +=item * CountCookiesResult + + $element->set_CountCookiesResult($data); + $element->get_CountCookiesResult(); + + + + +=back + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/GetFortuneCookie.pm b/example/lib/MyElements/GetFortuneCookie.pm index 5914bc1..602543a 100644 --- a/example/lib/MyElements/GetFortuneCookie.pm +++ b/example/lib/MyElements/GetFortuneCookie.pm @@ -1,3 +1,4 @@ + package MyElements::GetFortuneCookie; use strict; use warnings; @@ -17,13 +18,30 @@ use base qw( SOAP::WSDL::XSD::Typelib::ComplexType ); +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + + + +# There's no variety - empty complexType +use Class::Std::Fast::Storable constructor => 'none'; +use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); + +__PACKAGE__->_factory(); + } # end of BLOCK + + + 1; -# __END__ =pod @@ -36,6 +54,21 @@ MyElements::GetFortuneCookie Perl data type class for the XML Schema defined element GetFortuneCookie from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/GetFortuneCookieResponse.pm b/example/lib/MyElements/GetFortuneCookieResponse.pm index 752c7f0..15d6966 100644 --- a/example/lib/MyElements/GetFortuneCookieResponse.pm +++ b/example/lib/MyElements/GetFortuneCookieResponse.pm @@ -1,3 +1,4 @@ + package MyElements::GetFortuneCookieResponse; use strict; use warnings; @@ -16,6 +17,14 @@ use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); + +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); @@ -26,14 +35,18 @@ Class::Std::initialize(); my %GetFortuneCookieResult_of :ATTR(:get); __PACKAGE__->_factory( - [ qw( - GetFortuneCookieResult + [ qw( GetFortuneCookieResult + ) ], { - GetFortuneCookieResult => \%GetFortuneCookieResult_of, + 'GetFortuneCookieResult' => \%GetFortuneCookieResult_of, }, { - GetFortuneCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + 'GetFortuneCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + }, + { + + 'GetFortuneCookieResult' => 'GetFortuneCookieResult', } ); @@ -44,11 +57,12 @@ __PACKAGE__->_factory( - } # end of BLOCK + + + 1; -# __END__ =pod @@ -61,6 +75,30 @@ MyElements::GetFortuneCookieResponse Perl data type class for the XML Schema defined element GetFortuneCookieResponse from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +=item * GetFortuneCookieResult + + $element->set_GetFortuneCookieResult($data); + $element->get_GetFortuneCookieResult(); + + + + +=back + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/GetSpecificCookie.pm b/example/lib/MyElements/GetSpecificCookie.pm index 2b32f0e..a3e713b 100644 --- a/example/lib/MyElements/GetSpecificCookie.pm +++ b/example/lib/MyElements/GetSpecificCookie.pm @@ -1,3 +1,4 @@ + package MyElements::GetSpecificCookie; use strict; use warnings; @@ -16,6 +17,14 @@ use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); + +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); @@ -26,14 +35,18 @@ Class::Std::initialize(); my %index_of :ATTR(:get); __PACKAGE__->_factory( - [ qw( - index + [ qw( index + ) ], { - index => \%index_of, + 'index' => \%index_of, }, { - index => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + 'index' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + }, + { + + 'index' => 'index', } ); @@ -44,11 +57,12 @@ __PACKAGE__->_factory( - } # end of BLOCK + + + 1; -# __END__ =pod @@ -61,6 +75,30 @@ MyElements::GetSpecificCookie Perl data type class for the XML Schema defined element GetSpecificCookie from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +=item * index + + $element->set_index($data); + $element->get_index(); + + + + +=back + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/GetSpecificCookieResponse.pm b/example/lib/MyElements/GetSpecificCookieResponse.pm index 2405b3c..8ac1754 100644 --- a/example/lib/MyElements/GetSpecificCookieResponse.pm +++ b/example/lib/MyElements/GetSpecificCookieResponse.pm @@ -1,3 +1,4 @@ + package MyElements::GetSpecificCookieResponse; use strict; use warnings; @@ -16,6 +17,14 @@ use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); + +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); @@ -26,14 +35,18 @@ Class::Std::initialize(); my %GetSpecificCookieResult_of :ATTR(:get); __PACKAGE__->_factory( - [ qw( - GetSpecificCookieResult + [ qw( GetSpecificCookieResult + ) ], { - GetSpecificCookieResult => \%GetSpecificCookieResult_of, + 'GetSpecificCookieResult' => \%GetSpecificCookieResult_of, }, { - GetSpecificCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + 'GetSpecificCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + }, + { + + 'GetSpecificCookieResult' => 'GetSpecificCookieResult', } ); @@ -44,11 +57,12 @@ __PACKAGE__->_factory( - } # end of BLOCK + + + 1; -# __END__ =pod @@ -61,6 +75,30 @@ MyElements::GetSpecificCookieResponse Perl data type class for the XML Schema defined element GetSpecificCookieResponse from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +=item * GetSpecificCookieResult + + $element->set_GetSpecificCookieResult($data); + $element->get_GetSpecificCookieResult(); + + + + +=back + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/int.pm b/example/lib/MyElements/int.pm index 74cac71..0ba56aa 100644 --- a/example/lib/MyElements/int.pm +++ b/example/lib/MyElements/int.pm @@ -1,3 +1,4 @@ + package MyElements::int; use strict; use warnings; @@ -14,14 +15,12 @@ __PACKAGE__->__set_ref(); use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Builtin::int - ); +} -} # end of BLOCK 1; -# __END__ =pod @@ -34,6 +33,12 @@ MyElements::int Perl data type class for the XML Schema defined element int from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/readNodeCount.pm b/example/lib/MyElements/readNodeCount.pm index 484bf70..541ae48 100644 --- a/example/lib/MyElements/readNodeCount.pm +++ b/example/lib/MyElements/readNodeCount.pm @@ -1,3 +1,4 @@ + package MyElements::readNodeCount; use strict; use warnings; @@ -17,13 +18,30 @@ use base qw( SOAP::WSDL::XSD::Typelib::ComplexType ); +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + + + +# There's no variety - empty complexType +use Class::Std::Fast::Storable constructor => 'none'; +use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); + +__PACKAGE__->_factory(); + } # end of BLOCK + + + 1; -# __END__ =pod @@ -36,6 +54,21 @@ MyElements::readNodeCount Perl data type class for the XML Schema defined element readNodeCount from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/readNodeCountResponse.pm b/example/lib/MyElements/readNodeCountResponse.pm index d5ffeee..cba2792 100644 --- a/example/lib/MyElements/readNodeCountResponse.pm +++ b/example/lib/MyElements/readNodeCountResponse.pm @@ -1,3 +1,4 @@ + package MyElements::readNodeCountResponse; use strict; use warnings; @@ -16,6 +17,14 @@ use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); + +our $XML_ATTRIBUTE_CLASS; +undef $XML_ATTRIBUTE_CLASS; + +sub __get_attr_class { + return $XML_ATTRIBUTE_CLASS; +} + use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); @@ -26,14 +35,18 @@ Class::Std::initialize(); my %readNodeCountResult_of :ATTR(:get); __PACKAGE__->_factory( - [ qw( - readNodeCountResult + [ qw( readNodeCountResult + ) ], { - readNodeCountResult => \%readNodeCountResult_of, + 'readNodeCountResult' => \%readNodeCountResult_of, }, { - readNodeCountResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + 'readNodeCountResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + }, + { + + 'readNodeCountResult' => 'readNodeCountResult', } ); @@ -44,11 +57,12 @@ __PACKAGE__->_factory( - } # end of BLOCK + + + 1; -# __END__ =pod @@ -61,6 +75,30 @@ MyElements::readNodeCountResponse Perl data type class for the XML Schema defined element readNodeCountResponse from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +=item * readNodeCountResult + + $element->set_readNodeCountResult($data); + $element->get_readNodeCountResult(); + + + + +=back + + =head1 METHODS =head2 new diff --git a/example/lib/MyElements/string.pm b/example/lib/MyElements/string.pm index 052f4a9..4f91d84 100644 --- a/example/lib/MyElements/string.pm +++ b/example/lib/MyElements/string.pm @@ -1,27 +1,26 @@ + package MyElements::string; use strict; use warnings; { # BLOCK to scope variables -sub get_xmlns { 'http://www.webserviceX.NET' } +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } __PACKAGE__->__set_name('string'); -__PACKAGE__->__set_nillable(true); +__PACKAGE__->__set_nillable(1); __PACKAGE__->__set_minOccurs(); __PACKAGE__->__set_maxOccurs(); __PACKAGE__->__set_ref(); use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Builtin::string - ); +} -} # end of BLOCK 1; -# __END__ =pod @@ -32,7 +31,13 @@ MyElements::string =head1 DESCRIPTION Perl data type class for the XML Schema defined element -string from the namespace http://www.webserviceX.NET. +string from the namespace http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx. + + + + + + =head1 METHODS diff --git a/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie/FullerData_x0020_Fortune_x0020_CookieSoap.pm b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie/FullerData_x0020_Fortune_x0020_CookieSoap.pm index 69a0a37..551e760 100644 --- a/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie/FullerData_x0020_Fortune_x0020_CookieSoap.pm +++ b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie/FullerData_x0020_Fortune_x0020_CookieSoap.pm @@ -13,6 +13,8 @@ sub START { $_[0]->set_proxy('http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx') if not $_[2]->{proxy}; $_[0]->set_class_resolver('MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie') if not $_[2]->{class_resolver}; + + $_[0]->set_prefix($_[2]->{use_prefix}) if exists $_[2]->{use_prefix}; } sub readNodeCount { @@ -24,10 +26,11 @@ sub readNodeCount { style => 'document', body => { - 'use' => 'literal', - namespace => '', - encodingStyle => '', - parts => [qw( MyElements::readNodeCount )], + + 'use' => 'literal', + namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', + encodingStyle => '', + parts => [qw( MyElements::readNodeCount )], }, header => { @@ -38,6 +41,7 @@ sub readNodeCount { }, $body, $header); } + sub GetFortuneCookie { my ($self, $body, $header) = @_; die "GetFortuneCookie must be called as object method (\$self is <$self>)" if not blessed($self); @@ -47,10 +51,11 @@ sub GetFortuneCookie { style => 'document', body => { - 'use' => 'literal', - namespace => '', - encodingStyle => '', - parts => [qw( MyElements::GetFortuneCookie )], + + 'use' => 'literal', + namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', + encodingStyle => '', + parts => [qw( MyElements::GetFortuneCookie )], }, header => { @@ -61,6 +66,7 @@ sub GetFortuneCookie { }, $body, $header); } + sub CountCookies { my ($self, $body, $header) = @_; die "CountCookies must be called as object method (\$self is <$self>)" if not blessed($self); @@ -70,10 +76,11 @@ sub CountCookies { style => 'document', body => { - 'use' => 'literal', - namespace => '', - encodingStyle => '', - parts => [qw( MyElements::CountCookies )], + + 'use' => 'literal', + namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', + encodingStyle => '', + parts => [qw( MyElements::CountCookies )], }, header => { @@ -84,6 +91,7 @@ sub CountCookies { }, $body, $header); } + sub GetSpecificCookie { my ($self, $body, $header) = @_; die "GetSpecificCookie must be called as object method (\$self is <$self>)" if not blessed($self); @@ -93,10 +101,11 @@ sub GetSpecificCookie { style => 'document', body => { - 'use' => 'literal', - namespace => '', - encodingStyle => '', - parts => [qw( MyElements::GetSpecificCookie )], + + 'use' => 'literal', + namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', + encodingStyle => '', + parts => [qw( MyElements::GetSpecificCookie )], }, header => { @@ -109,6 +118,7 @@ sub GetSpecificCookie { + 1; @@ -119,21 +129,20 @@ __END__ =head1 NAME - MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie::FullerData_x0020_Fortune_x0020_CookieSoap - SOAP Interface for the FullerData_x0020_Fortune_x0020_Cookie Web Service =head1 SYNOPSIS use MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie::FullerData_x0020_Fortune_x0020_CookieSoap; my $interface = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie::FullerData_x0020_Fortune_x0020_CookieSoap->new(); - + my $response; $response = $interface->readNodeCount(); $response = $interface->GetFortuneCookie(); $response = $interface->CountCookies(); $response = $interface->GetSpecificCookie(); - + =head1 DESCRIPTION @@ -168,42 +177,58 @@ of the corresponding class can be passed instead of the marked hash ref. You may pass any combination of objects, hash and list refs to these methods, as long as you meet the structure. +List items (i.e. multiple occurences) are not displayed in the synopsis. +You may generally pass a list ref of hash refs (or objects) instead of a hash +ref - this may result in invalid XML if used improperly, though. Note that +SOAP::WSDL always expects list references at maximum depth position. + +XML attributes are not displayed in this synopsis and cannot be set using +hash refs. See the respective class' documentation for additional information. + =head3 readNodeCount Display the number of nodes specified in fortune XML document - $interface->readNodeCount(,, +Returns a L object. + + $response = $interface->readNodeCount(,, ); - + =head3 GetFortuneCookie Get a random fortune cookie from the XML document - $interface->GetFortuneCookie(,, +Returns a L object. + + $response = $interface->GetFortuneCookie(,, ); - + =head3 CountCookies Count the actual number of nodes in the XML document of fortunes - $interface->CountCookies(,, +Returns a L object. + + $response = $interface->CountCookies(,, ); - + =head3 GetSpecificCookie Get a specific cookie by the XML node number - $interface->GetSpecificCookie( { +Returns a L object. + + $response = $interface->GetSpecificCookie( { index => $some_value, # int },, ); - + =head1 AUTHOR -Generated by SOAP::WSDL on Sun Dec 16 19:58:30 2007 +Generated by SOAP::WSDL on Wed Dec 3 22:05:20 2008 -=pod \ No newline at end of file +=cut diff --git a/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm index 5ac3313..8401962 100644 --- a/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm +++ b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm @@ -1,3 +1,4 @@ + package MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; use strict; use warnings; @@ -38,11 +39,13 @@ sub get_typemap { __END__ +__END__ + =pod =head1 NAME -MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; - typemap for ::FullerData_x0020_Fortune_x0020_Cookie; +MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie - typemap for FullerData_x0020_Fortune_x0020_Cookie =head1 DESCRIPTION diff --git a/lib/SOAP/WSDL.pm b/lib/SOAP/WSDL.pm index 25262d4..f94f88e 100644 --- a/lib/SOAP/WSDL.pm +++ b/lib/SOAP/WSDL.pm @@ -14,7 +14,7 @@ use Class::Std::Fast constructor => 'none'; use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; use LWP::UserAgent; -use version; our $VERSION = qv('2.00.05'); +use version; our $VERSION = qv('2.00.06'); my %no_dispatch_of :ATTR(:name); my %wsdl_of :ATTR(:name); @@ -830,9 +830,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 728 $ + $Rev: 755 $ $LastChangedBy: kutterma $ - $Id: WSDL.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $ + $Id: WSDL.pm 755 2008-12-03 21:36:54Z kutterma $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $ =cut diff --git a/lib/SOAP/WSDL/Client.pm b/lib/SOAP/WSDL/Client.pm index 58f5368..967bc16 100644 --- a/lib/SOAP/WSDL/Client.pm +++ b/lib/SOAP/WSDL/Client.pm @@ -23,7 +23,7 @@ my %endpoint_of :ATTR(:name :default<()>); my %soap_version_of :ATTR(:get :init_attr :default<1.1>); my %on_action_of :ATTR(:name :default<()>); -my %content_type_of :ATTR(:name :default); #/#trick editors +my %content_type_of :ATTR(:name :default); #/#trick editors my %serializer_of :ATTR(:name :default<()>); my %deserializer_of :ATTR(:name :default<()>); @@ -395,10 +395,10 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 728 $ + $Rev: 744 $ $LastChangedBy: kutterma $ - $Id: Client.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client.pm $ + $Id: Client.pm 744 2008-10-15 16:58:45Z kutterma $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client.pm $ =cut diff --git a/lib/SOAP/WSDL/Client/Base.pm b/lib/SOAP/WSDL/Client/Base.pm index 2b19241..bcab2d0 100644 --- a/lib/SOAP/WSDL/Client/Base.pm +++ b/lib/SOAP/WSDL/Client/Base.pm @@ -88,6 +88,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Base.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $ =cut diff --git a/lib/SOAP/WSDL/Definitions.pm b/lib/SOAP/WSDL/Definitions.pm index 8dcb26f..21d86d2 100644 --- a/lib/SOAP/WSDL/Definitions.pm +++ b/lib/SOAP/WSDL/Definitions.pm @@ -118,7 +118,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Definitions.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Definitions.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Definitions.pm $ =cut diff --git a/lib/SOAP/WSDL/Deserializer/Hash.pm b/lib/SOAP/WSDL/Deserializer/Hash.pm index 7dbc826..ad71749 100644 --- a/lib/SOAP/WSDL/Deserializer/Hash.pm +++ b/lib/SOAP/WSDL/Deserializer/Hash.pm @@ -166,6 +166,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Hash.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/Hash.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/Hash.pm $ =cut diff --git a/lib/SOAP/WSDL/Deserializer/SOM.pm b/lib/SOAP/WSDL/Deserializer/SOM.pm index 67c27a6..eb02fa4 100644 --- a/lib/SOAP/WSDL/Deserializer/SOM.pm +++ b/lib/SOAP/WSDL/Deserializer/SOM.pm @@ -143,6 +143,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: SOM.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/SOM.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/SOM.pm $ =cut diff --git a/lib/SOAP/WSDL/Deserializer/XSD.pm b/lib/SOAP/WSDL/Deserializer/XSD.pm index 84b63f3..447992d 100644 --- a/lib/SOAP/WSDL/Deserializer/XSD.pm +++ b/lib/SOAP/WSDL/Deserializer/XSD.pm @@ -102,6 +102,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: XSD.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $ =cut diff --git a/lib/SOAP/WSDL/Expat/MessageParser.pm b/lib/SOAP/WSDL/Expat/MessageParser.pm index cb798b1..1928a5e 100644 --- a/lib/SOAP/WSDL/Expat/MessageParser.pm +++ b/lib/SOAP/WSDL/Expat/MessageParser.pm @@ -329,5 +329,5 @@ the same terms as perl itself $LastChangedRevision: 728 $ $LastChangedBy: kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $ diff --git a/lib/SOAP/WSDL/Expat/MessageStreamParser.pm b/lib/SOAP/WSDL/Expat/MessageStreamParser.pm index c64c21f..cf41ca3 100644 --- a/lib/SOAP/WSDL/Expat/MessageStreamParser.pm +++ b/lib/SOAP/WSDL/Expat/MessageStreamParser.pm @@ -72,6 +72,6 @@ the same terms as perl itself $Rev: 728 $ $LastChangedBy: kutterma $ $Id: MessageStreamParser.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $ =cut diff --git a/lib/SOAP/WSDL/Expat/WSDLParser.pm b/lib/SOAP/WSDL/Expat/WSDLParser.pm index 9836114..edc1d69 100644 --- a/lib/SOAP/WSDL/Expat/WSDLParser.pm +++ b/lib/SOAP/WSDL/Expat/WSDLParser.pm @@ -342,5 +342,5 @@ the same terms as perl itself $LastChangedRevision: 728 $ $LastChangedBy: kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ diff --git a/lib/SOAP/WSDL/Factory/Serializer.pm b/lib/SOAP/WSDL/Factory/Serializer.pm index cec461b..078e65d 100644 --- a/lib/SOAP/WSDL/Factory/Serializer.pm +++ b/lib/SOAP/WSDL/Factory/Serializer.pm @@ -141,6 +141,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Serializer.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $ =cut diff --git a/lib/SOAP/WSDL/Factory/Transport.pm b/lib/SOAP/WSDL/Factory/Transport.pm index e61545d..256d166 100644 --- a/lib/SOAP/WSDL/Factory/Transport.pm +++ b/lib/SOAP/WSDL/Factory/Transport.pm @@ -246,6 +246,6 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Transport.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $ =cut diff --git a/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm b/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm index 0e95bc0..38e2501 100644 --- a/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm +++ b/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm @@ -3,7 +3,7 @@ use strict; use warnings; use Carp qw(confess); use Class::Std::Fast::Storable constructor => 'none'; - +use Scalar::Util qw(blessed); use version; our $VERSION = qv('2.00.05'); my %namespace_prefix_map_of :ATTR(:name :default<{}>); @@ -155,6 +155,8 @@ sub element_name { my $self = shift; my $element = shift; + confess "no element object" unless blessed $element; + my $name = $element->get_name(); if (! $name) { while (my $ref = $element->get_ref()) { diff --git a/lib/SOAP/WSDL/Generator/Template/XSD.pm b/lib/SOAP/WSDL/Generator/Template/XSD.pm index 1404e08..79eb16b 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD.pm +++ b/lib/SOAP/WSDL/Generator/Template/XSD.pm @@ -205,6 +205,7 @@ sub visit_XSD_Element { my $output = defined $output_of{ ident $self } ? $output_of{ ident $self } : $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($element) ); + warn "Creating element class $output \n"; $self->_process('element.tt', { element => $element } , $output); } @@ -213,6 +214,7 @@ sub visit_XSD_SimpleType { my $output = defined $output_of{ ident $self } ? $output_of{ ident $self } : $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($type) ); + warn "Creating simpleType class $output \n"; $self->_process('simpleType.tt', { simpleType => $type } , $output); } @@ -221,6 +223,7 @@ sub visit_XSD_ComplexType { my $output = defined $output_of{ ident $self } ? $output_of{ ident $self } : $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($type) ); + warn "Creating complexType class $output \n"; $self->_process('complexType.tt', { complexType => $type } , $output); } diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt index 0625189..f43c2da 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt @@ -4,6 +4,16 @@ [% type = definitions.find_portType( binding.expand( binding.get_type ) ); port_op = type.find_operation( definitions.get_targetNamespace, operation.get_name ); -port_op.get_documentation %] + port_op.get_documentation(); - $interface->[% operation.get_name %]([% INCLUDE Interface/POD/Message.tt %] ); + # for now we only document the first response part - document/literal + # doesn't allow more. + response_name = port_op.first_output.get_message(); + response_part = definitions.find_message( port_op.first_output.expand( response_name ) ).get_part(); + response_body_element = definitions.first_types.find_element( response_part.0.expand( response_part.0.get_element ) ); + response_body_class = XSD.create_xsd_name(response_body_element); +%] + +Returns a L<[% response_body_class %]|[% response_body_class %]> object. + + $response = $interface->[% operation.get_name %]([% INCLUDE Interface/POD/Message.tt %] ); diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt index cf80c48..3e2cce8 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt @@ -1,12 +1,12 @@ -[% IF (complexType.get_variety == 'restriction'); +[% IF (complexType.get_derivation == 'restriction'); INCLUDE complexType/POD/restriction.tt(complexType = complexType); -ELSIF (complexType.get_variety == 'extension'); +ELSIF (complexType.get_derivation == 'extension'); #THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet"; %] # No documentation generated for complexContent / extension yet [% ELSE; - THROW UNKNOWN, "unknown variety ${ complexType.get_variety }"; + THROW UNKNOWN, "unknown derivation ${ complexType.get_derivation }"; END; %] \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt index 5bf5baf..09935f2 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt @@ -7,6 +7,10 @@ ELSIF (complexType.get_variety == 'sequence'); ELSIF (complexType.get_variety == 'all'); INCLUDE complexType/extension.tt(complexType = complexType); ELSE; - THROW UNKNOWN, "unknown variety ${ complexType.get_variety }"; + IF (complexType.get_variety); + THROW UNKNOWN, "unknown variety ${ complexType.get_variety }"; + ELSE -%] +# empty variety +[% END; END; %] \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt index dd29a1a..3c64876 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt @@ -22,7 +22,7 @@ element_list = []; # copy complexType ref base_type = complexType; -base_name=base_type.expand( base_type.get_base ); +base_name = base_type.expand( base_type.get_base ); base_type = definitions.first_types.find_type( base_name ); # add a use base for first to setup inheritance @@ -31,13 +31,17 @@ use base qw([% XSD.create_xsd_name( base_type ) %]); [% # loop forever WHILE (1); + IF (complexType.get_variety == 'extension'); + # wrap statement in IF to avoid printing + IF (complexType.set_variety( base_type.get_variety )); END; + END; # make a copy. We don't want to modify the original list here... FOREACH element = base_type.get_element.reverse; element_list.unshift(element); END; - - # get next base type - IF (base_name=base_type.expand( base_type.get_base )); + # get next base type if there is one... + IF (base_type.get_base); + base_name=base_type.expand( base_type.get_base ); # set new base_type base_type = definitions.first_types.find_type( base_name ); ELSE; @@ -59,8 +63,11 @@ END; # set derived element list # wrap in IF; END; to prevent it getting printed -IF (complexType.set_element( element_list )); END; +IF ( complexType.set_element( element_list ) ); END; +-%] +# Variety: [% complexType.get_variety %] +[% INCLUDE complexType/variety.tt(complexType = complexType); # restore original element list diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/element.tt b/lib/SOAP/WSDL/Generator/Template/XSD/element.tt index 6a39a30..981a6ac 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/element.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/element.tt @@ -76,6 +76,38 @@ Perl data type class for the XML Schema defined element [% INCLUDE POD/annotation.tt(node = element) %] +[% IF (complexType = element.first_complexType); + IF (complexType.get_element); %] + +[% head1 %] PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + +=over + +[% FOREACH child_element = complexType.get_element -%] +=item * [% XSD.perl_var_name(XSD.element_name(child_element)) %] + + $element->set_[% XSD.perl_var_name(XSD.element_name(child_element)) %]($data); + $element->get_[% XSD.perl_var_name(XSD.element_name(child_element)) %](); + +[% IF (XSD.perl_var_name(XSD.element_name(child_element)) == child_element.get_name); %] +[% ELSE %] +Note: The name of this property has been altered, because it didn't match +perl's notion of variable/subroutine names. The altered name is used in +perl code only, XML output uses the original name: + + [% child_element.get_name %] + +[% END %] + +=back +[% END; + END; +END; -%] + + [% head1 %] METHODS [% head2 %] new diff --git a/lib/SOAP/WSDL/Manual/Glossary.pod b/lib/SOAP/WSDL/Manual/Glossary.pod index 0a88b23..b7cdefb 100644 --- a/lib/SOAP/WSDL/Manual/Glossary.pod +++ b/lib/SOAP/WSDL/Manual/Glossary.pod @@ -93,7 +93,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 391 $ $LastChangedBy: kutterma $ $Id: Glossary.pod 391 2007-11-17 21:56:13Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/Glossary.pod $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/Glossary.pod $ =cut diff --git a/lib/SOAP/WSDL/Manual/Parser.pod b/lib/SOAP/WSDL/Manual/Parser.pod index 82b8915..4bace0d 100644 --- a/lib/SOAP/WSDL/Manual/Parser.pod +++ b/lib/SOAP/WSDL/Manual/Parser.pod @@ -241,7 +241,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 391 $ $LastChangedBy: kutterma $ $Id: Parser.pod 391 2007-11-17 21:56:13Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/Parser.pod $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/Parser.pod $ =cut diff --git a/lib/SOAP/WSDL/Manual/WS_I.pod b/lib/SOAP/WSDL/Manual/WS_I.pod index cdd31f5..afc17cc 100644 --- a/lib/SOAP/WSDL/Manual/WS_I.pod +++ b/lib/SOAP/WSDL/Manual/WS_I.pod @@ -1255,7 +1255,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 562 $ $LastChangedBy: kutterma $ $Id: WS_I.pod 562 2008-02-22 20:32:17Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $ =cut diff --git a/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm b/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm index 72016a2..92bed36 100644 --- a/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm +++ b/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm @@ -104,7 +104,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Fault11.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $ =cut diff --git a/lib/SOAP/WSDL/Serializer/XSD.pm b/lib/SOAP/WSDL/Serializer/XSD.pm index 699e709..a522e89 100644 --- a/lib/SOAP/WSDL/Serializer/XSD.pm +++ b/lib/SOAP/WSDL/Serializer/XSD.pm @@ -50,7 +50,7 @@ sub serialize { } sub serialize_header { - my ($self, $name, $data, $opt) = @_; + my ($self, $method, $data, $opt) = @_; # header is optional. Leave out if there's no header data return q{} if not $data; @@ -62,8 +62,11 @@ sub serialize_header { } sub serialize_body { - my ($self, $name, $data, $opt) = @_; - $data->__set_name("$opt->{prefix}:$name") if $opt->{prefix}; + my ($self, $method, $data, $opt) = @_; + + # TODO This one wipes out the old class' XML name globally + # Fix in some more appropriate place... + $data->__set_name("$opt->{prefix}:" . $data->__get_name() ) if $opt->{prefix}; # Body is NOT optional. Serialize to empty body # if we have no data. @@ -129,10 +132,10 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 728 $ + $Rev: 735 $ $LastChangedBy: kutterma $ - $Id: XSD.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $ + $Id: XSD.pm 735 2008-08-14 07:36:54Z kutterma $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $ =cut diff --git a/lib/SOAP/WSDL/Server/CGI.pm b/lib/SOAP/WSDL/Server/CGI.pm index 56eaec2..25e4dde 100644 --- a/lib/SOAP/WSDL/Server/CGI.pm +++ b/lib/SOAP/WSDL/Server/CGI.pm @@ -2,6 +2,8 @@ package SOAP::WSDL::Server::CGI; use strict; use warnings; +use Encode; + use HTTP::Request; use HTTP::Response; use HTTP::Status; @@ -12,7 +14,7 @@ use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Server); -use version; our $VERSION = qv('2.00.05'); +use version; our $VERSION = qv('2.00.06'); # mostly copied from SOAP::Lite. Unfortunately we can't use SOAP::Lite's CGI # server directly - we would have to swap out it's base class... @@ -80,7 +82,7 @@ sub handle { else { $response = HTTP::Response->new(200); $response->header('Content-type' => 'text/xml; charset="utf-8"'); - $response->content( $response_message ); + $response->content( encode('utf8', $response_message ) ); { use bytes; $response->header('Content-length', length $response_message); diff --git a/lib/SOAP/WSDL/Transport/HTTP.pm b/lib/SOAP/WSDL/Transport/HTTP.pm index a2b937b..6adea3f 100644 --- a/lib/SOAP/WSDL/Transport/HTTP.pm +++ b/lib/SOAP/WSDL/Transport/HTTP.pm @@ -23,9 +23,10 @@ sub send_receive { $encoding = defined($encoding) ? lc($encoding) - : 'utf8'; + : 'utf-8'; - $content_type = 'text/xml' if not defined($content_type); + $content_type = "text/xml; charset=$encoding" + if not defined($content_type); # what's this all about? # unfortunately combination of LWP and Perl 5.6.1 and later has bug # in sending multibyte characters. LWP uses length() to calculate @@ -48,7 +49,7 @@ sub send_receive { my $request = HTTP::Request->new( 'POST', $endpoint, - [ 'Content-Type', "$content_type; charset=$encoding", + [ 'Content-Type', "$content_type", 'Content-Length', $bytelength, 'SOAPAction', $soap_action, ], @@ -90,10 +91,10 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 728 $ + $Rev: 744 $ $LastChangedBy: kutterma $ - $Id: HTTP.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $ + $Id: HTTP.pm 744 2008-10-15 16:58:45Z kutterma $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $ =cut diff --git a/lib/SOAP/WSDL/XSD/ComplexType.pm b/lib/SOAP/WSDL/XSD/ComplexType.pm index 763e743..3abc776 100644 --- a/lib/SOAP/WSDL/XSD/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/ComplexType.pm @@ -5,7 +5,7 @@ use Class::Std::Fast::Storable; use Scalar::Util qw(blessed); use base qw(SOAP::WSDL::Base); -use version; our $VERSION = qv('2.00.05'); +use version; our $VERSION = qv('2.00.06'); # id provided by Base # name provided by Base @@ -25,12 +25,13 @@ my %maxInclusive :ATTR(:name :default<[]>); my %attribute_of :ATTR(:name :default<()>); -my %element_of :ATTR(:name :default<()>); +my %element_of :ATTR(:name :default<[]>); my %group_of :ATTR(:name :default<()>); my %variety_of :ATTR(:name :default<()>); my %base_of :ATTR(:name :default<()>); my %itemType_of :ATTR(:name :default<()>); my %abstract_of :ATTR(:name :default<()>); +my %final_of :ATTR(:name :default<()>); my %mixed_of :ATTR(:name :default<()>); # default is false my %derivation_of :ATTR(:name :default<()>); diff --git a/lib/SOAP/WSDL/XSD/Schema/Builtin.pm b/lib/SOAP/WSDL/XSD/Schema/Builtin.pm index b2e1ef7..5d8e4e8 100644 --- a/lib/SOAP/WSDL/XSD/Schema/Builtin.pm +++ b/lib/SOAP/WSDL/XSD/Schema/Builtin.pm @@ -103,7 +103,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Builtin.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Schema/Builtin.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Schema/Builtin.pm $ =cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm index e6bdc4b..f529a1a 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm @@ -47,7 +47,6 @@ sub as_bool :BOOLIFY { return $value_of { ${ $_[0] } }; } -my $ID_GENERATOR_REF = Class::Std::Fast::ID_GENERATOR_REF(); my $OBJECT_CACHE_REF = Class::Std::Fast::OBJECT_CACHE_REF(); sub new { diff --git a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm index 43be2b2..1a018d7 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm @@ -200,8 +200,9 @@ sub _factory { ] : $is_ref eq 'HASH' ? $type->new( $_[1] ) - # neither ARRAY nor HASH - probably an object... - : ($is_ref eq $type) # of required type ? ->isa would be a better test... + # neither ARRAY nor HASH - probably an object... - + # do we need to test for it being blessed? + : blessed $_[1] && $_[1]->isa($type) # of required type ? ? $_[1] # use it : die croak "cannot use $is_ref reference as value for $name - $type required" @@ -508,10 +509,10 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 728 $ + $Rev: 731 $ $LastChangedBy: kutterma $ - $Id: ComplexType.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $ + $Id: ComplexType.pm 731 2008-07-22 21:33:07Z kutterma $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $ =cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Element.pm b/lib/SOAP/WSDL/XSD/Typelib/Element.pm index 6b4010b..d1d030d 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Element.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Element.pm @@ -180,7 +180,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: Element.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $ =cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm b/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm index 1880209..f242be6 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm @@ -135,7 +135,7 @@ Martin Kutter Emartin.kutter fen-net.deE $Rev: 728 $ $LastChangedBy: kutterma $ $Id: SimpleType.pm 728 2008-07-13 19:28:50Z kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm $ + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm $ =cut diff --git a/t/006_client.t b/t/006_client.t index 1eaf48f..95ed6f3 100644 --- a/t/006_client.t +++ b/t/006_client.t @@ -22,7 +22,7 @@ use_ok(qw/SOAP::WSDL/); my $soap; $soap = SOAP::WSDL->new( - wsdl => 'file:///' . $url .'/acceptance/wsdl/006_sax_client.wsdl', + wsdl => 'file://' . $url .'/acceptance/wsdl/006_sax_client.wsdl', outputxml => 1, # required, if not set ::SOM serializer will be loaded )->wsdlinit(); diff --git a/t/SOAP/WSDL/Client.t b/t/SOAP/WSDL/Client.t index 0847ce3..2340e09 100644 --- a/t/SOAP/WSDL/Client.t +++ b/t/SOAP/WSDL/Client.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 8; #qw(no_plan); +use Test::More tests => 9; #qw(no_plan); use_ok qw(SOAP::WSDL::Client); ok my $client = SOAP::WSDL::Client->new(); @@ -9,6 +9,8 @@ ok $client = SOAP::WSDL::Client->new({ proxy => 'http://localhost', }); +is $client->get_content_type(), 'text/xml; charset=utf-8'; + is $client->get_endpoint(), 'http://localhost'; $client->no_dispatch(1); diff --git a/t/SOAP/WSDL/Generator/XSD.t b/t/SOAP/WSDL/Generator/XSD.t index 33987ad..4ccfce2 100644 --- a/t/SOAP/WSDL/Generator/XSD.t +++ b/t/SOAP/WSDL/Generator/XSD.t @@ -1,4 +1,4 @@ -use Test::More tests => 68; +use Test::More tests => 71; use File::Basename qw(dirname); use File::Spec; use File::Path; @@ -51,6 +51,7 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({ my $code = ""; $generator->set_output(\$code); + $generator->generate_typelib(); { eval $code; @@ -227,12 +228,24 @@ is q{foo} SKIP: { eval { require Test::Pod::Content; } - or skip 'Cannot test pod content without Test::Pod::Content', 1; + or skip 'Cannot test pod content without Test::Pod::Content', 2; Test::Pod::Content::pod_section_like( 'MyTypes::testComplexTypeSequenceWithAttribute', 'attr', qr{Test \s Attribute \s good \s for \s nothing}x, 'Attribute POD'); + + Test::Pod::Content::pod_section_like( + 'MyInterfaces::testService::testPort', + 'testChoice', + qr{Returns \s a \s MyElements::testComplexTypeRestriction \s object\.}x, + 'Interface POD contains response class name'); +} + +use_ok qw(MyTypes::finalComplexType); +{ + no warnings qw(once); + ok *MyTypes::finalComplexType::get_Name, 'complexType inheritance flattened out'; } ok $typemap = MyTypemaps::testService->get_typemap(); diff --git a/t/SOAP/WSDL/Generator/XSD_nested_complextype.t b/t/SOAP/WSDL/Generator/XSD_nested_complextype.t index 41cd92a..4dba370 100644 --- a/t/SOAP/WSDL/Generator/XSD_nested_complextype.t +++ b/t/SOAP/WSDL/Generator/XSD_nested_complextype.t @@ -1,4 +1,4 @@ -use Test::More tests => 14; +use Test::More tests => 17; use File::Basename qw(dirname); use File::Spec; use File::Path; @@ -115,4 +115,10 @@ sub xml { }; } +require FooType::testAbstractGrandChild; + +ok(FooType::testAbstractGrandChild->can('get_abstractGrandChild'), 'attribute'); +ok(FooType::testAbstractGrandChild->can('get_abstractChild'), 'parent attribute'); +ok(FooType::testAbstractGrandChild->can('get_abstract'), 'grandparent attribute'); + rmtree "$path/testlib"; diff --git a/t/SOAP/WSDL/Serializer/XSD.t b/t/SOAP/WSDL/Serializer/XSD.t index 2800490..ca9baf7 100644 --- a/t/SOAP/WSDL/Serializer/XSD.t +++ b/t/SOAP/WSDL/Serializer/XSD.t @@ -17,13 +17,18 @@ like $serializer->serialize({ body => {} }), qr{} like $serializer->serialize({ body => [] }), qr{}, 'empty body'; like $serializer->serialize({ header => {}, body => [] }), qr{}, 'empty header and body'; -like $serializer->serialize({ header => {}, body => [] , options => { + +like $serializer->serialize({ + header => {}, + body => [] , + options => { namespace => { - 'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP', - 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi', - } -} }), - qr{}, 'empty header and body'; + 'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP', + 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi', + } + }}) + , qr{xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"} + , 'namespace'; like $serializer->serialize({ header => {}, body => [ undef ] }), qr{}, 'empty header and body'; diff --git a/t/SOAP/WSDL/Transport/HTTP.t b/t/SOAP/WSDL/Transport/HTTP.t index 7a13179..fde7a9e 100644 --- a/t/SOAP/WSDL/Transport/HTTP.t +++ b/t/SOAP/WSDL/Transport/HTTP.t @@ -1,4 +1,4 @@ -use Test::More tests => 7; +use Test::More tests => 8; use strict; use utf8; @@ -15,10 +15,24 @@ my $result = $transport->send_receive(envelope => 'Test', action => 'foo'); ok ! $transport->is_success(); -$result = $transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ', +$result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ', action => 'foo'); ok ! $transport->is_success(); -$result = $transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ', +$result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ', action => 'foo', content_type => 'application/xml'); ok ! $transport->is_success(); + +{ + no warnings qw(redefine); + my $request_sub =\&LWP::UserAgent::request; + *LWP::UserAgent::request = sub { + my $self = shift; + my $request = shift; + is $request->header('Content-Type'), 'text/xml; charset=utf-8'; + return HTTP::Response->new(); + }; + + $transport->send_receive(envelope => 'Test', action => 'foo'); + *LWP::UserAgent::request = $request_sub; +} \ No newline at end of file diff --git a/t/SOAP/WSDL/XSD/ComplexType.t b/t/SOAP/WSDL/XSD/ComplexType.t index e8f6e25..8cac8e8 100644 --- a/t/SOAP/WSDL/XSD/ComplexType.t +++ b/t/SOAP/WSDL/XSD/ComplexType.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 3; #qw(no_plan); +use Test::More tests => 5; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::ComplexType); @@ -11,7 +11,8 @@ eval { $obj->serialize('foo') }; like $@, qr{sorry, \s we \s just}xsm; $obj->set_targetNamespace('bar'); - +ok $obj->set_abstract(1); +ok $obj->set_final(1); eval { $obj->serialize( 'foo', 'bar', { autotype => 1 , namespace => {} } diff --git a/t/SOAP/WSDL/XSD/Typelib/ComplexType.t b/t/SOAP/WSDL/XSD/Typelib/ComplexType.t index df9b5a7..0c0d800 100644 --- a/t/SOAP/WSDL/XSD/Typelib/ComplexType.t +++ b/t/SOAP/WSDL/XSD/Typelib/ComplexType.t @@ -327,8 +327,12 @@ like $@, qr{unknown \s field \s foobar \s in \s MyType }xms; eval { $obj->set_FOO(42) }; like $@, qr{Can't \s locate \s object \s method}x, 'error on calling unknown object method'; -eval { MyType->set_FOO(42) }; -like $@, qr{Can't \s locate \s object \s method}x, 'error on calling unknown class method'; +TODO: { + local $TODO = "Identify calls to class methods"; + + eval { MyType->set_FOO(42) }; + like $@, qr{Can't \s locate \s class \s method}x, 'error on calling unknown class method'; +} ok ! MyType->can('set_FOO'), 'MyType->can("setFOO")'; @@ -338,7 +342,7 @@ eval { MyType->new({ FOO => 42 }) }; like $@, qr{unknown \s field \s}xm, 'error passing unknown field to constructor'; eval { - # catch warning - + # catch warning - local $SIG{__WARN__} = sub {}; SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD() }; diff --git a/t/acceptance/wsdl/generator_test.wsdl b/t/acceptance/wsdl/generator_test.wsdl index 81df568..4e368de 100644 --- a/t/acceptance/wsdl/generator_test.wsdl +++ b/t/acceptance/wsdl/generator_test.wsdl @@ -193,6 +193,44 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -272,6 +310,27 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm + + + + + + + + + + + + + + + + + + + + + diff --git a/t/acceptance/wsdl/nested_complextype.wsdl b/t/acceptance/wsdl/nested_complextype.wsdl index eae2032..71bced8 100644 --- a/t/acceptance/wsdl/nested_complextype.wsdl +++ b/t/acceptance/wsdl/nested_complextype.wsdl @@ -6,6 +6,7 @@ xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="urn:HelloWorld" + xmlns:tns="urn:HelloWorld" xmlns="http://schemas.xmlsoap.org/wsdl/"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +