1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
package SOAP::WSDL::Types;
use strict;
use warnings;
use SOAP::WSDL::XSD::Schema::Builtin;
use Class::Std::Fast::Storable;
use base qw(SOAP::WSDL::Base);
our $VERSION = 3.004;
my %schema_of :ATTR(:name<schema> :default<[]>);
sub START {
my ($self, $ident, $args_of) = @_;
$self->push_schema( SOAP::WSDL::XSD::Schema::Builtin->new() );
return $self;
}
sub find_type {
my ($self, $ns, $name) = @_;
($ns, $name) = @{ $ns } if ref $ns; # allow passing list refs
foreach my $schema (@{ $schema_of{ ident $self } }) {
my $type = $schema->find_type($ns, $name);
return $type if $type;
}
return;
}
sub find_attribute {
my ($self, $ns, $name) = @_;
($ns, $name) = @{ $ns } if ref $ns; # allow passing list refs
foreach my $schema (@{ $schema_of{ ident $self } }) {
my $type = $schema->find_attribute($ns, $name);
return $type if $type;
}
return;
}
sub find_element {
my ($self, $ns, $name) = @_;
($ns, $name) = @{ $ns } if ref $ns; # allow passing list refs
foreach my $schema (@{ $schema_of{ ident $self } }) {
my $type = $schema->find_element($ns, $name);
return $type if $type;
}
return;
}
1;
|