From 51db446428b54d4e091dfa08f9a7df6eeca3b187 Mon Sep 17 00:00:00 2001 From: Martin Kutter Date: Thu, 14 Feb 2008 09:13:39 -0800 Subject: [PATCH] import SOAP-WSDL 2.00_32 from CPAN git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_32 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_32.tar.gz --- Build.PL | 2 +- Changes | 22 ++++++- MANIFEST | 5 ++ META.yml | 8 ++- lib/SOAP/WSDL.pm | 6 +- lib/SOAP/WSDL/Expat/Base.pm | 28 ++++++++- lib/SOAP/WSDL/Expat/WSDLParser.pm | 12 ++-- lib/SOAP/WSDL/Generator/Template.pm | 26 ++++++-- .../WSDL/Generator/Template/Plugin/XSD.pm | 61 +++++++++++++++++++ .../WSDL/Generator/Template/XSD/Interface.tt | 5 +- .../Generator/Template/XSD/complexType.tt | 3 +- .../Template/XSD/complexType/POD/all.tt | 2 +- .../Template/XSD/complexType/POD/choice.tt | 2 +- .../XSD/complexType/POD/complexContent.tt | 7 ++- .../XSD/complexType/POD/restriction.tt | 2 +- .../XSD/complexType/POD/simpleContent.tt | 12 ++++ .../Template/XSD/complexType/POD/structure.tt | 2 +- .../Generator/Template/XSD/complexType/all.tt | 12 ++-- .../Template/XSD/complexType/atomicTypes.tt | 2 +- .../Template/XSD/complexType/attributeSet.tt | 16 +++-- .../XSD/complexType/complexContent.tt | 2 + .../Template/XSD/complexType/contentModel.tt | 2 +- .../Template/XSD/complexType/extension.tt | 2 +- .../Template/XSD/complexType/restriction.tt | 2 +- .../Template/XSD/complexType/simpleContent.tt | 8 +++ .../WSDL/Generator/Template/XSD/element.tt | 9 +-- .../WSDL/Generator/Template/XSD/simpleType.tt | 5 +- lib/SOAP/WSDL/TypeLookup.pm | 8 +-- lib/SOAP/WSDL/XSD/ComplexType.pm | 35 +++++------ t/SOAP/WSDL/Expat/WSDLParser.t | 12 +++- t/SOAP/WSDL/Generator/XSD.t | 24 +++++--- t/SOAP/WSDL/XSD/ComplexType.t | 4 +- t/acceptance/wsdl/WSDLParser_import_loop.wsdl | 60 ++++++++++++++++++ t/acceptance/wsdl/generator_test.wsdl | 45 +++++++++----- t/acceptance/wsdl/import_loop.xsd | 24 ++++++++ t/lib/MyComplexType.pm | 5 +- 36 files changed, 376 insertions(+), 106 deletions(-) create mode 100644 lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt create mode 100644 t/acceptance/wsdl/WSDLParser_import_loop.wsdl create mode 100644 t/acceptance/wsdl/import_loop.xsd diff --git a/Build.PL b/Build.PL index 1cfa686..f9c6514 100644 --- a/Build.PL +++ b/Build.PL @@ -5,7 +5,7 @@ $build = Module::Build->new( create_makefile_pl => 'passthrough', dist_abstract => 'SOAP with WSDL support', dist_name => 'SOAP-WSDL', - dist_version => '2.00_31', + dist_version => '2.00_32', module_name => 'SOAP::WSDL', license => 'artistic', requires => { diff --git a/Changes b/Changes index 0527a7d..fc2fde8 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -Release notes for SOAP::WSDL 2.00_31 +Release notes for SOAP::WSDL 2.00_32 ------- I'm proud to present a new pre-release version of SOAP::WSDL. @@ -34,6 +34,26 @@ Features: The following changes have been made: +2.00_32 + +The following features were added (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): + +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/). + + * [ 1893147 ] Segfault on 2.0.0_31 + +The following uncategorized improvements have been made: + + * changed SOAP::WSDL::XSD::ComplexType's set_/get_flavor methods to + set_/get_variety to reflect the XML standard more closely. + get_flavor is retained for compatibility reasons. + * added initial support for complexType/simpleContent definitions. Right + now, only restriction derivations are supported. + * fixed an error in the generator_test.wsdl + 2.00_31 - Feb 11 2007 The following features were added (the numbers in square brackets are the diff --git a/MANIFEST b/MANIFEST index 73f4881..0659c65 100644 --- a/MANIFEST +++ b/MANIFEST @@ -93,6 +93,7 @@ lib/SOAP/WSDL/Factory/Generator.pm lib/SOAP/WSDL/Factory/Serializer.pm lib/SOAP/WSDL/Factory/Transport.pm lib/SOAP/WSDL/Generator/Template.pm +lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm lib/SOAP/WSDL/Generator/Template/XSD.pm lib/SOAP/WSDL/Generator/Template/XSD/_type_class.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt @@ -106,8 +107,10 @@ lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt lib/SOAP/WSDL/Generator/Template/XSD/element.tt lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt @@ -282,10 +285,12 @@ t/acceptance/wsdl/generator_test.wsdl t/acceptance/wsdl/generator_test_dot_names.wsdl t/acceptance/wsdl/generator_unsupported_test.wsdl t/acceptance/wsdl/import.xsd +t/acceptance/wsdl/import_loop.xsd t/acceptance/wsdl/message_gateway.wsdl t/acceptance/wsdl/WSDLParser-import.wsdl t/acceptance/wsdl/WSDLParser-imported.wsdl t/acceptance/wsdl/WSDLParser.wsdl +t/acceptance/wsdl/WSDLParser_import_loop.wsdl t/contributed.wsdl t/Expat/03_wsdl.t t/lib/MyComplexType.pm diff --git a/META.yml b/META.yml index 6b5b422..5c8c07f 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SOAP-WSDL -version: 2.00_31 +version: 2.00_32 author: - 'Martin Kutter ' abstract: SOAP with WSDL support @@ -31,7 +31,7 @@ requires: provides: SOAP::WSDL: file: lib/SOAP/WSDL.pm - version: 2.00_31 + version: 2.00_32 SOAP::WSDL::Base: file: lib/SOAP/WSDL/Base.pm version: 2.00_27 @@ -57,7 +57,7 @@ provides: version: 2.00_25 SOAP::WSDL::Expat::Base: file: lib/SOAP/WSDL/Expat/Base.pm - version: 2.00_27 + version: 2.00_32 SOAP::WSDL::Expat::Message2Hash: file: lib/SOAP/WSDL/Expat/Message2Hash.pm version: 2.00_27 @@ -82,6 +82,8 @@ provides: SOAP::WSDL::Generator::Template: file: lib/SOAP/WSDL/Generator/Template.pm version: 2.00_25 + SOAP::WSDL::Generator::Template::Plugin::XSD: + file: lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm SOAP::WSDL::Generator::Template::XSD: file: lib/SOAP/WSDL/Generator/Template/XSD.pm version: 2.00_27 diff --git a/lib/SOAP/WSDL.pm b/lib/SOAP/WSDL.pm index 1967f83..a34135d 100644 --- a/lib/SOAP/WSDL.pm +++ b/lib/SOAP/WSDL.pm @@ -14,7 +14,7 @@ use Class::Std::Fast; use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; use LWP::UserAgent; -our $VERSION= '2.00_31'; +our $VERSION= '2.00_32'; my %no_dispatch_of :ATTR(:name); my %wsdl_of :ATTR(:name); @@ -736,9 +736,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 524 $ + $Rev: 534 $ $LastChangedBy: kutterma $ - $Id: WSDL.pm 524 2008-02-10 23:24:43Z kutterma $ + $Id: WSDL.pm 534 2008-02-14 17:07:18Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $ =cut diff --git a/lib/SOAP/WSDL/Expat/Base.pm b/lib/SOAP/WSDL/Expat/Base.pm index 9c956a8..9713da9 100644 --- a/lib/SOAP/WSDL/Expat/Base.pm +++ b/lib/SOAP/WSDL/Expat/Base.pm @@ -6,7 +6,7 @@ use XML::Parser::Expat; # TODO: convert to Class::Std::Fast based class - hash based classes suck. -our $VERSION = '2.00_27'; +our $VERSION = '2.00_32'; sub new { my ($class, $arg_ref) = @_; @@ -15,20 +15,45 @@ sub new { $self->set_user_agent($arg_ref->{ user_agent }) if $arg_ref->{ user_agent }; + $self->{ parsed } = $arg_ref->{ parsed } if $arg_ref->{ parsed }; return $self; } +sub clone { + my $self = shift; + my $class = ref $self; + my $clone = $class->new($self); + return $clone; +} + sub set_uri { $_[0]->{ uri } = $_[1]; } sub get_uri { return $_[0]->{ uri }; } sub set_user_agent { $_[0]->{ user_agent } = $_[1]; } sub get_user_agent { return $_[0]->{ user_agent }; } +sub set_parsed { + my ($self, $uri) = @_; + $self->{ parsed }->{ $uri } = 1; + return; +} + +sub is_parsed { + my ($self, $uri) = @_; + return exists $self->{ parsed }->{ $uri }; +} sub parse_uri { my $self = shift; my $uri = shift; + + if ($self->is_parsed($uri)){ + warn "$uri already imported. Ignoring it\n"; + return; + } + $self->set_parsed($uri); + $self->set_uri( $uri ); if (not $self->{ user_agent }) { @@ -37,7 +62,6 @@ sub parse_uri { } my $response = $self->{ user_agent }->get($uri); - die $response->message() if $response->code() ne '200'; return $self->parse( $response->content() ); } diff --git a/lib/SOAP/WSDL/Expat/WSDLParser.pm b/lib/SOAP/WSDL/Expat/WSDLParser.pm index 2eef7ed..cdf76d7 100644 --- a/lib/SOAP/WSDL/Expat/WSDLParser.pm +++ b/lib/SOAP/WSDL/Expat/WSDLParser.pm @@ -5,10 +5,12 @@ use Carp; use SOAP::WSDL::TypeLookup; use base qw(SOAP::WSDL::Expat::Base); -our $VERSION = q{2.00_31}; +our $VERSION = q{2.00_32}; sub _import_children { my ($self, $name, $imported, $importer, $import_namespace) = @_; + return if not $imported; + my $targetNamespace = $importer->get_targetNamespace(); my $push_method = "push_$name"; my $get_method = "get_$name"; @@ -32,7 +34,7 @@ sub _import_children { sub xml_schema_import { my $self = shift; my $schema = shift; - my $parser = ref($self)->new(); + my $parser = $self->clone(); my %attr_of = @_; my $import_namespace = $attr_of{ namespace }; my $uri = URI->new_abs($attr_of{schemaLocation}, $self->get_uri() ); @@ -46,7 +48,7 @@ sub xml_schema_import { sub wsdl_import { my $self = shift; my $definitions = shift; - my $parser = ref($self)->new(); + my $parser = $self->clone(); my %attr_of = @_; my $import_namespace = $attr_of{ namespace }; my $uri = URI->new_abs($attr_of{location}, $self->get_uri() ); @@ -243,8 +245,8 @@ the same terms as perl itself $Id: $ - $LastChangedDate: 2008-02-11 00:14:27 +0100 (Mo, 11 Feb 2008) $ - $LastChangedRevision: 522 $ + $LastChangedDate: 2008-02-14 18:07:18 +0100 (Do, 14 Feb 2008) $ + $LastChangedRevision: 534 $ $LastChangedBy: kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ diff --git a/lib/SOAP/WSDL/Generator/Template.pm b/lib/SOAP/WSDL/Generator/Template.pm index d0e30bb..006389d 100644 --- a/lib/SOAP/WSDL/Generator/Template.pm +++ b/lib/SOAP/WSDL/Generator/Template.pm @@ -25,17 +25,33 @@ sub _process :PROTECTED { my ($self, $template, $arg_ref, $output) = @_; my $ident = ident $self; - $tt_of{$ident} = Template->new( + # always create a new Template object to + # force re-loading of plugins. + my $tt = Template->new( DEBUG => 1, EVAL_PERL => $EVAL_PERL_of{ $ident }, RECURSION => $RECURSION_of{ $ident }, INCLUDE_PATH => $INCLUDE_PATH_of{ $ident }, OUTPUT_PATH => $OUTPUT_PATH_of{ $ident }, - ) - if (not $tt_of{ $ident }); + PLUGIN_BASE => 'SOAP::WSDL::Generator::Template::Plugin', + ); - $tt_of{ $ident }->process( $template, + $tt->process( $template, { + context => { + namespace_prefix_map => { + 'http://www.w3.org/2001/XMLSchema' => 'SOAP::WSDL::XSD::Typelib::Builtin', + }, + namespace_map => { + }, + prefix => { + interface => $self->get_interface_prefix, + element => $self->get_element_prefix, + server => $self->get_server_prefix, + type => $self->get_type_prefix, + typemap => $self->get_typemap_prefix, + } + }, definitions => $self->get_definitions, interface_prefix => $self->get_interface_prefix, server_prefix => $self->get_server_prefix, @@ -47,7 +63,7 @@ sub _process :PROTECTED { %{ $arg_ref } }, $output) - or die $INCLUDE_PATH_of{ $ident }, '\\', $template, ' ', $tt_of{ $ident }->error(); + or die $INCLUDE_PATH_of{ $ident }, '\\', $template, ' ', $tt->error(); } 1; \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm b/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm new file mode 100644 index 0000000..dcfbbcc --- /dev/null +++ b/lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm @@ -0,0 +1,61 @@ +package SOAP::WSDL::Generator::Template::Plugin::XSD; +use strict; +use warnings; + +use Class::Std::Fast::Storable constructor => 'none'; + +my %namespace_prefix_map_of :ATTR(:name :default<{}>); +my %namespace_map_of :ATTR(:name :default<{}>); +my %prefix_of :ATTR(:name :default<()>); + +# create a singleton +sub load { # called as MyPlugin->load($context) + my ($class, $context, @arg_from) = @_; + my $stash = $context->stash(); + my $self = bless \do { my $o = Class::Std::Fast::ID() }, $class; + use Data::Dumper; + # die Data::Dumper::Dumper $stash->{ context }; + $self->set_namespace_map( $stash->{ context }->{ namespace_map }); + $self->set_namespace_prefix_map( $stash->{ context }->{ namespace_prefix_map }); + $self->set_prefix( $stash->{ context }->{ prefix }); + return $self; # returns 'MyPlugin' +} + +sub new { + return shift; +} + +sub _get_prefix { + my ($self, $type, $namespace) = @_; + return $namespace_prefix_map_of{ $$self }->{ $namespace } + || ( ($namespace_map_of{ $$self }->{ $namespace }) + ? join ('::', $prefix_of{ $$self }->{ $type }, $namespace_map_of{ $$self }->{ $namespace }) + : $prefix_of{ $$self }->{ $type } + ) + || $prefix_of{ $$self }->{ $type }; +} + +sub get_element_prefix { + shift->_get_prefix( 'element', shift ); +} + +sub get_interface_prefix { + shift->_get_prefix( 'interface', shift ); +} + +sub get_server_prefix { + shift->_get_prefix( 'server', shift ); +} + +sub get_type_prefix { + # die "WIX"; + shift->_get_prefix( 'type', shift ); +} + +sub get_typemap_prefix { + shift->_get_prefix( 'typemap', shift ); +} + +sub error {} +1; + diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt index 745c349..c5334fa 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt @@ -1,3 +1,4 @@ +[% USE XSD -%] [% interface_name = interface_prefix _ '::' _ service.get_name.replace('\.', '::') _ '::' _ port.get_name.replace('^.+\.',''); @@ -48,12 +49,12 @@ __END__ use [% interface_name %]; my $interface = [% interface_name %]->new(); - + my $response; [% FOREACH operation = binding.get_operation; %] $response = $interface->[% operation.get_name %](); [% END %] - + [% head1 %] DESCRIPTION diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt index e4805a2..0c07ada 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt @@ -1,3 +1,4 @@ +[% USE XSD(context) -%] package [% type_prefix %]::[% complexType.get_name.replace('\.','::').replace('-','_') %]; use strict; use warnings; @@ -6,8 +7,6 @@ use warnings; # Don't include any perl source here - there may be sub-packages... #-%] -package [% type_prefix %]::[% complexType.get_name.replace('\.','::').replace('-','_') %]::_ATTR; -use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); [% INCLUDE complexType/attributeSet.tt %] 1; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt index dca83c9..4ee4c7c 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt @@ -1,5 +1,5 @@ [% indent %]{ -[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %] +[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %] [%- indent = indent _ ' '; FOREACH element = complexType.get_element %] [% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%] diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt index 39435ef..7bee878 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt @@ -1,5 +1,5 @@ [% indent %]{ -[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %] +[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %] [%- indent = indent _ ' ' %] [% indent %]# One of the following elements. [% indent %]# No occurance checks yet, so be sure to pass just one... 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 daa2c1c..cf80c48 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt @@ -1,7 +1,10 @@ [% IF (complexType.get_variety == 'restriction'); INCLUDE complexType/POD/restriction.tt(complexType = complexType); -ELSIF (complexType.get_variety == 'sequence'); - THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet"; +ELSIF (complexType.get_variety == '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 }"; END; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt index dca83c9..4ee4c7c 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt @@ -1,5 +1,5 @@ [% indent %]{ -[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %] +[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %] [%- indent = indent _ ' '; FOREACH element = complexType.get_element %] [% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%] diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt new file mode 100644 index 0000000..cf80c48 --- /dev/null +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt @@ -0,0 +1,12 @@ +[% IF (complexType.get_variety == 'restriction'); + INCLUDE complexType/POD/restriction.tt(complexType = complexType); +ELSIF (complexType.get_variety == '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 }"; +END; + +%] \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt index dd94421..3cd54f6 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt @@ -7,7 +7,7 @@ ELSIF (complexType.get_variety == 'group'); ELSIF (complexType.get_variety == 'choice'); INCLUDE complexType/POD/choice.tt(complexType = complexType); ELSIF (complexType.get_contentModel == 'simpleContent'); - THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType simpleContent not implemented yet"; + INCLUDE complexType/POD/simpleContent.tt(complexType = complexType); ELSIF (complexType.get_contentModel == 'complexContent'); INCLUDE complexType/POD/complexContent.tt(complexType = complexType); END %], \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt index 7ae32a9..8a3b986 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt @@ -24,13 +24,9 @@ __PACKAGE__->_factory( { [% FOREACH element = complexType.get_element; IF (type = element.get_type); - element_type = complexType.expand( type ); - IF (element_type.0 == 'http://www.w3.org/2001/XMLSchema'); -%] - [% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% element_type.1 %]', -[% ELSE -%] - [% element.get_name %] => '[% type_prefix %]::[% element_type.1 %]', -[% END; - ELSE; + element_type = complexType.expand( type ); -%] + [% element.get_name %] => '[% XSD.get_type_prefix(element_type.0) %]::[% element_type.1 %]', +[% ELSE; IF (element.first_simpleType); atomic_types.${ element.get_name } = element.first_simpleType; ELSIF (element.first_complexType); @@ -38,7 +34,7 @@ __PACKAGE__->_factory( ELSE; THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it"; END; %] - [% element.get_name %] => '[% type_prefix %]::[% complexType.get_name %]::_[% element.get_name %]', + [% element.get_name %] => '[% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% element.get_name %]', [% END; END -%] } diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt index c11113a..053e865 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt @@ -1,7 +1,7 @@ [% FOREACH type IN atomic_types; %] -package [% type_prefix %]::[% complexType.get_name %]::_[% type.key %]; +package [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% type.key %]; use strict; use warnings; { diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/attributeSet.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/attributeSet.tt index b2d53d5..182bbf0 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/attributeSet.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/attributeSet.tt @@ -1,3 +1,7 @@ +[% IF (complexType.get_attribute.size) %] +package [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name.replace('\.','::').replace('-','_') %]::_ATTR; +use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); + { # BLOCK to scope variables [% @@ -19,11 +23,9 @@ __PACKAGE__->_factory( [% FOREACH element = complexType.get_attribute; IF (type = element.get_type); element_type = complexType.expand( type ); - IF (element_type.0 == 'http://www.w3.org/2001/XMLSchema'); -%] - [% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% element_type.1 %]', -[% ELSE -%] - [% element.get_name %] => '[% type_prefix %]::[% element_type.1 %]', -[% END; +-%] + [% element.get_name %] => '[% XSD.get_type_prefix(element_type.0) %]::[% element_type.1 %]', +[% ELSE; IF (element.first_simpleType); THROW NOT_IMPLEMENTED , "Attributes with atomic simpleType definition are not implemented yet"; @@ -31,10 +33,12 @@ __PACKAGE__->_factory( ELSE; THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it"; END; %] - [% element.get_name %] => '[% type_prefix %]::[% complexType.get_name %]::_[% element.get_name %]', + [% element.get_name %] => '[% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% element.get_name %]', [% END; END -%] } ); } # end BLOCK + +[% 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 f7411b4..da7b5f2 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt @@ -2,6 +2,8 @@ INCLUDE complexType/restriction.tt(complexType = complexType); ELSIF (complexType.get_variety == 'sequence'); INCLUDE complexType/extension.tt(complexType = complexType); +ELSIF (complexType.get_variety == 'all'); + INCLUDE complexType/extension.tt(complexType = complexType); ELSE; THROW UNKNOWN, "unknown variety ${ complexType.get_variety }"; END; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt index 8ccd840..ebfbc22 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt @@ -1,5 +1,5 @@ [% IF (complexType.get_contentModel == 'simpleContent'); - THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType simpleContent not implemented yet"; + INCLUDE complexType/simpleContent.tt(complexType = complexType); ELSIF (complexType.get_contentModel == 'complexContent'); INCLUDE complexType/complexContent.tt(complexType = complexType); ELSE; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt index 5ed7cb3..e705bc8 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt @@ -20,7 +20,7 @@ END; complexType.set_element( element_list ); -%] -use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]); +use base qw([% XSD.get_type_prefix(base_name.0) %]::[% base_name.1.replace('\.', '::') %]); [% INCLUDE complexType/variety.tt(complexType = complexType); diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt index e33d45f..f6a7f2d 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt @@ -1,7 +1,7 @@ [% IF (base=complexType.get_base); base_name=complexType.expand(base); -%] -use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]); +use base qw([% XSD.get_type_prefix(base_name.0) %]::[% base_name.1.replace('\.', '::') %]); [% ELSE; THROW NOT_IMPLEMENTED, "restriction without base not supported"; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt new file mode 100644 index 0000000..a92faa7 --- /dev/null +++ b/lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt @@ -0,0 +1,8 @@ +[% IF (complexType.get_variety == 'restriction'); + INCLUDE complexType/restriction.tt(complexType = complexType); +ELSIF (complexType.get_variety == 'extension'); + THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType simpleContent extension not implemented yet"; +ELSE; + THROW UNKNOWN, "unknown variety ${ complexType.get_variety }"; +END; +%] \ No newline at end of file diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/element.tt b/lib/SOAP/WSDL/Generator/Template/XSD/element.tt index 433561f..0c59c10 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/element.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/element.tt @@ -1,4 +1,5 @@ -package [% element_prefix %]::[% element.get_name.replace('\.','::') %]; +[% USE XSD(context) %] +package [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name.replace('\.','::') %]; use strict; use warnings; @@ -44,7 +45,7 @@ use base qw( } -package [% element_prefix %]::[% element.get_name.replace('\.','::').replace('-','_') %]::_ATTR; +package [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name.replace('\.','::').replace('-','_') %]::_ATTR; use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); [% INCLUDE complexType/attributeSet.tt %] @@ -66,7 +67,7 @@ use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); [% head1 %] NAME -[% element_prefix %]::[% element.get_name %] +[% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name %] [% head1 %] DESCRIPTION @@ -77,7 +78,7 @@ Perl data type class for the XML Schema defined element [% head2 %] new - my $element = [% element_prefix %]::[% element.get_name %]->new($data); + my $element = [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name %]->new($data); Constructor. The following data structure may be passed to new(): diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt b/lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt index a4eede7..2716f04 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt @@ -1,4 +1,5 @@ -package [% type_prefix %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %]; +[% USE XSD(context) -%] +package [% XSD.get_type_prefix(simpleType.get_targetNamespace) %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %]; use strict; use warnings; @@ -20,7 +21,7 @@ __END__ [% pod %] -[% head1 %] [% type_prefix %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %] +[% head1 %] [% XSD.get_type_prefix(simpleType.get_targetNamespace) %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %] [% head1 %] DESCRIPTION diff --git a/lib/SOAP/WSDL/TypeLookup.pm b/lib/SOAP/WSDL/TypeLookup.pm index 92745aa..d88a0f2 100644 --- a/lib/SOAP/WSDL/TypeLookup.pm +++ b/lib/SOAP/WSDL/TypeLookup.pm @@ -167,22 +167,22 @@ my %TYPES = ( }, group => { type => 'METHOD', - method => 'set_flavor', + method => 'set_variety', value => 'group', }, all => { type => 'METHOD', - method => 'set_flavor', + method => 'set_variety', value => 'all', }, choice => { type => 'METHOD', - method => 'set_flavor', + method => 'set_variety', value => 'choice', }, sequence => { type => 'METHOD', - method => 'set_flavor', + method => 'set_variety', value => 'sequence', }, }, diff --git a/lib/SOAP/WSDL/XSD/ComplexType.pm b/lib/SOAP/WSDL/XSD/ComplexType.pm index cc01b6e..6980b67 100644 --- a/lib/SOAP/WSDL/XSD/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/ComplexType.pm @@ -9,9 +9,10 @@ use base qw/SOAP::WSDL::Base/; our $VERSION=q{2.00_29}; my %annotation_of :ATTR(:name :default<()>); -my %attribute_of :ATTR(:name :default<()>); +my %attribute_of :ATTR(:name :default<()>); my %element_of :ATTR(:name :default<()>); -my %flavor_of :ATTR(:name :default<()>); +#my %flavor_of :ATTR(:name :default<()>); +my %variety_of :ATTR(:name :default<()>); my %base_of :ATTR(:name :default<()>); my %itemType_of :ATTR(:name :default<()>); my %enumeration_of :ATTR(:name :default<()>); @@ -21,17 +22,17 @@ my %mixed_of :ATTR(:name :default<()>); # default is fal # is set to simpleContent/complexContent my %content_model_of :ATTR(:name :default); -sub get_variety; *get_variety = \&get_flavor; +sub get_flavor; *get_flavor = \&get_variety; sub push_element { my $self = shift; my $element = shift; - if ($flavor_of{ ident $self } eq 'all') + if ($variety_of{ ident $self } eq 'all') { $element->set_minOccurs(0) if not defined ($element->get_minOccurs); $element->set_maxOccurs(1) if not defined ($element->get_maxOccurs); } - elsif ($flavor_of{ ident $self } eq 'sequence') + elsif ($variety_of{ ident $self } eq 'sequence') { $element->set_minOccurs(1) if not defined ($element->get_minOccurs); $element->set_maxOccurs(1) if not defined ($element->get_maxOccurs); @@ -42,14 +43,14 @@ sub push_element { sub set_restriction { my $self = shift; my $element = shift; - $flavor_of{ ident $self } = 'restriction'; + $variety_of{ ident $self } = 'restriction'; $base_of{ ident $self } = $element->{ Value }; } sub set_extension { my $self = shift; my $element = shift; - $flavor_of{ ident $self } = 'extension'; + $variety_of{ ident $self } = 'extension'; $base_of{ ident $self } = $element->{ Value }; } @@ -64,7 +65,7 @@ sub serialize { $opt->{ indent } ||= q{}; $opt->{ attributes } ||= []; - my $flavor = $self->get_flavor(); + my $variety = $self->get_variety(); my $xml = ($opt->{ readable }) ? $opt->{ indent } : q{}; # add indentation @@ -78,17 +79,17 @@ sub serialize { delete $opt->{ attributes }; # don't propagate... if ( $opt->{ autotype }) { - my $ns = $self->get_targetNamespace(); - # reverse namespace by prefix hash - my %prefix_of = reverse %{ $opt->{ namespace } }; - my $prefix = $prefix_of{ $ns } - || die 'No prefix found for namespace '. $ns; - $xml .= join q{}, " type=\"$prefix:", $self->get_name(), '" ' - if ($self->get_name() ); + my $ns = $self->get_targetNamespace(); + # reverse namespace by prefix hash + my %prefix_of = reverse %{ $opt->{ namespace } }; + my $prefix = $prefix_of{ $ns } + || die 'No prefix found for namespace '. $ns; + $xml .= join q{}, " type=\"$prefix:", $self->get_name(), '" ' + if ($self->get_name() ); } $xml .= '>'; $xml .= "\n" if ( $opt->{ readable } ); # add linebreak - if ( ($flavor eq "sequence") or ($flavor eq "all") ) { + if ( ($variety eq "sequence") or ($variety eq "all") ) { $opt->{ indent } .= "\t"; for my $element (@{ $self->get_element() }) { # might be list - listify @@ -114,7 +115,7 @@ sub serialize { $opt->{ indent } =~s/\t$//; } else { - die "sorry, we just handle all and sequence types yet..."; + die "sorry, we just handle all and sequence types yet..."; } $xml .= $opt->{ indent } if ( $opt->{ readable } ); # add indentation $xml .= ''; diff --git a/t/SOAP/WSDL/Expat/WSDLParser.t b/t/SOAP/WSDL/Expat/WSDLParser.t index ccef309..b058c8e 100644 --- a/t/SOAP/WSDL/Expat/WSDLParser.t +++ b/t/SOAP/WSDL/Expat/WSDLParser.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 10; #qw(no_plan); +use Test::More tests => 11; #qw(no_plan); use File::Spec; use File::Basename; @@ -52,6 +52,16 @@ is @{ $schema_from_ref }, 2, 'got builtin and imported schema'; ok @{ $schema_from_ref->[1]->get_element } > 0; is $schema_from_ref->[1]->get_element->[0]->get_name(), 'sayHello'; +$SIG{ALRM} = sub { die 'looped'}; +alarm 1; + +$definitions = $parser->parse_file( + "$path/../../../acceptance/wsdl/WSDLParser_import_loop.wsdl" +); + +alarm 0; +pass 'import loop'; + __END__ $generator->set_type_prefix('MyTypes'); diff --git a/t/SOAP/WSDL/Generator/XSD.t b/t/SOAP/WSDL/Generator/XSD.t index 74bf8c5..b8c4824 100644 --- a/t/SOAP/WSDL/Generator/XSD.t +++ b/t/SOAP/WSDL/Generator/XSD.t @@ -1,8 +1,8 @@ -use Test::More tests => 41; +use Test::More tests => 42; use File::Basename qw(dirname); use File::Spec; use File::Path; - +use diagnostics; my $path = File::Spec->rel2abs( dirname __FILE__ ); use_ok qw(SOAP::WSDL::Generator::Visitor::Typelib); @@ -12,7 +12,7 @@ use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); -my $definitions = $parser->parse_file( +my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_test.wsdl" #"$path/../../../acceptance/wsdl/elementAtomicComplexType.xml" ); @@ -26,7 +26,7 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({ }); my $code = ""; -$generator->set_output(\$code); +$generator->set_output(\$code); $generator->generate_typelib(); { eval $code; @@ -47,9 +47,9 @@ $generator->generate(); #$generator->generate_typemap(); if (eval { require Test::Warn; }) { - Test::Warn::warning_like( sub { $generator->generate_interface() }, + Test::Warn::warning_like( sub { $generator->generate_interface() }, qr{\A Multiple \s parts \s detected \s in \s message \s testMultiPartWarning}xms); -} +} else { $generator->generate_interface(); SKIP: { skip 'Cannot test warnings without Test::Warn', 1 }; @@ -67,7 +67,7 @@ $interface->set_no_dispatch(1); my $message; -ok $message = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'} +ok $message = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'} , { Test1 => 'Header1', Test2 => 'Header2'}), 'call soap method (no_dispatch)'; use_ok qw(SOAP::WSDL::Expat::MessageParser); @@ -140,13 +140,13 @@ my $ct_east = MyTypes::testComplexTypeElementAtomicSimpleType->new({ is $ct_east->get_testAtomicSimpleTypeElement, 42; is $ct_east->get_testAtomicSimpleTypeElement->get_value(), 42; -isa_ok($ct_east->get_testAtomicSimpleTypeElement, +isa_ok($ct_east->get_testAtomicSimpleTypeElement, 'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement'); is $ct_east->get_testAtomicSimpleTypeElement2, 23; is $ct_east->get_testAtomicSimpleTypeElement2->get_value(), 23; -isa_ok($ct_east->get_testAtomicSimpleTypeElement2, +isa_ok($ct_east->get_testAtomicSimpleTypeElement2, 'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement2'); ok eval { require MyElements::testElementCompletelyEmptyComplex; } @@ -155,6 +155,10 @@ ok my $empty = MyElements::testElementCompletelyEmptyComplex->new(); is $empty->serialize_qualified(), '' , 'serialize empty'; - + + +ok eval { require MyTypes::testComplexTypeSimpleRestriction; } + , 'load MyTypes::testComplexTypeSimpleRestriction'; + rmtree "$path/testlib"; diff --git a/t/SOAP/WSDL/XSD/ComplexType.t b/t/SOAP/WSDL/XSD/ComplexType.t index 4a1e84f..98dfc63 100644 --- a/t/SOAP/WSDL/XSD/ComplexType.t +++ b/t/SOAP/WSDL/XSD/ComplexType.t @@ -5,7 +5,7 @@ use Test::More tests => 2; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::ComplexType); my $obj = SOAP::WSDL::XSD::ComplexType->new(); -$obj->set_flavor('extension'); +$obj->set_variety('extension'); eval { $obj->serialize('foo') }; -like $@, qr{sorry, \s we \s just}xsm; \ No newline at end of file +like $@, qr{sorry, \s we \s just}xsm; diff --git a/t/acceptance/wsdl/WSDLParser_import_loop.wsdl b/t/acceptance/wsdl/WSDLParser_import_loop.wsdl new file mode 100644 index 0000000..b6ce535 --- /dev/null +++ b/t/acceptance/wsdl/WSDLParser_import_loop.wsdl @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/t/acceptance/wsdl/generator_test.wsdl b/t/acceptance/wsdl/generator_test.wsdl index fb75335..2d18f48 100644 --- a/t/acceptance/wsdl/generator_test.wsdl +++ b/t/acceptance/wsdl/generator_test.wsdl @@ -1,5 +1,5 @@ - - + @@ -57,7 +57,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - + @@ -78,12 +78,25 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - - + + + + + + + ComplexType Test + + + + + + + + complexType extension test @@ -146,10 +159,10 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - SimpleType: Integer between 1 and 9 + SimpleType: Integer between 1 and 9 (Inclusive constraints) - @@ -157,7 +170,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - SimpleType: Integer between 1 and 9 + SimpleType: Integer between 1 and 9 (Inclusive constraints) @@ -170,8 +183,8 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - - + + @@ -191,8 +204,8 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - - + + @@ -206,7 +219,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - + @@ -219,7 +232,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - + @@ -230,7 +243,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - + @@ -284,7 +297,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm - + diff --git a/t/acceptance/wsdl/import_loop.xsd b/t/acceptance/wsdl/import_loop.xsd new file mode 100644 index 0000000..9c224b7 --- /dev/null +++ b/t/acceptance/wsdl/import_loop.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/t/lib/MyComplexType.pm b/t/lib/MyComplexType.pm index 2b5b115..5e6ada4 100644 --- a/t/lib/MyComplexType.pm +++ b/t/lib/MyComplexType.pm @@ -3,10 +3,11 @@ package MyComplexType; use strict; use Class::Std::Fast::Storable constructor => 'none'; use lib '../../lib'; -use SOAP::WSDL::XSD::Typelib::ComplexType; use base ('SOAP::WSDL::XSD::Typelib::ComplexType'); -my %MyTestName_of :ATTR(:get); +Class::Std::initialize(); + +my %MyTestName_of :ATTR(:get); __PACKAGE__->_factory( [ qw(MyTestName) ], # order