import SOAP-WSDL 2.00_22 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_22
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_22.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:48:06 -08:00
committed by Michael G. Schwern
parent fa4d5dd884
commit 080b211e4e
22 changed files with 482 additions and 383 deletions
+7 -2
View File
@@ -604,6 +604,11 @@ details.
=over
=item * perl 5.8.0 or higher required
SOAP::WSDL needs perl 5.8.0 or higher. This is due to a bug in perls
before - see http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/929746 for details.
=item * Apache SOAP datatypes are not supported
You currently can't use SOAP::WSDL with Apache SOAP datatypes like map.
@@ -731,9 +736,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 308 $
$Rev: 332 $
$LastChangedBy: kutterma $
$Id: WSDL.pm 308 2007-10-05 17:35:28Z kutterma $
$Id: WSDL.pm 332 2007-10-19 07:29:03Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $
=cut
@@ -1,11 +1,11 @@
package SOAP::WSDL::Deserializer::SOAP11;
package SOAP::WSDL::Deserializer::XSD;
use strict;
use warnings;
use Class::Std::Storable;
use SOAP::WSDL::SOAP::Typelib::Fault11;
use SOAP::WSDL::Expat::MessageParser;
our $VERSION='2.00_17';
our $VERSION='2.00_21';
my %class_resolver_of :ATTR(:name<class_resolver> :default<()>);
+2 -2
View File
@@ -3,7 +3,7 @@ use strict;
use warnings;
my %DESERIALIZER = (
'1.1' => 'SOAP::WSDL::Deserializer::SOAP11',
'1.1' => 'SOAP::WSDL::Deserializer::XSD',
);
# class method
@@ -64,7 +64,7 @@ SOAP::WSDL::Deserializer tries to load one of the following classes:
=back
By default, L<SOAP::WSDL::Deserializer::SOAP11|SOAP::WSDL::Deserializer::SOAP11>
By default, L<SOAP::WSDL::Deserializer::XSD|SOAP::WSDL::Deserializer::XSD>
is registered for SOAP1.1 messages.
=head1 METHODS
+3 -3
View File
@@ -5,7 +5,7 @@ use warnings;
our $VERSION='2.00_17';
my %SERIALIZER = (
'1.1' => 'SOAP::WSDL::Serializer::SOAP11',
'1.1' => 'SOAP::WSDL::Serializer::XSD',
);
# class method
@@ -138,9 +138,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 325 $
$Rev: 329 $
$LastChangedBy: kutterma $
$Id: Serializer.pm 325 2007-10-18 10:27:46Z kutterma $
$Id: Serializer.pm 329 2007-10-18 19:42:09Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
=cut
+1 -1
View File
@@ -42,7 +42,7 @@ sub _process :PROTECTED {
%{ $arg_ref }
},
$output)
or die $tt->error();
or die $INCLUDE_PATH_of{ $ident }, '\\', $template, ' ', $tt->error();
}
+27 -1
View File
@@ -18,7 +18,29 @@ sub BUILD {
$self->set_RECURSION(1);
$self->set_INCLUDE_PATH( exists $arg_ref->{INCLUDE_PATH}
? $arg_ref->{INCLUDE_PATH}
: File::Spec->rel2abs( dirname __FILE__ ). '/XSD/'
: do {
# ignore uninitialized warnings - File::Spec warns about
# uninitialized values, probably because we have no filename
local $SIG{__WARN__} = sub {
return if ($_[0]=~m{\buninitialized\b});
CORE::warn @_;
};
# makeup path for the OS we're running on
my ($volume, $dir, $file) = File::Spec->splitpath(
File::Spec->rel2abs( dirname __FILE__ )
);
$dir = File::Spec->catdir($dir, $file, 'XSD');
# return path put together...
my $path = File::Spec->catpath( $volume, $dir );
# Fixup path for windows - / works fine, \ does
# not...
if ( eval { &Win32::BuildNumber } ) {
$path =~s{\\}{/}g;
}
$path;
}
);
}
@@ -64,6 +86,8 @@ sub generate_interface {
$service->get_name(),
$port_name,
);
print "Creating interface class $output\n";
$self->_process('Interface.tt',
{
service => $service,
@@ -96,6 +120,8 @@ sub generate_typemap {
my $output = $arg_ref->{ output }
? $arg_ref->{ output }
: $self->_generate_filename( $self->get_typemap_prefix(), $service->get_name() );
print "Creating typemap class $output\n";
$self->_process('Typemap.tt',
{
service => $service,
@@ -1,11 +1,10 @@
#!/usr/bin/perl -w
# TODO rename to ::XSD
package SOAP::WSDL::Serializer::SOAP11;
package SOAP::WSDL::Serializer::XSD;
use strict;
use warnings;
use Class::Std::Storable;
our $VERSION='2.00_13';
our $VERSION='2.00_21';
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance';
+1 -1
View File
@@ -4,7 +4,7 @@ use warnings;
use Class::Std::Storable;
use base qw(SOAP::WSDL::Base);
our $VERSION='2.00_17';
our $VERSION='2.00_22';
my %annotation_of :ATTR(:name<annotation> :default<()>);
my %simpleType_of :ATTR(:name<simpleType> :default<()>);
@@ -3,9 +3,6 @@ use strict;
use warnings;
use Class::Std::Storable;
# my %xmlns_of :ATTR(:get<xmlns> :init_arg<xmlns> :default<()>);
# sub set_xmlns { $xmlns_of{ ident $_[0] } = $_[1] };
sub get_xmlns { 'http://www.w3.org/2001/XMLSchema' };
# use $_[1] for performance
@@ -41,6 +41,7 @@ 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
return if not $_[1];
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} )?
@@ -50,7 +51,8 @@ sub set_value {
# strptime sets empty values to undef - and strftime doesn't like that...
my @time_from = map { ! defined $_ ? 0 : $_ } strptime($_[1]);
undef $time_from[-1];
return if not (@time_from);
undef $time_from[$#time_from];
my $time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from );
substr $time_str, -2, 0, ':';
+21 -17
View File
@@ -9,7 +9,7 @@ use Class::Std::Storable;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
our $VERSION = '2.00_16';
our $VERSION = '2.00_22';
my %ELEMENTS_FROM;
my %ATTRIBUTES_OF;
@@ -116,7 +116,8 @@ sub _factory {
: $is_ref eq $type
? $_[1]
: die croak "cannot use $is_ref reference as value for $name - $type required"
: $type->new({ value => $_[1] });
: $type->new({ value => $_[1] });
return;
};
*{ "$class\::add_$name" } = sub {
@@ -125,15 +126,20 @@ sub _factory {
if not defined $_[1];
# first call
return $attribute_ref->{ $ident } = $_[1]
if not defined $attribute_ref->{ $ident };
# second call: listify previous value if it's no list
$attribute_ref->{ $ident } = [ $attribute_ref->{ $ident } ]
if not ref $attribute_ref->{ $ident } eq 'ARRAY';
if (not defined $attribute_ref->{ $ident }) {
$attribute_ref->{ $ident } = $_[1];
return;
}
if (not ref $attribute_ref->{ $ident } eq 'ARRAY') {
# second call: listify previous value if it's no list
$attribute_ref->{ $ident } = [ $attribute_ref->{ $ident } ];
return;
}
# second and following: add to list
return push @{ $attribute_ref->{ $ident } }, $_[1];
push @{ $attribute_ref->{ $ident } }, $_[1];
return;
};
*{ "$class\::$name" } = *{ "$class\::add_$name" };
@@ -175,7 +181,6 @@ sub _factory {
# But what about choice, extension ?
*{ "$class\::_serialize" } = sub {
my $ident = ident $_[0];
# my $class = ref $_[0];
# return concatenated return value of serialize call of all
# elements retrieved from get_elements expanding list refs.
# get_elements is inlined for performance.
@@ -210,14 +215,13 @@ sub _factory {
};
*{ "$class\::serialize" } = sub {
my ($self, $opt) = @_;
$opt ||= {};
$_[1] ||= {}; # maybe even replace by assigning a constant var
# do we have a empty element ?
return $self->start_tag({ %$opt, empty => 1 })
return $_[0]->start_tag({ %{ $_[1] }, empty => 1 })
if not defined $ELEMENTS_FROM{ $class } or not @{ $ELEMENTS_FROM{ $class } };
return join q{}, $self->start_tag($opt),
$self->_serialize(), $self->end_tag();
return join q{}, $_[0]->start_tag($_[1]),
$_[0]->_serialize(), $_[0]->end_tag();
}
}
@@ -377,9 +381,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 323 $
$Rev: 337 $
$LastChangedBy: kutterma $
$Id: ComplexType.pm 323 2007-10-17 15:23:05Z kutterma $
$Id: ComplexType.pm 337 2007-10-22 20:04:59Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
=cut
+8
View File
@@ -8,6 +8,8 @@ my %REF;
my %MIN_OCCURS;
my %MAX_OCCURS;
# TODO replace by generated methods?
#
# Class data - remember, we're the base class for a class factory or for
# generated code...
# use BLOCK: for scoping
@@ -48,6 +50,9 @@ sub start_tag {
if ($_[1]->{qualified}) {
push @attr_from, 'xmlns="' . $_[0]->get_xmlns . '"';
}
# do we need to check for name ? Element ref="" should have it's own
# start_tag. If we don't need to check, we can speed things up
return join q{ }, "<$_[1]->{ name }" , @attr_from , $ending if $_[1]->{ name };
return join q{ }, "<$NAME{ ref $_[0]}" , @attr_from , $ending;
}
@@ -61,6 +66,9 @@ sub start_tag {
# return "</$opt->{name}>" if $opt->{name};
# return "</"$NAME{$class}>";
#
# do we need to check for name ? Element ref="" should have it's own
# end_tag. If we don't need to check, we can speed things up by defining
# end tag with () prototype - perl will inline it for us if we do...
sub end_tag {
return "</$_[1]->{name}>" if $_[1]->{name};
return "</$NAME{ ref $_[0] }>";