import SOAP-WSDL 2.00_31 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_31 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_31.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
874251225f
commit
f0b3bdc201
+16
-10
@@ -14,7 +14,7 @@ use Class::Std::Fast;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||
use LWP::UserAgent;
|
||||
|
||||
our $VERSION= '2.00_25';
|
||||
our $VERSION= '2.00_31';
|
||||
|
||||
my %no_dispatch_of :ATTR(:name<no_dispatch>);
|
||||
my %wsdl_of :ATTR(:name<wsdl>);
|
||||
@@ -176,7 +176,7 @@ sub _wsdl_init_methods :PRIVATE {
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
|
||||
# get bindings, portType, message, part(s) - use private methods for clear separation...
|
||||
$self->_wsdl_get_service if not ($service_of{ $ident });
|
||||
$self->_wsdl_get_service();
|
||||
$self->_wsdl_get_portType();
|
||||
|
||||
$method_info_of{ $ident } = {};
|
||||
@@ -187,9 +187,10 @@ sub _wsdl_init_methods :PRIVATE {
|
||||
|
||||
# get SOAP Action
|
||||
# SOAP-Action is a required HTTP Header, so we need to look it up...
|
||||
# There must be a soapAction uri - or the WSDL is invalid (and
|
||||
# it's not us to prove that...)
|
||||
my $soap_binding_operation = $binding_operation->get_operation()->[0];
|
||||
$method->{ soap_action } = $soap_binding_operation ?
|
||||
$soap_binding_operation->get_soapAction() : $method;
|
||||
$method->{ soap_action } = $soap_binding_operation->get_soapAction();
|
||||
|
||||
# get parts
|
||||
# 1. get operation from port
|
||||
@@ -204,7 +205,10 @@ sub _wsdl_init_methods :PRIVATE {
|
||||
my $message = $wsdl->find_message( $ns, $localname )
|
||||
or croak "Message {$ns}$localname not found in WSDL definition";
|
||||
|
||||
if (my $body=$binding_operation->first_input()->first_body()) {
|
||||
# Is body not required? So there must be one? Do we need the "if"?
|
||||
# if (
|
||||
my $body=$binding_operation->first_input()->first_body();
|
||||
# {
|
||||
if ($body->get_parts()) {
|
||||
$method->{ parts } = []; # make sure it's empty
|
||||
my $message_part_ref = $message->get_part();
|
||||
@@ -216,7 +220,9 @@ sub _wsdl_init_methods :PRIVATE {
|
||||
grep { $_->get_name() eq $name } @{ $message_part_ref };
|
||||
}
|
||||
}
|
||||
}
|
||||
# }
|
||||
# A body does not need to specify the parts of a messages.
|
||||
# Use all of the message's parts if it does not.
|
||||
$method->{ parts } ||= $message->get_part();
|
||||
|
||||
# rpc / encoded methods may have a namespace specified.
|
||||
@@ -329,7 +335,7 @@ SOAP client, which mimics L<SOAP::Lite|SOAP::Lite>'s API, read on.
|
||||
my $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://bla.wsdl',
|
||||
);
|
||||
|
||||
|
||||
my $result = $soap->call('MyMethod', %data);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -436,7 +442,7 @@ Class resolver
|
||||
'Person/Name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'Person/FirstName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
);
|
||||
|
||||
|
||||
sub get_class { return $typemap{ $_[1] } };
|
||||
1;
|
||||
|
||||
@@ -730,9 +736,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 477 $
|
||||
$Rev: 524 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: WSDL.pm 477 2007-12-24 10:23:52Z kutterma $
|
||||
$Id: WSDL.pm 524 2008-02-10 23:24:43Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -8,22 +8,32 @@ our $VERSION = '2.00_25';
|
||||
|
||||
sub call {
|
||||
my ($self, $method, $body, $header) = @_;
|
||||
|
||||
# Treat non-objects special
|
||||
if (not blessed $body) {
|
||||
|
||||
# make sure there's something sensible in our body data
|
||||
$body = {} if not defined $body;
|
||||
$body = ref $body eq 'ARRAY' ? $body : [ $body ];
|
||||
my $index = 0;
|
||||
my @part_from;
|
||||
foreach my $part (@{ $body }) {
|
||||
my $class = $method->{ body }->{ parts }->[$index];
|
||||
|
||||
my @body_from = @{ $body }; # make a copy
|
||||
|
||||
# build list of parts as objects initialized with
|
||||
# parameters given
|
||||
my @part_from = ();
|
||||
foreach my $class (@{ $method->{ body }->{ parts } }) {
|
||||
eval "require $class" || die $@;
|
||||
push @part_from, $class->new($part);
|
||||
$index++;
|
||||
push @part_from, $class->new(shift(@body_from) || {});
|
||||
}
|
||||
|
||||
# it's either the first part or a list ref with all parts...
|
||||
$body = $#part_from ? \@part_from : $part_from[0];
|
||||
}
|
||||
|
||||
# if we have a header
|
||||
if (%{ $method->{ header } }) {
|
||||
|
||||
# trat non object special - as above, but only for one
|
||||
if (not blessed $header) {
|
||||
my $class = $method->{ header }->{ parts }->[0];
|
||||
eval "require $class" || die $@;
|
||||
@@ -33,39 +43,6 @@ sub call {
|
||||
return $self->SUPER::call($method, $body, $header);
|
||||
}
|
||||
|
||||
#sub __create_methods {
|
||||
# my ($package, %info_of) = @_;
|
||||
#
|
||||
# no strict qw(refs);
|
||||
# no warnings qw(redefine);
|
||||
# for my $method (keys %info_of){
|
||||
# my ($soap_action, @parts);
|
||||
#
|
||||
# # up to 2.00_10 we had list refs...
|
||||
# if (ref $info_of{ $method }eq 'HASH') {
|
||||
# @parts = @{ $info_of{ $method }->{ parts } };
|
||||
# $soap_action = $info_of{ $method }->{ soap_action };
|
||||
# }
|
||||
# else {
|
||||
# die "Pre-v2.00_10 Interfaces are no longer supported. Please re-generate your interface.";
|
||||
# }
|
||||
#
|
||||
# *{ "$package\::$method" } = sub {
|
||||
# my $self = shift;
|
||||
# my @param = map {
|
||||
# my $data = shift || {};
|
||||
# eval "require $_";
|
||||
# $_->new( $data );
|
||||
# } @parts;
|
||||
#
|
||||
# return $self->SUPER::call( {
|
||||
# operation => $method,
|
||||
# soap_action => $soap_action,
|
||||
# }, @param );
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
@@ -101,9 +78,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 440 $
|
||||
$Rev: 501 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Base.pm 440 2007-12-04 22:24:33Z kutterma $
|
||||
$Id: Base.pm 501 2008-01-26 20:23:32Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -23,7 +23,8 @@ sub BUILD {
|
||||
sub deserialize {
|
||||
my ($self, $content) = @_;
|
||||
|
||||
$parser_of{ ${ $self } } ||= SOAP::WSDL::Expat::MessageParser->new();
|
||||
$parser_of{ ${ $self } } = SOAP::WSDL::Expat::MessageParser->new()
|
||||
if not $parser_of{ ${ $self } };
|
||||
$parser_of{ ${ $self } }->class_resolver( $class_resolver_of{ ident $self } );
|
||||
eval { $parser_of{ ${ $self } }->parse_string( $content ) };
|
||||
if ($@) {
|
||||
@@ -98,9 +99,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 427 $
|
||||
$Rev: 501 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: XSD.pm 427 2007-12-02 22:20:24Z kutterma $
|
||||
$Id: XSD.pm 501 2008-01-26 20:23:32Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,17 +1,47 @@
|
||||
package SOAP::WSDL::Expat::Base;
|
||||
use strict;
|
||||
use warnings;
|
||||
use URI;
|
||||
use XML::Parser::Expat;
|
||||
|
||||
# TODO: convert to Class::Std::Fast based class - hash based classes suck.
|
||||
|
||||
our $VERSION = '2.00_27';
|
||||
|
||||
sub new {
|
||||
my ($class, $args) = @_;
|
||||
my ($class, $arg_ref) = @_;
|
||||
my $self = {};
|
||||
bless $self, $class;
|
||||
|
||||
$self->set_user_agent($arg_ref->{ user_agent })
|
||||
if $arg_ref->{ user_agent };
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub set_uri { $_[0]->{ uri } = $_[1]; }
|
||||
sub get_uri { return $_[0]->{ uri }; }
|
||||
|
||||
sub set_user_agent { $_[0]->{ user_agent } = $_[1]; }
|
||||
sub get_user_agent { return $_[0]->{ user_agent }; }
|
||||
|
||||
|
||||
sub parse_uri {
|
||||
my $self = shift;
|
||||
my $uri = shift;
|
||||
$self->set_uri( $uri );
|
||||
|
||||
if (not $self->{ user_agent }) {
|
||||
require LWP::UserAgent;
|
||||
$self->{ user_agent } = LWP::UserAgent->new();
|
||||
}
|
||||
|
||||
my $response = $self->{ user_agent }->get($uri);
|
||||
|
||||
die $response->message() if $response->code() ne '200';
|
||||
return $self->parse( $response->content() );
|
||||
}
|
||||
|
||||
sub parse {
|
||||
eval {
|
||||
$_[0]->_initialize( XML::Parser::Expat->new( Namespaces => 1 ) )->parse( $_[1] );
|
||||
|
||||
@@ -128,7 +128,7 @@ sub _initialize {
|
||||
return &{$content_check{ $depth }}
|
||||
if exists $content_check{ $depth };
|
||||
|
||||
push @{ $path }, $_[1]; # step down in path
|
||||
push @{ $path }, $_[1]; # step down in path
|
||||
return if $skip; # skip inside __SKIP__
|
||||
|
||||
# resolve class of this element
|
||||
@@ -171,6 +171,7 @@ sub _initialize {
|
||||
$current = bless \$o, $_class;
|
||||
}
|
||||
|
||||
# set attributes if there are any
|
||||
$current->attr({ @_[2..$#_] }) if (@_ > 2);
|
||||
|
||||
$depth++;
|
||||
@@ -294,8 +295,8 @@ the same terms as perl itself
|
||||
|
||||
$Id: $
|
||||
|
||||
$LastChangedDate: 2008-01-19 13:57:57 +0100 (Sa, 19 Jan 2008) $
|
||||
$LastChangedRevision: 497 $
|
||||
$LastChangedDate: 2008-02-02 10:19:45 +0100 (Sa, 02 Feb 2008) $
|
||||
$LastChangedRevision: 516 $
|
||||
$LastChangedBy: kutterma $
|
||||
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
||||
|
||||
@@ -5,7 +5,57 @@ use Carp;
|
||||
use SOAP::WSDL::TypeLookup;
|
||||
use base qw(SOAP::WSDL::Expat::Base);
|
||||
|
||||
our $VERSION = q{2.00_29};
|
||||
our $VERSION = q{2.00_31};
|
||||
|
||||
sub _import_children {
|
||||
my ($self, $name, $imported, $importer, $import_namespace) = @_;
|
||||
my $targetNamespace = $importer->get_targetNamespace();
|
||||
my $push_method = "push_$name";
|
||||
my $get_method = "get_$name";
|
||||
no strict qw(refs);
|
||||
my $value_ref = $imported->$get_method();
|
||||
if ($value_ref) {
|
||||
$value_ref = [ $value_ref ] if (not ref $value_ref eq 'ARRAY');
|
||||
# set xmlns - can be different from parent
|
||||
for (@{ $value_ref }) {
|
||||
# fixup targetNamespace, but don't override
|
||||
$_->set_targetNamespace( $import_namespace )
|
||||
if ( ($import_namespace ne $targetNamespace) && ! $_->get_targetNamespace);
|
||||
# update parent...
|
||||
$_->set_parent( $importer );
|
||||
}
|
||||
# push elements into importing WSDL
|
||||
$importer->$push_method(@{ $value_ref });
|
||||
}
|
||||
}
|
||||
|
||||
sub xml_schema_import {
|
||||
my $self = shift;
|
||||
my $schema = shift;
|
||||
my $parser = ref($self)->new();
|
||||
my %attr_of = @_;
|
||||
my $import_namespace = $attr_of{ namespace };
|
||||
my $uri = URI->new_abs($attr_of{schemaLocation}, $self->get_uri() );
|
||||
my $import = $parser->parse_uri($uri);
|
||||
|
||||
for my $name ( qw(type element group) ) {
|
||||
$self->_import_children( $name, $import, $schema, $import_namespace);
|
||||
}
|
||||
}
|
||||
|
||||
sub wsdl_import {
|
||||
my $self = shift;
|
||||
my $definitions = shift;
|
||||
my $parser = ref($self)->new();
|
||||
my %attr_of = @_;
|
||||
my $import_namespace = $attr_of{ namespace };
|
||||
my $uri = URI->new_abs($attr_of{location}, $self->get_uri() );
|
||||
|
||||
my $import = $parser->parse_uri($uri);
|
||||
for my $name ( qw(types message binding portType service) ) {
|
||||
$self->_import_children( $name, $import, $definitions, $import_namespace);
|
||||
}
|
||||
}
|
||||
|
||||
sub _initialize {
|
||||
my ($self, $parser) = @_;
|
||||
@@ -81,6 +131,20 @@ sub _initialize {
|
||||
: _fixup_attrs($parser, %attrs)
|
||||
);
|
||||
}
|
||||
elsif ($action->{type} eq 'HANDLER') {
|
||||
my $method = $self->can($action->{method});
|
||||
$method->($self, $current, %attrs);
|
||||
}
|
||||
else {
|
||||
# TODO replace by hash lookup of known namespaces.
|
||||
my $namespace = $parser->namespace($localname) || q{};
|
||||
my $part = $namespace eq 'http://schemas.xmlsoap.org/wsdl/'
|
||||
? 'WSDL 1.1'
|
||||
: 'XML Schema';
|
||||
|
||||
warn "$part element <$localname> is not implemented yet"
|
||||
if ($localname !~m{ \A (:? annotation | documentation ) \z }xms );
|
||||
}
|
||||
|
||||
return;
|
||||
},
|
||||
@@ -179,8 +243,8 @@ the same terms as perl itself
|
||||
|
||||
$Id: $
|
||||
|
||||
$LastChangedDate: 2007-12-24 11:23:52 +0100 (Mo, 24 Dez 2007) $
|
||||
$LastChangedRevision: 477 $
|
||||
$LastChangedDate: 2008-02-11 00:14:27 +0100 (Mo, 11 Feb 2008) $
|
||||
$LastChangedRevision: 522 $
|
||||
$LastChangedBy: kutterma $
|
||||
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $
|
||||
|
||||
@@ -16,7 +16,7 @@ sub register {
|
||||
|
||||
sub get_deserializer {
|
||||
my ($self, $args_of_ref) = @_;
|
||||
|
||||
$args_of_ref->{ soap_version } ||= '1.1';
|
||||
# sanity check
|
||||
die "no deserializer registered for SOAP version $args_of_ref->{ soap_version }"
|
||||
if not exists ($DESERIALIZER{ $args_of_ref->{ soap_version } });
|
||||
|
||||
@@ -16,7 +16,7 @@ sub register {
|
||||
|
||||
sub get_serializer {
|
||||
my ($self, $args_of_ref) = @_;
|
||||
|
||||
$args_of_ref->{ soap_version } ||= '1.1';
|
||||
# sanity check
|
||||
die "no serializer registered for SOAP version $args_of_ref->{ soap_version }"
|
||||
if not exists ($SERIALIZER{ $args_of_ref->{ soap_version } });
|
||||
@@ -138,9 +138,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 391 $
|
||||
$Rev: 510 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Serializer.pm 391 2007-11-17 21:56:13Z kutterma $
|
||||
$Id: Serializer.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,7 +2,7 @@ package SOAP::WSDL::Factory::Transport;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION='2.00_25';
|
||||
our $VERSION='2.00_31';
|
||||
|
||||
# class data
|
||||
my %registered_transport_of = ();
|
||||
@@ -34,7 +34,7 @@ sub register {
|
||||
sub get_transport {
|
||||
my ($class, $scheme, %attrs) = @_;
|
||||
|
||||
$scheme =~s{ \A ([^\:]+) \: .+ }{$1}smx;
|
||||
$scheme =~s{ \A ([^\:]+) \: .+ }{$1}x;
|
||||
|
||||
if ($registered_transport_of{ $scheme }) {
|
||||
no strict qw(refs);
|
||||
@@ -96,12 +96,12 @@ SOAP::WSDL::Factory::Transport - Factory for retrieving transport objects
|
||||
# in transport class:
|
||||
package MyWickedTransport;
|
||||
use SOAP::WSDL::Factory::Transport;
|
||||
|
||||
|
||||
# register class as transport module for httpr and https
|
||||
# (httpr is "reliable http", a protocol developed by IBM).
|
||||
SOAP::WSDL::Factory::Transport->register( 'httpr' , __PACKAGE__ );
|
||||
SOAP::WSDL::Factory::Transport->register( 'https' , __PACKAGE__ );
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SOAP::WSDL::Transport serves as factory for retrieving transport objects for
|
||||
@@ -207,10 +207,10 @@ classes in one file, and to follow this naming scheme:
|
||||
|
||||
Module name:
|
||||
"SOAP::Transport::" . uc($scheme)
|
||||
|
||||
|
||||
Client class (additional package in module):
|
||||
"SOAP::Transport::" . uc($scheme) . "::Client"
|
||||
|
||||
|
||||
Server class (additional package in module):
|
||||
"SOAP::Transport::" . uc($scheme) . "::Client"
|
||||
|
||||
@@ -240,9 +240,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 459 $
|
||||
$Rev: 524 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Transport.pm 459 2007-12-16 16:00:14Z kutterma $
|
||||
$Id: Transport.pm 524 2008-02-10 23:24:43Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
@@ -9,7 +9,12 @@ ELSIF (complexType.get_variety == 'choice');
|
||||
INCLUDE complexType/all.tt(complexType = complexType);
|
||||
ELSIF (complexType.get_variety);
|
||||
THROW NOT_IMPLEMENTED, "Unknown variety ${ complexType.get_variety } in ${ complexType.get_name } (${ element.get_name })";
|
||||
ELSE;
|
||||
# There's no variety - might be empty complexType
|
||||
END;
|
||||
%]
|
||||
ELSE %]
|
||||
|
||||
# There's no variety - empty complexType
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
|
||||
__PACKAGE__->_factory();
|
||||
|
||||
[% END %]
|
||||
@@ -34,11 +34,11 @@ considered as bugs.
|
||||
=item * RULES NOT APPLICABLE
|
||||
|
||||
WS-I Basic Profile contains rules for web services as a whole. SOAP::WSDL only
|
||||
plays the part of one layer in a Web Service CONSUMER, thus does not implement
|
||||
some parts the WS-I Basic Profile references.
|
||||
plays the part of one layer in a Web Service CONSUMER / RECEIVER, thus does
|
||||
not implement some parts the WS-I Basic Profile references.
|
||||
|
||||
This section contains rules not applicable for SOAP::WSDL, because they refer
|
||||
parts to web service SOAP::WSDL does not implement.
|
||||
to parts SOAP::WSDL does not implement.
|
||||
|
||||
=back
|
||||
|
||||
@@ -427,9 +427,10 @@ TODO support rpc-literal bindings.
|
||||
In a DESCRIPTION the value of the location attribute of a wsdl:import element
|
||||
SHOULD be treated as a hint.
|
||||
|
||||
SOAP::WSDL's schema parser does not handle import elements yet.
|
||||
The wsdl:import element imports the referenced WSDL definition.
|
||||
|
||||
TODO implement support for wsdl:import in SOAP::WSDL::Expat::WSDLParser.
|
||||
This is rather hard-wired and does not allow to specify a wsdl:import without
|
||||
a resolvable location.
|
||||
|
||||
=head2 R4002
|
||||
|
||||
@@ -448,9 +449,7 @@ TODO Test whether UTF-16 works.
|
||||
The wsdl:documentation element MAY occur as a child of the wsdl:import
|
||||
element in a DESCRIPTION.
|
||||
|
||||
SOAP::WSDL's schema parser does not handle import elements yet.
|
||||
|
||||
TODO implement support for wsdl:import in SOAP::WSDL::Expat::WSDLParser.
|
||||
Not tested yet.
|
||||
|
||||
=head2 R2024
|
||||
|
||||
@@ -681,7 +680,11 @@ is Schema valid.
|
||||
A DESCRIPTION MUST only use the WSDL "import" statement to import another
|
||||
WSDL description.
|
||||
|
||||
SOAP::WSDL has no means of generating WSDL definitions
|
||||
SOAP::WSDL (partially) supports the wsdl:import statement. The wsdl:include
|
||||
statement is not supported (yet).
|
||||
|
||||
It's the responsibility of the WSDL author to use only the wsdl:import
|
||||
statement for importing WSDL descriptions.
|
||||
|
||||
=head2 R2002
|
||||
|
||||
@@ -1249,9 +1252,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 478 $
|
||||
$Rev: 514 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: WS_I.pod 478 2007-12-27 14:15:01Z kutterma $
|
||||
$Id: WS_I.pod 514 2008-01-31 19:57:52Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -5,6 +5,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use Scalar::Util qw(blessed);
|
||||
our $VERSION=q{2.00_27};
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
|
||||
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
|
||||
my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance';
|
||||
@@ -119,9 +120,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 477 $
|
||||
$Rev: 510 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: XSD.pm 477 2007-12-24 10:23:52Z kutterma $
|
||||
$Id: XSD.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,11 +2,15 @@ package SOAP::WSDL::TypeLookup;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
our $VERSION=q{2.00_31};
|
||||
|
||||
my %TYPES = (
|
||||
# wsdl:
|
||||
'http://schemas.xmlsoap.org/wsdl/' => {
|
||||
'import' => {
|
||||
type => 'HANDLER',
|
||||
method => 'wsdl_import',
|
||||
},
|
||||
binding => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Binding',
|
||||
@@ -83,6 +87,10 @@ my %TYPES = (
|
||||
}
|
||||
},
|
||||
'http://www.w3.org/2001/XMLSchema' => {
|
||||
'import' => {
|
||||
type => 'HANDLER',
|
||||
method => 'xml_schema_import',
|
||||
},
|
||||
schema => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::XSD::Schema',
|
||||
|
||||
@@ -18,7 +18,7 @@ sub serialize {
|
||||
my $prefix = $prefix_of{ $ns }
|
||||
|| die 'No prefix found for namespace '. $ns;
|
||||
$xml .= ' type="' . $prefix . ':'
|
||||
. $self->get_name() . '"' if ($self->get_name() );
|
||||
. $self->get_name() . '"';
|
||||
}
|
||||
|
||||
if (defined $value) {
|
||||
|
||||
@@ -6,7 +6,7 @@ use Class::Std::Fast::Storable;
|
||||
use Scalar::Util qw(blessed);
|
||||
use base qw/SOAP::WSDL::Base/;
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
our $VERSION=q{2.00_29};
|
||||
|
||||
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
||||
my %attribute_of :ATTR(:name<attribute> :default<()>);
|
||||
|
||||
@@ -53,7 +53,7 @@ sub serialize {
|
||||
# TODO: implement final and substitutionGroup - maybe never implement
|
||||
# substitutionGroup ?
|
||||
|
||||
$name ||= $self->get_name();
|
||||
$name = $self->get_name() if not ($name);
|
||||
|
||||
if ( $opt->{ qualify } ) {
|
||||
$opt->{ attributes } = [ ' xmlns="' . $self->get_targetNamespace .'"' ];
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Element);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
|
||||
sub start_tag {
|
||||
# my ($self, $opt, $value) = @_;
|
||||
return q{} if (@_ < 3);
|
||||
|
||||
@@ -3,6 +3,8 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
|
||||
sub serialize {
|
||||
# we work on @_ for performance.
|
||||
$_[1] ||= {}; # $option_ref
|
||||
|
||||
@@ -9,7 +9,7 @@ require Class::Std::Fast::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
||||
|
||||
our $VERSION = '2.00_29';
|
||||
our $VERSION = '2.00_31';
|
||||
|
||||
my %ELEMENTS_FROM;
|
||||
my %ATTRIBUTES_OF;
|
||||
@@ -45,6 +45,10 @@ my %xml_attr_of :ATTR();
|
||||
sub attr {
|
||||
my $self = shift;
|
||||
my $class = ref $self;
|
||||
|
||||
# disable strictness - in perl 5.10 %{ "$foo\::_bar" } triggers a
|
||||
# symbolic reference error with strictness enabled
|
||||
no strict qw(refs);
|
||||
die "$class has no attributes" if not defined %{ "$class\::_ATTR::"};
|
||||
if (@_) {
|
||||
# setter
|
||||
@@ -176,7 +180,7 @@ sub _factory {
|
||||
: die croak "cannot use $is_ref reference as value for $name - $type required"
|
||||
|
||||
# not $is_ref
|
||||
: $type->new({ value => $_[1] });
|
||||
: defined $_[1] ? $type->new({ value => $_[1] }) : () ;
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -223,7 +227,7 @@ sub _factory {
|
||||
: $_ =~ m{ \A # beginning of string
|
||||
xmlns # xmlns
|
||||
}xms # get_elements is inlined for performance.
|
||||
? do {}
|
||||
? ()
|
||||
: do { use Data::Dumper;
|
||||
croak "unknown field $_ in $class. Valid fields are:\n"
|
||||
. join(', ', @{ $ELEMENTS_FROM{ $class } }) . "\n"
|
||||
@@ -455,9 +459,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 497 $
|
||||
$Rev: 524 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: ComplexType.pm 497 2008-01-19 12:57:57Z kutterma $
|
||||
$Id: ComplexType.pm 524 2008-02-10 23:24:43Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -175,9 +175,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 497 $
|
||||
$Rev: 498 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Element.pm 497 2008-01-19 12:57:57Z kutterma $
|
||||
$Id: Element.pm 498 2008-01-20 22:47:18Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
|
||||
|
||||
=cut
|
||||
|
||||
Reference in New Issue
Block a user