Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d11524449 |
7
Build.PL
7
Build.PL
@@ -4,7 +4,7 @@ $build = Module::Build->new(
|
||||
create_makefile_pl => 'passthrough',
|
||||
dist_abstract => 'SOAP with WSDL support',
|
||||
dist_name => 'SOAP-WSDL',
|
||||
dist_version => '2.00_18',
|
||||
dist_version => '2.00_19',
|
||||
module_name => 'SOAP::WSDL',
|
||||
license => 'artistic',
|
||||
requires => {
|
||||
@@ -40,6 +40,11 @@ $build = Module::Build->new(
|
||||
'XML::Parser::Expat' => 0,
|
||||
},
|
||||
recursive_test_files => 1,
|
||||
meta_add => {
|
||||
no_index => {
|
||||
namespace => 'SOAP::WSDL::Generator::Template::XSD',
|
||||
},
|
||||
}
|
||||
);
|
||||
$build->add_build_element('tt');
|
||||
$build->create_build_script;
|
||||
|
||||
19
CHANGES
19
CHANGES
@@ -1,4 +1,4 @@
|
||||
Release notes for SOAP::WSDL 2.00_18
|
||||
Release notes for SOAP::WSDL 2.00_19
|
||||
-------
|
||||
|
||||
I'm proud to present a new pre-release version of SOAP::WSDL.
|
||||
@@ -33,6 +33,23 @@ Features:
|
||||
|
||||
The following changes have been made:
|
||||
|
||||
2.00_19
|
||||
----
|
||||
The following features were added (the numbers in square brackets are the
|
||||
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924):
|
||||
|
||||
* [ 1810395 ] Implement complexType complexContent extension
|
||||
|
||||
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):
|
||||
|
||||
* [ 1813144 ] Typemap not used in interface class
|
||||
* [ 1810058 ] .tt's pod indexed on CPAN
|
||||
|
||||
The following uncategorized improvements have been made:
|
||||
|
||||
* Documentation improvements
|
||||
|
||||
2.00_18
|
||||
----
|
||||
The following features were added (the numbers in square brackets are the
|
||||
|
||||
2
MANIFEST
2
MANIFEST
@@ -59,12 +59,14 @@ lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt
|
||||
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/structure.tt
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.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
|
||||
lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt
|
||||
|
||||
4
META.yml
4
META.yml
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: SOAP-WSDL
|
||||
version: 2.00_18
|
||||
version: 2.00_19
|
||||
author: []
|
||||
abstract: SOAP with WSDL support
|
||||
license: artistic
|
||||
@@ -246,3 +246,5 @@ generated_by: Module::Build version 0.2808
|
||||
meta-spec:
|
||||
url: http://module-build.sourceforge.net/META-spec-v1.2.html
|
||||
version: 1.2
|
||||
no_index:
|
||||
namespace: SOAP::WSDL::Generator::Template::XSD
|
||||
|
||||
1
TODO
1
TODO
@@ -2,7 +2,6 @@ TODO list for SOAP::WSDL
|
||||
|
||||
2.00 Pre-releases
|
||||
--------
|
||||
* Implement a Generator Plugin API
|
||||
|
||||
* Implement a interface similar to SOAP::Schema (#1783639)
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Client::Base);
|
||||
|
||||
# only load if it hasn't been loaded before
|
||||
require [% typemap_prefix %]::[% service.get_name %]
|
||||
if not [% typemap_prefix %]::[% service.get_name %]->can('get_class');
|
||||
|
||||
sub START {
|
||||
$_[0]->set_proxy('[% port.first_address.get_location %]') if not $_[2]->{proxy};
|
||||
$_[0]->set_class_resolver('[% typemap_prefix %]::[% service.get_name %]')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
|
||||
{ # BLOCK to scope variables
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[% IF (complexType.get_variety == 'restriction');
|
||||
INCLUDE complexType/restriction.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety == 'sequence');
|
||||
THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet";
|
||||
INCLUDE complexType/extension.tt(complexType = complexType);
|
||||
ELSE;
|
||||
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
||||
END;
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
[% IF (complexType.get_variety == 'all');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety == 'sequence');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety == 'group');
|
||||
THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType group not implemented yet";
|
||||
ELSIF (complexType.get_variety == 'choice');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_contentModel == 'simpleContent');
|
||||
[% IF (complexType.get_contentModel == 'simpleContent');
|
||||
THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType simpleContent not implemented yet";
|
||||
ELSIF (complexType.get_contentModel == 'complexContent');
|
||||
INCLUDE complexType/complexContent.tt(complexType = complexType);
|
||||
ELSE;
|
||||
THROW NOT_IMPLEMENTED, "Unknown content model ${ complexType.get_contentModel }";
|
||||
INCLUDE complexType/variety.tt(complexType = complexType);
|
||||
END %]
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
[%
|
||||
|
||||
base_name=complexType.expand( complexType.get_base);
|
||||
base_type = definitions.first_types.find_type( base_name );
|
||||
|
||||
element_from = complexType.get_element;
|
||||
|
||||
#
|
||||
# Sanity check: All original elements must be noted first
|
||||
#
|
||||
FOREACH element = base_type.get_element;
|
||||
IF element_from.${ loop.index }.get_name != element.get_name;
|
||||
THROW WSDL "${element.get_name} not found at position ${ loop.index } in extension type ${ complexType.get_name }";
|
||||
END;
|
||||
END;
|
||||
|
||||
|
||||
-%]
|
||||
use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]);
|
||||
[%
|
||||
|
||||
INCLUDE complexType/variety.tt(complexType = complexType);
|
||||
|
||||
%]
|
||||
@@ -1,7 +1,7 @@
|
||||
[% IF (base=complexType.get_base);
|
||||
base_name=complexType.expand(base);
|
||||
-%]
|
||||
use base qw([% type_prefix %]::[% base_name.1 %]);
|
||||
use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]);
|
||||
[%
|
||||
ELSE;
|
||||
THROW NOT_IMPLEMENTED, "restriction without base not supported";
|
||||
|
||||
13
lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt
Normal file
13
lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt
Normal file
@@ -0,0 +1,13 @@
|
||||
[%
|
||||
IF (complexType.get_variety == 'all');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety == 'sequence');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety == 'group');
|
||||
THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType group not implemented yet";
|
||||
ELSIF (complexType.get_variety == 'choice');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSE;
|
||||
THROW NOT_IMPLEMENTED, "Unknown variety ${ complexType.get_variety }";
|
||||
END;
|
||||
%]
|
||||
@@ -178,6 +178,13 @@ no check for occurence are made.
|
||||
|
||||
=head3 complexType with complexContent content model
|
||||
|
||||
Note that complexType classes with complexContent content model don't exhibit
|
||||
their type via the xsi:type attribute yet, so they currently cannot be used
|
||||
as a replacement for their base type.
|
||||
|
||||
SOAP::WSDL's XSD deserializer backend does not recognize the xsi:type=""
|
||||
attribute either yet.
|
||||
|
||||
=over
|
||||
|
||||
=item * restriction variety
|
||||
@@ -192,12 +199,30 @@ No additional processing or content checking is performed yet.
|
||||
complexType
|
||||
restriction
|
||||
|
||||
Note that complexType with restriction variety classes don't exhibit their
|
||||
type via the xsi:type attribute yet, so they currently cannot be used as
|
||||
a replacement for their base type.
|
||||
|
||||
=item * extension variety
|
||||
|
||||
ComplexType classes with extension variety inherit from the XSD base
|
||||
complexType class and from their base type.
|
||||
|
||||
Extension classes are checked for (re-)defining all elements of their parent
|
||||
class.
|
||||
|
||||
Note that a derived type's elements (=properties) overrides the getter /
|
||||
setter methods for all inherited elements. All object data is stored in the
|
||||
derived type's class, not in the defining class (See L<Class::Std> for a
|
||||
discussion on inside out object data storage).
|
||||
|
||||
No additional processing or content checking is performed yet.
|
||||
|
||||
complexType complexType
|
||||
base class base type class
|
||||
^ ^
|
||||
| |
|
||||
-----------------
|
||||
|
|
||||
complexType
|
||||
extension
|
||||
|
||||
=back
|
||||
|
||||
=head2 SimpleType
|
||||
@@ -217,8 +242,6 @@ SOAP::WSDL::XSD::Typelib::XSD::list.
|
||||
Derivation by restriction is implemented by inheriting from a base type and
|
||||
applying the required restrictions.
|
||||
|
||||
=head2 Complex Types
|
||||
|
||||
=head1 FACETS
|
||||
|
||||
XML Schema facets are not implemented yet.
|
||||
@@ -244,7 +267,6 @@ The following XML Schema declaration elements are not supported yet:
|
||||
|
||||
=item * Type definition elements
|
||||
|
||||
complexContent - only restriction supported
|
||||
simpleContent
|
||||
union
|
||||
|
||||
|
||||
@@ -136,6 +136,10 @@ my %TYPES = (
|
||||
type => 'METHOD',
|
||||
method => 'set_restriction',
|
||||
},
|
||||
extension => {
|
||||
type => 'METHOD',
|
||||
method => 'set_extension',
|
||||
},
|
||||
list => {
|
||||
type => 'METHOD',
|
||||
method => 'set_list',
|
||||
|
||||
@@ -18,7 +18,7 @@ my %abstract_of :ATTR(:name<abstract> :default<()>);
|
||||
my %mixed_of :ATTR(:name<mixed> :default<()>); # default is false
|
||||
|
||||
# is set to simpleContent/complexContent
|
||||
my %content_model_of :ATTR(:name<contentModel> :default<()>);
|
||||
my %content_model_of :ATTR(:name<contentModel> :default<NONE>);
|
||||
|
||||
sub get_variety; *get_variety = \&get_flavor;
|
||||
|
||||
@@ -45,6 +45,12 @@ sub set_restriction {
|
||||
$base_of{ ident $self } = $element->{ Value };
|
||||
}
|
||||
|
||||
sub set_extension {
|
||||
my $self = shift;
|
||||
my $element = shift;
|
||||
$flavor_of{ ident $self } = 'extension';
|
||||
$base_of{ ident $self } = $element->{ Value };
|
||||
}
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
|
||||
@@ -19,14 +19,8 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
||||
definitions => $definitions,
|
||||
});
|
||||
my $output = q{};
|
||||
$generator->generate_interface({
|
||||
NO_POD => 1,
|
||||
output => \$output,
|
||||
});
|
||||
|
||||
ok eval $output;
|
||||
|
||||
$output = q{};
|
||||
$generator->generate_typemap({
|
||||
NO_POD => 1,
|
||||
output => \$output,
|
||||
@@ -35,7 +29,19 @@ $generator->generate_typemap({
|
||||
ok eval $output;
|
||||
print $@ if $@;
|
||||
|
||||
print $output;
|
||||
#print $output;
|
||||
|
||||
$output = q{};
|
||||
$generator->generate_interface({
|
||||
NO_POD => 1,
|
||||
output => \$output,
|
||||
});
|
||||
|
||||
ok eval $output;
|
||||
print $@ if $@;
|
||||
|
||||
|
||||
# print $output;
|
||||
__END__
|
||||
|
||||
my $tt = Template->new(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 26;
|
||||
use Test::More tests => 30;
|
||||
use File::Basename qw(dirname);
|
||||
use File::Spec;
|
||||
use File::Path;
|
||||
@@ -107,5 +107,15 @@ $complexRestriction = MyTypes::testComplexTypeRestriction->new({
|
||||
is $complexRestriction->get_Test1(), 'test1';
|
||||
is $complexRestriction->get_Test2(), 'test2';
|
||||
|
||||
ok eval { require MyTypes::testComplexTypeExtension };
|
||||
$complexExtension = MyTypes::testComplexTypeExtension->new({
|
||||
Test1 => 'test1',
|
||||
Test2 => 'test2',
|
||||
Test3 => 'test3',
|
||||
});
|
||||
is $complexExtension->get_Test1(), 'test1';
|
||||
is $complexExtension->get_Test2(), 'test2';
|
||||
is $complexExtension->get_Test3(), 'test3';
|
||||
|
||||
|
||||
rmtree "$path/testlib";
|
||||
|
||||
@@ -84,6 +84,21 @@
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeExtension">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>complexType extension test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="tns:testComplexTypeAll">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" />
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test3" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeChoice">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
Reference in New Issue
Block a user