import SOAP-WSDL 2.00_19 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_19 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_19.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
21efa286af
commit
3d11524449
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user