import SOAP-WSDL 2.00_12 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_12
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_12.tar.gz
This commit is contained in:
Martin Kutter authored and Michael G. Schwern committed 2009-12-12 19:47:49 -08:00
1 parent c2da74b5ae
commit fd0854e34a
28 files changed
+312 -1070

No files matched your search

+1 -1
View File
@@ -181,7 +181,7 @@ sub to_class {
my $template = <<'EOT';
package [% type_prefix %][% self.get_name %];
use strict;
use Class::Std::Storable;
use SOAP::WSDL::XSD::Typelib::ComplexType;
use base qw(
SOAP::WSDL::XSD::Typelib::ComplexType
+1 -1
View File
@@ -244,7 +244,7 @@ sub to_class {
my $template = <<'EOT';
package [% element_prefix %][% self.get_name %];
use strict;
use Class::Std::Storable;
use SOAP::WSDL::XSD::Typelib::Element;
[% IF (type = self.first_simpleType) %]
+9 -18
View File
@@ -37,29 +37,20 @@ BEGIN {
sub set_value {
# use set_value from base class if we have a XML-DateTime format
#2037-12-31T00:00:00.0000000+01:00
if (
return $_[0]->SUPER::set_value($_[1]) if (
$_[1] =~ m{ ^\d{4} \- \d{2} \- \d{2}
T \d{2} \: \d{2} \: \d{2} (:? \. \d{1,7} )?
[\+\-] \d{2} \: \d{2} $
}xms
) {
$_[0]->SUPER::set_value($_[1])
}
# use a combination of strptime and strftime for converting the date
# strptime does not emit timezone info, so we're pretty fucked up here.
#
# Unfortunately, strftime outputs the time zone as [+-]0000, whereas XML
# whants it as [+-]00:00
# We leave out the optional nanoseconds part, as it would always be empty.
else {
# strptime sets empty values to undef - and strftime doesn't like that...
my @time_from = map { ! defined $_ ? 0 : $_ } strptime($_[1]);
undef $time_from[-1];
);
# strptime sets empty values to undef - and strftime doesn't like that...
my @time_from = map { ! defined $_ ? 0 : $_ } strptime($_[1]);
undef $time_from[-1];
my $time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from );
substr $time_str, -2, 0, ':';
$_[0]->SUPER::set_value($time_str);
}
my $time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from );
substr $time_str, -2, 0, ':';
$_[0]->SUPER::set_value($time_str);
}
1;
+30 -16
View File
@@ -4,9 +4,9 @@ use strict;
use warnings;
use Carp;
use SOAP::WSDL::XSD::Typelib::Builtin;
use Scalar::Util qw(blessed);
use Class::Std::Storable;
use Scalar::Util qw(blessed refaddr);
use Data::Dumper;
use Class::Std::Storable;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
@@ -64,7 +64,7 @@ sub _factory {
my $is_list = $type->isa('SOAP::WSDL::XSD::Typelib::Builtin::list');
*{ "$class\::set_$name" } = sub {
my ($self, $value) = @_;
# my ($self, $value) = @_;
# The structure below looks rather weird, but is optimized for performance.
#
@@ -93,11 +93,11 @@ sub _factory {
# for GLOB references, feel free to add them.
# d) we should also die for non-blessed non-ARRAY/HASH references in lists but don't do yet - oh my !
my $is_ref = ref $value;
$attribute_ref->{ ident $self } = ($is_ref)
my $is_ref = ref $_[1];
$attribute_ref->{ ident $_[0] } = ($is_ref)
? $is_ref eq 'ARRAY'
? $is_list # remembered from outside closure
? $type->new({ value => $value }) # list element - can take list ref as value
? $type->new({ value => $_[1] }) # list element - can take list ref as value
: [ map {
ref $_
? ref $_ eq 'HASH'
@@ -106,20 +106,20 @@ sub _factory {
? $_
: croak "cannot use " . ref($_) . " reference as value for $name - $type required"
: $type->new({ value => $_ })
} @{ $value }
} @{ $_[1] }
]
: $is_ref eq 'HASH'
? $type->new( $value )
? $type->new( $_[1] )
: $is_ref eq $type
? $value
? $_[1]
: die croak "cannot use $is_ref reference as value for $name - $type required"
: $type->new({ value => $value });
: $type->new({ value => $_[1] });
};
*{ "$class\::add_$name" } = sub {
my $ident = ident $_[0];
warn "attempting to add empty value to " . ref $_[0]
if (not defined $_[1]);
if not defined $_[1];
# first call
return $attribute_ref->{ $ident } = $_[1]
@@ -133,16 +133,30 @@ sub _factory {
return push @{ $attribute_ref->{ $ident } }, $_[1];
};
*{ "$class\::$name" } = *{ "$class\::add_$name" };
}
*{ "$class\::new" } = sub {
my $self = bless \my ($o), $_[0];
$self->BUILD( ident $self, $_[1] ) if exists &BUILD;
$self->_init( ident $self, $_[1] );
$self->START( ident $self, $_[1] ) if exists &START;
return $self;
};
*{ "$class\::START" } = sub {
my ($self, $ident, $args_of) = @_;
*{ "$class\::_init" } = sub {
# We're working on @_ for speed.
# Normally, the first line would look like this:
# my ($self, $ident, $args_of) = @_;
#
# The hanging side comment show you what would be there, then.
# iterate over keys of arguments
# and call set appropriate field in clase
map { ($ATTRIBUTES_OF{ $class }->{ $_ })
? do {
my $method = "set_$_";
$self->$method( $args_of->{ $_ } );
$_[0]->$method( $_[2]->{ $_ } ); # ( $args_of->{ $_ } );
}
: $_ =~ m{ \A # beginning of string
xmlns # xmlns
@@ -152,8 +166,8 @@ sub _factory {
croak "unknown field $_ in $class. Valid fields are:\n"
. join(', ', @{ $ELEMENTS_FROM{ $class } }) . "\n"
. "Structure given:\n" . Dumper @_ };
} keys %$args_of;
return $self;
} keys %{ $_[2] }; # %$args_of;
return $_[0]; # $self;
};
-2
View File
@@ -1,8 +1,6 @@
#!/usr/bin/perl
package SOAP::WSDL::XSD::Typelib::Element;
use strict;
use Class::Std::Storable;
use Data::Dumper;
my %NAME;
my %NILLABLE;