import SOAP-WSDL 2.00.01 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00.01 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.01.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
0cbf981665
commit
745ce925c1
+18
-14
@@ -14,7 +14,7 @@ use Class::Std::Fast;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||
use LWP::UserAgent;
|
||||
|
||||
our $VERSION= '2.00_33';
|
||||
use version; our $VERSION= qv('2.00.01');
|
||||
|
||||
my %no_dispatch_of :ATTR(:name<no_dispatch>);
|
||||
my %wsdl_of :ATTR(:name<wsdl>);
|
||||
@@ -512,7 +512,7 @@ it's content.
|
||||
The object tree has two main functions: It knows how to serialize data passed
|
||||
as hash ref, and how to render the WSDL elements found into perl classes.
|
||||
|
||||
Yup your're right, there's a builting code generation facility. Read
|
||||
Yup you're right; there's a builtin code generation facility. Read
|
||||
L<SOAP::WSDL::Manual> for using it.
|
||||
|
||||
=item * no_dispatch
|
||||
@@ -595,7 +595,7 @@ See L<class_resolver|class_resolver> above.
|
||||
|
||||
=item * Hash refs
|
||||
|
||||
This is for convnience: A single hash ref containing the content of the
|
||||
This is for convenience: A single hash ref containing the content of the
|
||||
SOAP body.
|
||||
|
||||
=item * xml
|
||||
@@ -675,13 +675,13 @@ interpreting mod:
|
||||
simpleContent
|
||||
|
||||
The following XML Schema definition content model is only partially
|
||||
supported:
|
||||
supported in interpreting mode:
|
||||
|
||||
complexContent - only restriction variety supported
|
||||
|
||||
See L<SOAP::WSDL::Manual::XSD> for details.
|
||||
|
||||
=item * Serialization of hash refs dos not work for ambiguos values
|
||||
=item * Serialization of hash refs does not work for ambiguous values
|
||||
|
||||
If you have list elements with multiple occurences allowed, SOAP::WSDL
|
||||
has no means of finding out which variant you meant.
|
||||
@@ -691,17 +691,17 @@ Passing in item => [1,2,3] could serialize to
|
||||
<item>1 2</item><item>3</item>
|
||||
<item>1</item><item>2 3</item>
|
||||
|
||||
Ambiguos data can be avoided by providing data as objects.
|
||||
Ambiguous data can be avoided by providing data as objects.
|
||||
|
||||
=item * XML Schema facets
|
||||
|
||||
Almost no XML schema facets are implemented yet. The only facets
|
||||
Almost no XML schema facets are implemented. The only facets
|
||||
currently implemented are:
|
||||
|
||||
fixed
|
||||
default
|
||||
|
||||
The following facets have no influence yet:
|
||||
The following facets have no influence:
|
||||
|
||||
minLength
|
||||
maxLength
|
||||
@@ -725,10 +725,10 @@ The following facets have no influence yet:
|
||||
Full featured SOAP-library, little WSDL support. Supports rpc-encoded style
|
||||
only. Many protocols supported.
|
||||
|
||||
=item * L<XML::Compile::WSDL|XML::Compile::WSDL> / L<XML::Compile::SOAP|XML::Compile::SOAP>
|
||||
=item * L<XML::Compile::SOAP|XML::Compile::SOAP>
|
||||
|
||||
Creates parser/generator functions for SOAP messages. Includes SOAP Client
|
||||
and Server implementatios.
|
||||
and Server implementations. Can validate XML messages.
|
||||
|
||||
You might want to give it a try, especially if you need to adhere very
|
||||
closely to the XML Schema / WSDL specs.
|
||||
@@ -762,7 +762,7 @@ Peter Orvos, Mark Overmeer, Jon Robens, Isidro Vila Verde and Glenn Wood
|
||||
(in alphabetical order) spotted bugs and/or suggested improvements in
|
||||
the 1.2x releases.
|
||||
|
||||
Andreas 'ac0v' Specht constantly asked for better performance.
|
||||
Noah Robin contirbuted lots of documentation fixes, and the mod_perl server.
|
||||
|
||||
JT Justman and Noah Robin provided early feedback and bug reports for
|
||||
the 2.xx pre-releases.
|
||||
@@ -770,7 +770,11 @@ the 2.xx pre-releases.
|
||||
Adam Kennedy checked and suggested improvements on metadata and dependencies
|
||||
in the 2.xx pre-releases.
|
||||
|
||||
CPAN Testers have provided most valuable (automated) feedback. Thanks.
|
||||
Andreas 'ac0v' Specht constantly asked for better performance.
|
||||
|
||||
Matt S. Trout encouraged me "to get a non-dev-release out."
|
||||
|
||||
CPAN Testers provided most valuable (automated) feedback. Thanks a lot.
|
||||
|
||||
Numerous people sent me their real-world WSDL files for testing. Thank you.
|
||||
|
||||
@@ -792,9 +796,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 583 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: WSDL.pm 583 2008-03-24 07:44:06Z kutterma $
|
||||
$Id: WSDL.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -5,7 +5,7 @@ use Class::Std::Fast::Storable;
|
||||
use List::Util qw(first);
|
||||
use Carp qw(croak carp confess);
|
||||
|
||||
our $VERSION='2.00_27';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %id_of :ATTR(:name<id> :default<()>);
|
||||
my %lang_of :ATTR(:name<lang> :default<()>);
|
||||
|
||||
@@ -5,6 +5,8 @@ use Class::Std::Fast::Storable;
|
||||
use List::Util qw(first);
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
my %transport_of :ATTR(:name<transport> :default<()>);
|
||||
|
||||
@@ -11,7 +11,7 @@ use SOAP::WSDL::Factory::Serializer;
|
||||
use SOAP::WSDL::Factory::Transport;
|
||||
use SOAP::WSDL::Expat::MessageParser;
|
||||
|
||||
our $VERSION = '2.00_27';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %class_resolver_of :ATTR(:name<class_resolver> :default<()>);
|
||||
my %no_dispatch_of :ATTR(:name<no_dispatch> :default<()>);
|
||||
@@ -259,10 +259,10 @@ You probably should not use a character encoding different from utf8:
|
||||
SOAP::WSDL::Client will not convert the request into a different encoding
|
||||
(yet).
|
||||
|
||||
To leave out the encoding, just set the content type without appendet charset
|
||||
like in
|
||||
To leave out the encoding, just set the content type without appending charset
|
||||
like this:
|
||||
|
||||
text/xml
|
||||
$soap->set_content_type('text/xml');
|
||||
|
||||
Default:
|
||||
|
||||
@@ -271,7 +271,7 @@ Default:
|
||||
=head2 Features different from SOAP::Lite
|
||||
|
||||
SOAP::WSDL does not aim to be a complete replacement for SOAP::Lite - the
|
||||
SOAP::Lite module has it's strengths and weaknesses and SOAP::WSDL is
|
||||
SOAP::Lite module has its strengths and weaknesses and SOAP::WSDL is
|
||||
designed as a cure for the weakness of little WSDL support - nothing more,
|
||||
nothing less.
|
||||
|
||||
@@ -283,7 +283,7 @@ A few things are quite different from SOAP::Lite, though:
|
||||
|
||||
=head3 SOAP request data
|
||||
|
||||
SOAP request data may either be given as message object, or as hash ref (in
|
||||
SOAP request data may either be given as message object, or as a hash ref (in
|
||||
which case it will automatically be encoded into a message object).
|
||||
|
||||
=head3 Return values
|
||||
@@ -303,7 +303,7 @@ The fault object is a SOAP1.1 fault object of the following
|
||||
C<SOAP::WSDL::SOAP::Typelib::Fault11>.
|
||||
|
||||
SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context, so
|
||||
you can just do something like
|
||||
you can just do something like:
|
||||
|
||||
my $result = $soap->call($method, $data);
|
||||
|
||||
@@ -360,9 +360,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 455 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Client.pm 455 2007-12-14 15:50:16Z kutterma $
|
||||
$Id: Client.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use base 'SOAP::WSDL::Client';
|
||||
use Scalar::Util qw(blessed);
|
||||
|
||||
our $VERSION = '2.00_33';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub call {
|
||||
my ($self, $method, $body, $header) = @_;
|
||||
@@ -78,9 +78,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 542 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Base.pm 542 2008-02-18 09:38:06Z kutterma $
|
||||
$Id: Base.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -9,7 +9,7 @@ use List::Util qw(first);
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION='2.00_33';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %types_of :ATTR(:name<types> :default<[]>);
|
||||
my %message_of :ATTR(:name<message> :default<[]>);
|
||||
@@ -118,9 +118,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 549 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Definitions.pm 549 2008-02-20 10:14:26Z kutterma $
|
||||
$Id: Definitions.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Definitions.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -8,7 +8,7 @@ use SOAP::WSDL::Expat::Message2Hash;
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
SOAP::WSDL::Factory::Deserializer->register( '1.1', __PACKAGE__ );
|
||||
|
||||
our $VERSION='2.00_25';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub BUILD {
|
||||
my ($self, $ident, $args_of_ref) = @_;
|
||||
@@ -54,7 +54,7 @@ SOAP::WSDL::Deserializer::Hash - Deserializer SOAP messages into perl hash refs
|
||||
|
||||
use SOAP::WSDL;
|
||||
use SOAP::WSDL::Deserializer::Hash;
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Deserializer for creating perl hash refs as result of a SOAP call.
|
||||
@@ -152,9 +152,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 427 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Hash.pm 427 2007-12-02 22:20:24Z kutterma $
|
||||
$Id: Hash.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/Hash.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,7 +2,7 @@ package SOAP::WSDL::Deserializer::SOM;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION = '2.00_24';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
our @ISA;
|
||||
|
||||
eval {
|
||||
@@ -37,7 +37,7 @@ SOAP::WSDL::Deserializer::SOM - Deserializer SOAP messages into SOM objects
|
||||
use SOAP::WSDL::Deserializer::SOM;
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
SOAP::WSDL::Factory::Deserializer->register( '1.1', __PACKAGE__ );
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Deserializer for creating SOAP::Lite's SOM object as result of a SOAP call.
|
||||
@@ -68,11 +68,11 @@ from the L<SOAP::Lite|SOAP::Lite> package.
|
||||
|
||||
=head1 USAGE
|
||||
|
||||
SOAP::WSDL::Deserializer will not auroregister itself - to use it for a particular
|
||||
SOAP::WSDL::Deserializer will not autoregister itself - to use it for a particular
|
||||
SOAP version just use the following lines:
|
||||
|
||||
my $soap_version = '1.1'; # or '1.2', further versions may appear.
|
||||
|
||||
|
||||
use SOAP::WSDL::Deserializer::SOM;
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
SOAP::WSDL::Factory::Deserializer->register( $soap_version, __PACKAGE__ );
|
||||
@@ -114,9 +114,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 391 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: SOM.pm 391 2007-11-17 21:56:13Z kutterma $
|
||||
$Id: SOM.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/SOM.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -5,7 +5,7 @@ use Class::Std::Fast::Storable;
|
||||
use SOAP::WSDL::SOAP::Typelib::Fault11;
|
||||
use SOAP::WSDL::Expat::MessageParser;
|
||||
|
||||
our $VERSION='2.00_25';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %class_resolver_of :ATTR(:name<class_resolver> :default<()>);
|
||||
|
||||
@@ -72,7 +72,7 @@ Usually you don't need to do anything to use this package - it's the default
|
||||
deserializer for SOAP::WSDL::Client and interface classes generated by
|
||||
SOAP::WSDL.
|
||||
|
||||
Is you want to use the XSD serializer from SOAP::WSDL, set the outputtree()
|
||||
If you want to use the XSD serializer from SOAP::WSDL, set the outputtree()
|
||||
property and provide a class_resolver.
|
||||
|
||||
=head1 METHODS
|
||||
@@ -99,9 +99,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 501 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: XSD.pm 501 2008-01-26 20:23:32Z kutterma $
|
||||
$Id: XSD.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -6,7 +6,7 @@ use XML::Parser::Expat;
|
||||
|
||||
# TODO: convert to Class::Std::Fast based class - hash based classes suck.
|
||||
|
||||
our $VERSION = '2.00_32';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub new {
|
||||
my ($class, $arg_ref) = @_;
|
||||
|
||||
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::Expat::Base);
|
||||
|
||||
our $VERSION = '2.00_27';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub _initialize {
|
||||
my ($self, $parser) = @_;
|
||||
@@ -21,7 +21,7 @@ sub _initialize {
|
||||
my ($_element, $_method,
|
||||
$_class, $_parser, %_attrs) = ();
|
||||
|
||||
no strict qw(refs);
|
||||
# no strict qw(refs);
|
||||
$parser->setHandlers(
|
||||
Start => sub {
|
||||
push @$list, $current;
|
||||
|
||||
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use Carp qw(croak confess);
|
||||
|
||||
our $VERSION = q{2.00_27};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||
@@ -24,8 +24,12 @@ sub new {
|
||||
};
|
||||
|
||||
bless $self, $class;
|
||||
$self->load_classes() if ($args->{ class_resolver })
|
||||
&& ! exists $LOADED_OF{ $self->{ class_resolver } };
|
||||
|
||||
# could be written as && - but Devel::Cover doesn't like that
|
||||
if ($args->{ class_resolver }) {
|
||||
$self->load_classes()
|
||||
if ! exists $LOADED_OF{ $self->{ class_resolver } };
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
@@ -162,6 +166,9 @@ sub _initialize {
|
||||
# (circumventing constructor) here.
|
||||
# That's dirty, but fast.
|
||||
#
|
||||
# TODO: check whether this is faster under all perls - there's
|
||||
# strange benchmark results...
|
||||
#
|
||||
# The alternative would read:
|
||||
# $current = $_class->new({ @_[2..$#_] });
|
||||
#
|
||||
@@ -172,8 +179,20 @@ sub _initialize {
|
||||
}
|
||||
|
||||
# set attributes if there are any
|
||||
$current->attr({ @_[2..$#_] }) if (@_ > 2);
|
||||
|
||||
ATTR: {
|
||||
if (@_ > 2) {
|
||||
# die Data::Dumper::Dumper(@_[2..$#_]);
|
||||
my %attr = @_[2..$#_];
|
||||
if (my $nil = delete $attr{nil}) {
|
||||
# TODO: check namespace
|
||||
if ($nil && $nil ne 'false') {
|
||||
undef $characters;
|
||||
last ATTR if not (%attr);
|
||||
}
|
||||
}
|
||||
$current->attr(\%attr);
|
||||
}
|
||||
}
|
||||
$depth++;
|
||||
return;
|
||||
},
|
||||
@@ -194,13 +213,6 @@ sub _initialize {
|
||||
|
||||
$depth--;
|
||||
|
||||
# return if there's only one elment - can't set it in parent ;-)
|
||||
# but set as root element if we don't have one already.
|
||||
if (not defined $list->[-1]) {
|
||||
$self->{ data } = $current if (not exists $self->{ data });
|
||||
return;
|
||||
};
|
||||
|
||||
# we only set character values in leaf nodes
|
||||
if ($_leaf) {
|
||||
# Use dirty but fast access via global variables.
|
||||
@@ -210,12 +222,20 @@ sub _initialize {
|
||||
# $current->set_value( $characters ) if (length($characters));
|
||||
#
|
||||
$SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType::___value
|
||||
->{ $$current } = $characters if $characters =~m{ [^\s] }xms;
|
||||
->{ $$current } = $characters
|
||||
if defined $characters && defined $current; # =~m{ [^\s] }xms;
|
||||
}
|
||||
|
||||
# empty characters
|
||||
$characters = q{};
|
||||
|
||||
# return if there's only one elment - can't set it in parent ;-)
|
||||
# but set as root element if we don't have one already.
|
||||
if (not defined $list->[-1]) {
|
||||
$self->{ data } = $current if (not exists $self->{ data });
|
||||
return;
|
||||
};
|
||||
|
||||
# set appropriate attribute in last element
|
||||
# multiple values must be implemented in base class
|
||||
# $_method = "add_$_localname";
|
||||
@@ -295,8 +315,8 @@ the same terms as perl itself
|
||||
|
||||
$Id: $
|
||||
|
||||
$LastChangedDate: 2008-03-29 22:38:55 +0100 (Sa, 29 Mrz 2008) $
|
||||
$LastChangedRevision: 585 $
|
||||
$LastChangedDate: 2008-04-22 23:51:49 +0200 (Di, 22 Apr 2008) $
|
||||
$LastChangedRevision: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
||||
|
||||
@@ -6,7 +6,7 @@ use XML::Parser::Expat;
|
||||
use SOAP::WSDL::Expat::MessageParser;
|
||||
use base qw(SOAP::WSDL::Expat::MessageParser);
|
||||
|
||||
our $VERSION = '2.00_24';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub parse_start {
|
||||
my $self = shift;
|
||||
@@ -43,7 +43,7 @@ SOAP::WSDL::Expat::MessageStreamParser - Convert SOAP messages to custom object
|
||||
# process response while it comes in, trying to read 32k chunks.
|
||||
$lwp->request( $request, sub { $chunk_parser->parse_more($_[0]) } , 32468 );
|
||||
$chunk_parser->parse_done();
|
||||
|
||||
|
||||
my $obj = $parser->get_data();
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -69,9 +69,9 @@ the same terms as perl itself
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 477 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: MessageStreamParser.pm 477 2007-12-24 10:23:52Z kutterma $
|
||||
$Id: MessageStreamParser.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
@@ -5,7 +5,7 @@ use Carp;
|
||||
use SOAP::WSDL::TypeLookup;
|
||||
use base qw(SOAP::WSDL::Expat::Base);
|
||||
|
||||
our $VERSION = q{2.00_32};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub _import_children {
|
||||
my ($self, $name, $imported, $importer, $import_namespace) = @_;
|
||||
@@ -279,10 +279,10 @@ the same terms as perl itself
|
||||
|
||||
=head1 Repository information
|
||||
|
||||
$Id: WSDLParser.pm 549 2008-02-20 10:14:26Z kutterma $
|
||||
$Id: WSDLParser.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
|
||||
$LastChangedDate: 2008-02-20 11:14:26 +0100 (Mi, 20 Feb 2008) $
|
||||
$LastChangedRevision: 549 $
|
||||
$LastChangedDate: 2008-04-22 23:51:49 +0200 (Di, 22 Apr 2008) $
|
||||
$LastChangedRevision: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $
|
||||
|
||||
@@ -2,7 +2,7 @@ package SOAP::WSDL::Factory::Deserializer;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION = '2.00_24';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %DESERIALIZER = (
|
||||
'1.1' => 'SOAP::WSDL::Deserializer::XSD',
|
||||
@@ -47,10 +47,10 @@ SOAP::WSDL::Factory::Deserializer - Factory for retrieving Deserializer objects
|
||||
# in deserializer class:
|
||||
package MyWickedDeserializer;
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
|
||||
|
||||
# register class as deserializer for SOAP1.2 messages
|
||||
SOAP::WSDL::Factory::Deserializer->register( '1.2' , __PACKAGE__ );
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SOAP::WSDL::Factory::Deserializer serves as factory for retrieving
|
||||
@@ -150,5 +150,5 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Serializer.pm 176 2007-08-31 15:28:29Z kutterma $
|
||||
$HeadURL: https://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::Generator;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION='2.00_24';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %GENERATOR = (
|
||||
'XSD' => 'SOAP::WSDL::Generator::Template::XSD',
|
||||
@@ -49,10 +49,10 @@ SOAP::WSDL::Factory:Generator - Factory for retrieving generator objects
|
||||
# in generator class:
|
||||
package MyWickedGenerator;
|
||||
use SOAP::WSDL::Factory::Generator;
|
||||
|
||||
|
||||
# register as generator for SOAP1.2 messages
|
||||
SOAP::WSDL::Factory::Generator->register( '1.2' , __PACKAGE__ );
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SOAP::WSDL::Factory::Generator serves as factory for retrieving
|
||||
@@ -168,5 +168,5 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Serializer.pm 176 2007-08-31 15:28:29Z kutterma $
|
||||
$HeadURL: https://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::Serializer;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION='2.00_24';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %SERIALIZER = (
|
||||
'1.1' => 'SOAP::WSDL::Serializer::XSD',
|
||||
@@ -46,10 +46,10 @@ SOAP::WSDL::Factory::Serializer - Factory for retrieving serializer objects
|
||||
# in serializer class:
|
||||
package MyWickedSerializer;
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
|
||||
|
||||
# register as serializer for SOAP1.2 messages
|
||||
SOAP::WSDL::Factory::Serializer->register( '1.2' , __PACKAGE__ );
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SOAP::WSDL::Factory::Serializer serves as factory for retrieving
|
||||
@@ -138,9 +138,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 510 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Serializer.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||
$Id: Serializer.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package SOAP::WSDL::Factory::Transport;
|
||||
use strict;
|
||||
use warnings;
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
our $VERSION='2.00_33';
|
||||
|
||||
# class data
|
||||
my %registered_transport_of = ();
|
||||
|
||||
# Local constants
|
||||
@@ -32,14 +30,17 @@ sub register {
|
||||
}
|
||||
|
||||
sub get_transport {
|
||||
my ($class, $scheme, %attrs) = @_;
|
||||
my ($class, $url, %attrs) = @_;
|
||||
|
||||
$scheme =~s{ \A ([^\:]+) \: .+ }{$1}x;
|
||||
|
||||
if ($registered_transport_of{ $scheme }) {
|
||||
my $scheme = $url;
|
||||
$scheme =~s{ \:.+$ }{}xm;
|
||||
|
||||
|
||||
if (defined $registered_transport_of{ $scheme }) {
|
||||
no strict qw(refs);
|
||||
defined %{ "$registered_transport_of{ $scheme }::" }
|
||||
or eval "require $registered_transport_of{ $scheme }"
|
||||
defined %{ "$registered_transport_of{ $scheme }::" } or
|
||||
eval "require $registered_transport_of{ $scheme }"
|
||||
or die "Cannot load transport class $registered_transport_of{ $scheme } : $@";
|
||||
|
||||
# try "foo::Client" class first - SOAP::Tranport always requires
|
||||
@@ -50,28 +51,30 @@ sub get_transport {
|
||||
# sparse resource ...
|
||||
# ... but we've decided to mimic SOAP::Lite...
|
||||
|
||||
# my $protocol_class = $SOAP_LITE_TRANSPORT_OF{ $scheme } . '::Client';
|
||||
# my $transport;
|
||||
# eval {
|
||||
# $transport = $protocol_class->new( %attrs );
|
||||
# };
|
||||
# return $transport if not $@;
|
||||
return $registered_transport_of{ $scheme }->new( %attrs );
|
||||
}
|
||||
|
||||
# try SOAP::Lite's Transport module - just skip if not require'able
|
||||
SOAP_Lite: {
|
||||
if (exists $SOAP_LITE_TRANSPORT_OF{ $scheme }) {
|
||||
eval "require $SOAP_LITE_TRANSPORT_OF{ $scheme }"
|
||||
or last SOAP_Lite;
|
||||
my $protocol_class = $SOAP_LITE_TRANSPORT_OF{ $scheme } . '::Client';
|
||||
return $protocol_class->new( %attrs );
|
||||
}
|
||||
if (exists $SOAP_LITE_TRANSPORT_OF{ $scheme }) {
|
||||
no strict qw(refs);
|
||||
# behaves interestingly different under different versions of perl
|
||||
# maybe true even if it's not available
|
||||
defined %{ "$SOAP_LITE_TRANSPORT_OF{ $scheme }::" }
|
||||
or eval "require $SOAP_LITE_TRANSPORT_OF{ $scheme }"
|
||||
or last SOAP_Lite;
|
||||
|
||||
my $protocol_class = $SOAP_LITE_TRANSPORT_OF{ $scheme } . '::Client';
|
||||
# may fail if it's not available
|
||||
my $transport = eval { $protocol_class->new( %attrs ) }
|
||||
or last SOAP_Lite;
|
||||
return $transport;
|
||||
}
|
||||
}
|
||||
|
||||
if (exists $SOAP_WSDL_TRANSPORT_OF{ $scheme }) {
|
||||
no strict qw(refs);
|
||||
defined %{ "$SOAP_WSDL_TRANSPORT_OF{ $scheme }::" }
|
||||
defined %{ "$SOAP_WSDL_TRANSPORT_OF{ $scheme }::"}
|
||||
or eval "require $SOAP_WSDL_TRANSPORT_OF{ $scheme }"
|
||||
or die "Cannot load transport class $SOAP_WSDL_TRANSPORT_OF{ $scheme } : $@";
|
||||
return $SOAP_WSDL_TRANSPORT_OF{ $scheme }->new( %attrs );
|
||||
@@ -159,7 +162,7 @@ the class should be used for, and $module is the class' module name.
|
||||
To auto-register your transport class on loading, execute register() in your
|
||||
tranport class (see L<SYNOPSIS|SYNOPSIS> above).
|
||||
|
||||
Multiple protocols ore multiple classes are registered by multiple calls to
|
||||
Multiple protocols or multiple classes are registered by multiple calls to
|
||||
register().
|
||||
|
||||
=head2 Transport plugin package layout
|
||||
@@ -240,9 +243,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 579 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Transport.pm 579 2008-03-09 18:39:24Z kutterma $
|
||||
$Id: Transport.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,6 +2,8 @@ package SOAP::WSDL::Generator::Iterator::WSDL11;
|
||||
use strict; use warnings;
|
||||
use Class::Std::Fast;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %definitions_of :ATTR(:name<definitions> :default<[]>);
|
||||
my %nodes_of :ATTR(:name<nodes> :default<[]>);
|
||||
|
||||
@@ -242,8 +244,8 @@ The nodes are returned in the order denoted in the following example:
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
You should not rely too much on this order - it may change. Even though, the
|
||||
current order will probably remain, but the nodes currently skipped might
|
||||
You should not rely too much on this order - it may change. Even though the
|
||||
current order will probably remain, the nodes currently skipped might
|
||||
be returned somewhere along the path.
|
||||
|
||||
|
||||
|
||||
@@ -3,20 +3,26 @@ use strict; use warnings;
|
||||
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %namespace_prefix_map_of :ATTR(:name<namespace_prefix_map> :default<{}>);
|
||||
my %namespace_map_of :ATTR(:name<namespace_map> :default<{}>);
|
||||
my %prefix_of :ATTR(:name<prefix> :default<{}>);
|
||||
|
||||
sub resolve_prefix {
|
||||
my ($self, $type, $namespace, $element) = @_;
|
||||
return $prefix_of{ $$self }->{ $type }
|
||||
if not defined($namespace);
|
||||
return $namespace_prefix_map_of{ $$self }->{ $namespace }
|
||||
|| ( ($namespace_map_of{ $$self }->{ $namespace })
|
||||
? join ('::', $prefix_of{ $$self }->{ $type }, $namespace_map_of{ $$self }->{ $namespace })
|
||||
: $prefix_of{ $$self }->{ $type }
|
||||
);
|
||||
|
||||
my $prefix;
|
||||
if (not defined($namespace)) {
|
||||
$prefix = $prefix_of{ $$self }->{ $type }
|
||||
}
|
||||
else {
|
||||
$prefix = $namespace_prefix_map_of{ $$self }->{ $namespace }
|
||||
|| ( ($namespace_map_of{ $$self }->{ $namespace })
|
||||
? join ('::', $prefix_of{ $$self }->{ $type }, $namespace_map_of{ $$self }->{ $namespace })
|
||||
: $prefix_of{ $$self }->{ $type }
|
||||
);
|
||||
}
|
||||
return "${prefix}::";
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -67,7 +73,7 @@ Subclasses must implement the following methods:
|
||||
# ...
|
||||
}
|
||||
|
||||
resolve_prefix is expected to return a (perl class) prefis. It is called with
|
||||
resolve_prefix is expected to return a (perl class) prefix. It is called with
|
||||
the following parameters:
|
||||
|
||||
NAME DESCRIPTION
|
||||
@@ -80,7 +86,7 @@ You usually just need type and namespace for prefix resolving. node is
|
||||
provided for rather funky setups, where you have to choose different prefixes
|
||||
based on type names or whatever.
|
||||
|
||||
Note that node may be of any of the following classes:
|
||||
Node may be of any of the following classes:
|
||||
|
||||
SOAP::WSDL::Service
|
||||
SOAP::WSDL::XSD::Attribute
|
||||
@@ -90,8 +96,34 @@ Note that node may be of any of the following classes:
|
||||
Note that both namespace and node may be undef - you should test for
|
||||
definedness before doing anything fancy with them.
|
||||
|
||||
If you want your prefixes to represent perl class hierarchies, they should
|
||||
end with '::'.
|
||||
|
||||
Example:
|
||||
|
||||
Imagine you're generating interfaces for the Acme Pet Shop. Acme Corp. has
|
||||
set up their datatypes to be global across all interfaces (and products), while
|
||||
elements are local to the product (the Pet Shop in the example).
|
||||
All elements are in the urn:Acme namespace.
|
||||
|
||||
In addition, there are types in the namespace urn:Acme:Goods, which should go
|
||||
into the same namespace as types, but be prefixed with 'Goods_'
|
||||
|
||||
You may want prefixes (roughly) like this:
|
||||
|
||||
Interfaces: Acme::Client::PetShop::
|
||||
Server: Acme::Server::PetShop::
|
||||
Types: Acme::Types::
|
||||
Types (Goods): Acme::Types::Goods_
|
||||
Elements: Acme::Elements::PetShop::
|
||||
Typemaps: Acme::Typemaps::PetShop::
|
||||
|
||||
=back
|
||||
|
||||
=head1 BUGS AND LIMITATIONS
|
||||
|
||||
You cannot suffix your types by some rule yet...
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
Copyright 2008 Martin Kutter.
|
||||
|
||||
@@ -5,7 +5,7 @@ use Class::Std::Fast::Storable;
|
||||
use Carp;
|
||||
use SOAP::WSDL::Generator::PrefixResolver;
|
||||
|
||||
use version; our $VERSION = qv(2.00_33);
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %tt_of :ATTR(:get<tt>);
|
||||
my %definitions_of :ATTR(:name<definitions> :default<()>);
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Carp qw(confess);
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %namespace_prefix_map_of :ATTR(:name<namespace_prefix_map> :default<{}>);
|
||||
my %namespace_map_of :ATTR(:name<namespace_map> :default<{}>);
|
||||
my %prefix_of :ATTR(:name<prefix> :default<()>);
|
||||
@@ -14,9 +16,6 @@ sub load { # called as MyPlugin->load($context)
|
||||
my ($class, $context, @arg_from) = @_;
|
||||
my $stash = $context->stash();
|
||||
my $self = bless \do { my $o = Class::Std::Fast::ID() }, $class;
|
||||
# $self->set_namespace_map( $stash->{ context }->{ namespace_map });
|
||||
# $self->set_namespace_prefix_map( $stash->{ context }->{ namespace_prefix_map });
|
||||
# $self->set_prefix( $stash->{ context }->{ prefix });
|
||||
$self->set_prefix_resolver( $stash->{ context }->{ prefix_resolver });
|
||||
return $self; # returns 'MyPlugin'
|
||||
}
|
||||
@@ -27,9 +26,6 @@ sub new {
|
||||
my ($class, $arg_ref) = @_;
|
||||
|
||||
my $self = bless \do { my $o = Class::Std::Fast::ID() }, $class;
|
||||
# $self->set_namespace_map( $arg_ref->{ namespace_map });
|
||||
# $self->set_namespace_prefix_map( $arg_ref->{ namespace_prefix_map });
|
||||
# $self->set_prefix( $arg_ref->{ prefix });
|
||||
$self->set_prefix_resolver( $arg_ref->{ prefix_resolver });
|
||||
return $self; # returns 'MyPlugin'
|
||||
}
|
||||
@@ -38,10 +34,10 @@ sub _get_prefix {
|
||||
my ($self, $type, $node) = @_;
|
||||
my $namespace = defined ($node)
|
||||
? ref($node)
|
||||
? $node->get_targetNamespace
|
||||
? $node->get_targetNamespace()
|
||||
: $node
|
||||
: undef;
|
||||
return $self->get_prefix_resolver->resolve_prefix(
|
||||
return $self->get_prefix_resolver()->resolve_prefix(
|
||||
$type,
|
||||
$namespace,
|
||||
ref($node)
|
||||
@@ -50,27 +46,16 @@ sub _get_prefix {
|
||||
);
|
||||
}
|
||||
|
||||
#sub _get_prefix {
|
||||
# my ($self, $type, $namespace) = @_;
|
||||
# return $prefix_of{ $$self }->{ $type }
|
||||
# if not defined($namespace);
|
||||
# return $namespace_prefix_map_of{ $$self }->{ $namespace }
|
||||
# || ( ($namespace_map_of{ $$self }->{ $namespace })
|
||||
# ? join ('::', $prefix_of{ $$self }->{ $type }, $namespace_map_of{ $$self }->{ $namespace })
|
||||
# : $prefix_of{ $$self }->{ $type }
|
||||
# );
|
||||
#}
|
||||
|
||||
sub create_xsd_name {
|
||||
my ($self,$element) = @_;
|
||||
my $name = $self->_resolve_prefix($element) . '::'
|
||||
. $element->get_name();
|
||||
my ($self,$node) = @_;
|
||||
my $name = $self->_resolve_prefix($node) #. '::'
|
||||
. $node->get_name();
|
||||
return $self->perl_name( $name );
|
||||
}
|
||||
|
||||
sub create_typemap_name {
|
||||
my ($self, $node) = @_;
|
||||
my $name = $self->_get_prefix('typemap') . '::'
|
||||
my $name = $self->_get_prefix('typemap') #. '::'
|
||||
. $node->get_name();
|
||||
return $self->perl_name( $name );
|
||||
}
|
||||
@@ -79,10 +64,9 @@ sub create_server_name {
|
||||
my ($self, $server, $port) = @_;
|
||||
my $port_name = $port->get_name();
|
||||
$port_name =~s{\A (?:.+)\. ([^\.]+) \z}{$1}x;
|
||||
my $name = join('::',
|
||||
my $name = join( q{},
|
||||
$self->_get_prefix('server', $server),
|
||||
$server->get_name(),
|
||||
$port_name
|
||||
join( '::', $server->get_name(), $port_name)
|
||||
);
|
||||
return $self->perl_name( $name );
|
||||
}
|
||||
@@ -91,10 +75,9 @@ sub create_interface_name {
|
||||
my ($self, $server, $port) = @_;
|
||||
my $port_name = $port->get_name();
|
||||
$port_name =~s{\A (?:.+)\. ([^\.]+) \z}{$1}x;
|
||||
my $name = join('::',
|
||||
my $name = join( q{},
|
||||
$self->_get_prefix('interface', $server),
|
||||
$server->get_name(),
|
||||
$port_name
|
||||
join( '::', $server->get_name(), $port_name )
|
||||
);
|
||||
return $self->perl_name( $name );
|
||||
}
|
||||
@@ -121,8 +104,8 @@ sub _resolve_prefix {
|
||||
sub perl_name {
|
||||
my $self = shift;
|
||||
my $name = shift;
|
||||
$name =~s{[\-]}{_}xmsg;
|
||||
$name =~s{[\.]}{::}xmsg;
|
||||
$name =~s{\-}{_}xmsg;
|
||||
$name =~s{\.}{::}xmsg;
|
||||
return $name;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ use Class::Std::Fast::Storable;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
|
||||
our $VERSION = q{2.00_27};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
use SOAP::WSDL::Generator::Visitor::Typemap;
|
||||
use SOAP::WSDL::Generator::Visitor::Typelib;
|
||||
use SOAP::WSDL::Generator::Template::Plugin::XSD;
|
||||
use base qw(SOAP::WSDL::Generator::Template);
|
||||
|
||||
my %output_of :ATTR(:name<output> :default<()>);
|
||||
my %typemap_of :ATTR(:name<typemap> :default<({})>);
|
||||
my %output_of :ATTR(:name<output> :default<()>);
|
||||
my %typemap_of :ATTR(:name<typemap> :default<({})>);
|
||||
|
||||
sub BUILD {
|
||||
my ($self, $ident, $arg_ref) = @_;
|
||||
@@ -47,6 +47,29 @@ sub BUILD {
|
||||
);
|
||||
}
|
||||
|
||||
# construct object on call to allow late binding of prefix_resolver class
|
||||
# and namespace maps (not used yet)
|
||||
sub get_name_resolver {
|
||||
my $self = shift;
|
||||
return SOAP::WSDL::Generator::Template::Plugin::XSD->new({
|
||||
prefix_resolver => $self->get_prefix_resolver_class()->new({
|
||||
namespace_prefix_map => {
|
||||
'http://www.w3.org/2001/XMLSchema' => 'SOAP::WSDL::XSD::Typelib::Builtin',
|
||||
},
|
||||
namespace_map => {
|
||||
},
|
||||
prefix => {
|
||||
attribute => $self->get_attribute_prefix,
|
||||
interface => $self->get_interface_prefix,
|
||||
element => $self->get_element_prefix,
|
||||
server => $self->get_server_prefix,
|
||||
type => $self->get_type_prefix,
|
||||
typemap => $self->get_typemap_prefix,
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
sub generate {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
@@ -73,7 +96,7 @@ sub _generate_interface {
|
||||
my $self = shift;
|
||||
my $arg_ref = shift;
|
||||
my $template_name = delete $arg_ref->{ template_name };
|
||||
my $prefix_method = delete $arg_ref->{ prefix_method };
|
||||
my $name_method = delete $arg_ref->{ name_method };
|
||||
for my $service (@{ $self->get_definitions->get_service }) {
|
||||
for my $port (@{ $service->get_port() }) {
|
||||
# Skip ports without (known) address
|
||||
@@ -85,10 +108,11 @@ sub _generate_interface {
|
||||
my $output = $arg_ref->{ output }
|
||||
? $arg_ref->{ output }
|
||||
: $self->_generate_filename(
|
||||
$self->can($prefix_method)->($self),
|
||||
$service->get_name(),
|
||||
$port_name,
|
||||
);
|
||||
$self->get_name_resolver()->can($name_method)->(
|
||||
$self->get_name_resolver(),
|
||||
$service,
|
||||
$port,
|
||||
));
|
||||
print "Creating interface class $output\n";
|
||||
|
||||
$self->_process($template_name,
|
||||
@@ -105,14 +129,14 @@ sub _generate_interface {
|
||||
sub generate_server {
|
||||
my ($self, $arg_ref) = @_;
|
||||
$arg_ref->{ template_name } = 'Server.tt';
|
||||
$arg_ref->{ prefix_method } = 'get_server_prefix';
|
||||
$arg_ref->{ name_method } = 'create_server_name';
|
||||
$self->_generate_interface($arg_ref);
|
||||
}
|
||||
|
||||
sub generate_client {
|
||||
my ($self, $arg_ref) = @_;
|
||||
$arg_ref->{ template_name } = 'Interface.tt';
|
||||
$arg_ref->{ prefix_method } = 'get_interface_prefix';
|
||||
$arg_ref->{ name_method } = 'create_interface_name';
|
||||
$self->_generate_interface($arg_ref);
|
||||
}
|
||||
sub generate_interface;
|
||||
@@ -133,22 +157,7 @@ sub generate_typemap {
|
||||
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
%{ $typemap_of{ident $self }},
|
||||
},
|
||||
resolver => SOAP::WSDL::Generator::Template::Plugin::XSD->new({
|
||||
prefix_resolver => $self->get_prefix_resolver_class()->new({
|
||||
namespace_prefix_map => {
|
||||
'http://www.w3.org/2001/XMLSchema' => 'SOAP::WSDL::XSD::Typelib::Builtin',
|
||||
},
|
||||
namespace_map => {
|
||||
},
|
||||
prefix => {
|
||||
interface => $self->get_interface_prefix,
|
||||
element => $self->get_element_prefix,
|
||||
server => $self->get_server_prefix,
|
||||
type => $self->get_type_prefix,
|
||||
typemap => $self->get_typemap_prefix,
|
||||
}
|
||||
})
|
||||
}),
|
||||
resolver => $self->get_name_resolver(),
|
||||
});
|
||||
|
||||
use SOAP::WSDL::Generator::Iterator::WSDL11;
|
||||
@@ -163,7 +172,7 @@ sub generate_typemap {
|
||||
|
||||
my $output = $arg_ref->{ output }
|
||||
? $arg_ref->{ output }
|
||||
: $self->_generate_filename( $self->get_typemap_prefix(), $service->get_name() );
|
||||
: $self->_generate_filename( $self->get_name_resolver()->create_typemap_name($service) );
|
||||
print "Creating typemap class $output\n";
|
||||
$self->_process('Typemap.tt',
|
||||
{
|
||||
@@ -176,8 +185,7 @@ sub generate_typemap {
|
||||
}
|
||||
|
||||
sub _generate_filename :PRIVATE {
|
||||
my ($self, @parts) = @_;
|
||||
my $name = join '::', @parts;
|
||||
my ($self, $name) = @_;
|
||||
$name =~s{ \. }{::}xmsg;
|
||||
$name =~s{ \- }{_}xmsg;
|
||||
$name =~s{ :: }{/}xmsg;
|
||||
@@ -188,7 +196,7 @@ sub visit_XSD_Attribute {
|
||||
my ($self, $attribute) = @_;
|
||||
my $output = defined $output_of{ ident $self }
|
||||
? $output_of{ ident $self }
|
||||
: $self->_generate_filename( $self->get_attribute_prefix(), $attribute->get_name() );
|
||||
: $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($attribute) );
|
||||
$self->_process('attribute.tt', { attribute => $attribute } , $output);
|
||||
}
|
||||
|
||||
@@ -196,7 +204,7 @@ sub visit_XSD_Element {
|
||||
my ($self, $element) = @_;
|
||||
my $output = defined $output_of{ ident $self }
|
||||
? $output_of{ ident $self }
|
||||
: $self->_generate_filename( $self->get_element_prefix(), $element->get_name() );
|
||||
: $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($element) );
|
||||
$self->_process('element.tt', { element => $element } , $output);
|
||||
}
|
||||
|
||||
@@ -204,7 +212,7 @@ sub visit_XSD_SimpleType {
|
||||
my ($self, $type) = @_;
|
||||
my $output = defined $output_of{ ident $self }
|
||||
? $output_of{ ident $self }
|
||||
: $self->_generate_filename( $self->get_type_prefix(), $type->get_name() );
|
||||
: $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($type) );
|
||||
$self->_process('simpleType.tt', { simpleType => $type } , $output);
|
||||
}
|
||||
|
||||
@@ -212,8 +220,8 @@ sub visit_XSD_ComplexType {
|
||||
my ($self, $type) = @_;
|
||||
my $output = defined $output_of{ ident $self }
|
||||
? $output_of{ ident $self }
|
||||
: $self->_generate_filename( $self->get_type_prefix(), $type->get_name() );
|
||||
: $self->_generate_filename( $self->get_name_resolver()->create_xsd_name($type) );
|
||||
$self->_process('complexType.tt', { complexType => $type } , $output);
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
@parts = map {
|
||||
my $part = $_;
|
||||
(grep {
|
||||
my ($ns, $lname) = $def->expand( $_ );
|
||||
($lname eq $part->get_name)
|
||||
# my ($ns, $lname) = $def->expand( $_ );
|
||||
($_ eq $part->get_name)
|
||||
} @body_part_from
|
||||
)
|
||||
? do {
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
my $def = $stash->{ definitions };
|
||||
my $type_prefix = $stash->{ type_prefix };
|
||||
my $element_prefix = $stash->{ element_prefix };
|
||||
my ($ns, $lname) = $def->expand( $item->get_part() );
|
||||
#my ($ns, $lname) = $def->expand( $item->get_part() );
|
||||
my $part_name = $item->get_part();
|
||||
my ($part) = grep {
|
||||
$_->get_name eq $lname
|
||||
&& $_->get_targetNamespace eq $ns } @{ $message->get_part( ) };
|
||||
$_->get_name eq $part_name
|
||||
} @{ $message->get_part( ) };
|
||||
my $part_class = do {
|
||||
my $name;
|
||||
($name = $part->get_element)
|
||||
|
||||
@@ -7,4 +7,3 @@
|
||||
port_op.get_documentation %]
|
||||
|
||||
$interface->[% operation.get_name %]([% INCLUDE Interface/POD/Message.tt %] );
|
||||
|
||||
@@ -36,7 +36,7 @@ sub START {
|
||||
}
|
||||
|
||||
sub handle {
|
||||
$transport_of{ ${ shift @_ } }->handle(@_);
|
||||
$transport_of{ ${ $_[0] } }->handle(@_[1..$#_]);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -102,4 +102,4 @@ implementing the SOAP Service methods listed below.
|
||||
|
||||
Generated by SOAP::WSDL on [% PERL %]print scalar localtime() [% END %]
|
||||
|
||||
=pod
|
||||
=cut
|
||||
|
||||
@@ -3,15 +3,48 @@
|
||||
|
||||
[% head3 %] [% operation.get_name %]
|
||||
|
||||
[% type = definitions.find_portType( binding.expand( binding.get_type ) );
|
||||
port_op = type.find_operation( definitions.get_targetNamespace, operation.get_name );
|
||||
port_op.get_documentation %]
|
||||
[% type = definitions.find_portType( binding.expand( binding.get_type ) );
|
||||
port_op = '';
|
||||
FOREACH port_op = type.get_operation();
|
||||
IF (port_op.get_name == operation.get_name);
|
||||
LAST;
|
||||
END;
|
||||
END;
|
||||
|
||||
input_message_name = port_op.first_input.get_message();
|
||||
output_message_name = port_op.first_output.get_message();
|
||||
|
||||
input_message = definitions.find_message(port_op.first_input.expand(input_message_name));
|
||||
output_message = definitions.find_message(port_op.first_output.expand(output_message_name));
|
||||
|
||||
input_parts = input_message.get_part();
|
||||
output_parts = output_message.get_part();
|
||||
|
||||
# port_op.get_documentation
|
||||
%]
|
||||
|
||||
sub [% operation.get_name %] {
|
||||
my ($self, $body, $header) = @_;
|
||||
# body is a ??? object - sorry, POD not implemented yet
|
||||
# header is a ??? object - sorry, POD not implemented yet
|
||||
|
||||
[%
|
||||
IF (input_parts.size() > 1); -%]
|
||||
# body is a list ref of the following objects:
|
||||
# [
|
||||
# sorry - POD support not implemented yet
|
||||
# ]
|
||||
[% ELSE;
|
||||
input_element = definitions.first_types.find_element(input_parts.0.expand(input_parts.0.get_element));
|
||||
IF (input_element);
|
||||
class = XSD.create_xsd_name( input_element );
|
||||
ELSE;
|
||||
input_type = definitions.first_types.find_type(input_parts.0.expand(input_parts.0.get_type));
|
||||
class = XSD.create_xsd_name( input_type );
|
||||
END;
|
||||
-%]
|
||||
# body is a [% class %] object
|
||||
[%-
|
||||
END;
|
||||
%]
|
||||
# header is a ??? object - sorry, POD support not implemented yet
|
||||
# do something with body and header...
|
||||
|
||||
return [% INCLUDE Server/POD/Message.tt %]
|
||||
|
||||
@@ -15,7 +15,10 @@ get_/set_ methods:
|
||||
|
||||
=over
|
||||
|
||||
[% FOREACH element = complexType.get_attribute -%]
|
||||
[% FOREACH element = complexType.get_attribute;
|
||||
WHILE element.get_ref;
|
||||
element = definitions.first_types.find_attribute(element.expand( element.get_ref ));
|
||||
END; -%]
|
||||
=item * [% element.get_name %]
|
||||
|
||||
[%- IF (element.get_annotation && element.get_annotation.0.get_documentation) %]
|
||||
|
||||
@@ -3,18 +3,27 @@ package [% XSD.create_xmlattr_name(complexType) %];
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
||||
|
||||
{ # BLOCK to scope variables
|
||||
[% FOREACH element = complexType.get_attribute %]
|
||||
[% FOREACH element = complexType.get_attribute;
|
||||
WHILE element.get_ref;
|
||||
element = definitions.first_types.find_attribute(element.expand( element.get_ref ));
|
||||
END; %]
|
||||
my %[% element.get_name %]_of :ATTR(:get<[% element.get_name %]>);
|
||||
[%- END %]
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(
|
||||
[%- FOREACH element = complexType.get_attribute %]
|
||||
[%- FOREACH element = complexType.get_attribute;
|
||||
WHILE element.get_ref;
|
||||
element = definitions.first_types.find_attribute(element.expand( element.get_ref ));
|
||||
END; %]
|
||||
[% element.get_name -%]
|
||||
[% END %]
|
||||
) ],
|
||||
{
|
||||
[% FOREACH element = complexType.get_attribute -%]
|
||||
[% FOREACH element = complexType.get_attribute;
|
||||
WHILE element.get_ref;
|
||||
element = definitions.first_types.find_attribute(element.expand( element.get_ref ));
|
||||
END; %]
|
||||
[% element.get_name %] => \%[% element.get_name %]_of,
|
||||
[% END -%]
|
||||
},
|
||||
@@ -26,10 +35,11 @@ __PACKAGE__->_factory(
|
||||
[% element.get_name %] => '[% XSD.create_xsd_name(element_type) %]',
|
||||
[%
|
||||
ELSIF (ref = element.get_ref);
|
||||
attribute = definitions.first_types.find_attribute( complexType.expand(ref) );
|
||||
# element_type = definitions.get_types.0.find_type(complexType.expand( attribute.get_type ));
|
||||
WHILE element.get_ref;
|
||||
element = definitions.first_types.find_attribute(element.expand( element.get_ref ));
|
||||
END;
|
||||
%]
|
||||
[% attribute.get_name %] => '[% XSD.create_xsd_name(attribute) %]',
|
||||
[% element.get_name %] => '[% XSD.create_xsd_name(element) %]',
|
||||
[% ELSIF (element.first_simpleType);
|
||||
THROW NOT_IMPLEMENTED , "Attributes with atomic simpleType definition are not implemented yet";
|
||||
atomic_types.${ element.get_name } = element.first_simpleType;
|
||||
|
||||
@@ -8,7 +8,10 @@ use warnings;
|
||||
sub get_xmlns { '[% element.get_targetNamespace %]' }
|
||||
|
||||
__PACKAGE__->__set_name('[% element.get_name %]');
|
||||
__PACKAGE__->__set_nillable([% element.get_nillable %]);
|
||||
__PACKAGE__->__set_nillable([% IF (element.get_nillable);
|
||||
IF (element.get_nillable != 'false'); %]1[% ELSE %]0[% END;
|
||||
END;
|
||||
%]);
|
||||
__PACKAGE__->__set_minOccurs([% element.get_minOccurs %]);
|
||||
__PACKAGE__->__set_maxOccurs([% element.get_maxOccurs %]);
|
||||
__PACKAGE__->__set_ref([% IF element.get_ref; %]'[% element.get_ref %]'[% END %]);
|
||||
|
||||
@@ -3,7 +3,7 @@ use strict;
|
||||
use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
our $VERSION = q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %definitions_of :ATTR(:name<definitions> :default<()>);
|
||||
my %type_prefix_of :ATTR(:name<type_prefix> :default<()>);
|
||||
@@ -66,13 +66,13 @@ tree of objects.
|
||||
|
||||
A Visitor's methods are called using the so-called double dispatch technique.
|
||||
To allow double dispatching, the Visitor implements one method for every class
|
||||
ro be handled, whereas every class implements just one method (commonly named
|
||||
to be handled, whereas every class implements just one method (commonly named
|
||||
"access"), which does nothing more than calling a method on the reference
|
||||
given, with the self object as parameter.
|
||||
|
||||
If all this sounds strange, maybe an example helps. Imagine you had a list of
|
||||
person objects and wanted to print out a list of their names (or address
|
||||
stamps or everything elseyou like). This can easily be implemented with a
|
||||
stamps or everything else you like). This can easily be implemented with a
|
||||
Visitor:
|
||||
|
||||
package PersonVisitor;
|
||||
@@ -107,7 +107,7 @@ Visitor:
|
||||
Person name is Vlissides
|
||||
|
||||
While using this pattern for just printing a list may look a bit over-sized,
|
||||
but it may become handy if you need multiple output formats and different
|
||||
it may become handy if you need multiple output formats and different
|
||||
classes to operate on.
|
||||
|
||||
The main benefits using visitors are:
|
||||
@@ -188,8 +188,8 @@ mimicing .NET's .asmx example pages.
|
||||
|
||||
All these behaviours could well be (and have historically been) implemented in
|
||||
the classes holding the WSDL data. This made these classes rather bloated, and
|
||||
made it hard to change behaviour (like, supporting SOAP Headers,
|
||||
supporting atomic types and other features which were missing from early
|
||||
made it hard to change behaviour (like supporting SOAP Headers,
|
||||
supporting atomic types, and other features which were missing from early
|
||||
versions of SOAP::WSDL).
|
||||
|
||||
Implementing these behaviours in Visitor classes eases adding new behaviours,
|
||||
@@ -203,7 +203,7 @@ schema implementation.
|
||||
SOAP::WSDL::Base defines an accept method which expects a Visitor as only
|
||||
parameter.
|
||||
|
||||
The method visit_Foo_Bar is called on the visitor, whith the self object as
|
||||
The method visit_Foo_Bar is called on the visitor, with the self object as
|
||||
parameter.
|
||||
|
||||
The actual method name is constructed this way:
|
||||
@@ -224,7 +224,7 @@ visit_XSD_ComplexType is called on the visitor.
|
||||
=head2 Writing your own visitor
|
||||
|
||||
SOAP::WSDL eases writing your own visitor. This might be required if you need
|
||||
some special output format from a WSDL file, or want to feed your own
|
||||
some special output format from a WSDL file or want to feed your own
|
||||
serializer/deserializer pair with custom configuration data. Or maybe you want
|
||||
to generate C# code from it...
|
||||
|
||||
@@ -273,7 +273,7 @@ The SOAP::WSDL::Generator::Visitor implementations include part of their own
|
||||
Iterator (which means they know how to find the next objects to visit). You
|
||||
may or may not choose to implement a separate Iterator.
|
||||
|
||||
Letting a visitor implementing it's own Iterator visit a WSDL definition is as
|
||||
Letting a visitor implementing its own Iterator visit a WSDL definition is as
|
||||
easy as writing something like this:
|
||||
|
||||
my $visitor = MyVisitor->new();
|
||||
|
||||
@@ -5,6 +5,7 @@ use base qw(SOAP::WSDL::Generator::Visitor
|
||||
SOAP::WSDL::Generator::Template
|
||||
);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use Class::Std::Fast::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::Generator::Visitor);
|
||||
|
||||
our $VERSION = q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %path_of :ATTR(:name<path> :default<[]>);
|
||||
my %typemap_of :ATTR(:name<typemap> :default<()>);
|
||||
@@ -41,7 +41,7 @@ sub add_element_path {
|
||||
|
||||
sub process_referenced_type {
|
||||
my ( $self, $ns, $localname ) = @_;
|
||||
return if not $localname;
|
||||
|
||||
my $ident = ident $self;
|
||||
|
||||
# get type's class name
|
||||
@@ -65,8 +65,7 @@ sub process_atomic_type {
|
||||
my ( $self, $type, $callback ) = @_;
|
||||
return if not $type;
|
||||
|
||||
my $ident = ident $self;
|
||||
$callback->( $self, $type ) if $callback;
|
||||
$callback->( $self, $type );
|
||||
return $self;
|
||||
}
|
||||
|
||||
@@ -97,9 +96,6 @@ sub visit_XSD_Element {
|
||||
# warn "simpleType " . $element->get_name();
|
||||
my @path = @{ $path_of{ ${ $self } } };
|
||||
my $typeclass = $self->get_resolver()->create_subpackage_name($element);
|
||||
# my $typeclass = defined ($parent)
|
||||
# ? join q{::_}, $parent , $element->get_name()
|
||||
# : join q{::}, $self->resolver()->get_element_prefix( $element->get_targetNamespace), $element->get_name();
|
||||
$self->set_typemap_entry($typeclass);
|
||||
$typeclass =~s{\.}{::}g;
|
||||
$typeclass =~s{\-}{_}g;
|
||||
@@ -108,14 +104,11 @@ sub visit_XSD_Element {
|
||||
|
||||
# for atomic and complex types , and ref elements
|
||||
my $typeclass = $self->get_resolver()->create_subpackage_name($element);
|
||||
# my $typeclass = join q{::}, $self->get_resolver()->get_element_prefix( $element->get_targetNamespace), $element->get_name();
|
||||
# $typeclass =~s{\.}{::}g;
|
||||
# $typeclass =~s{\-}{_}g;
|
||||
$self->set_typemap_entry($typeclass);
|
||||
|
||||
$self->process_atomic_type( $element->first_complexType()
|
||||
, sub { $_[1]->_accept($_[0]) } )
|
||||
&& last;
|
||||
&& last SWITCH;
|
||||
|
||||
# TODO: add element ref handling
|
||||
};
|
||||
@@ -125,9 +118,6 @@ sub visit_XSD_Element {
|
||||
if (not defined($parent)) {
|
||||
# for atomic and complex types , and ref elements
|
||||
my $typeclass = $self->get_resolver()->create_xsd_name($element);
|
||||
# my $typeclass = join q{::}, $self->get_resolver()->get_element_prefix($element->get_targetNamespace), $element->get_name();
|
||||
# $typeclass =~s{\.}{::}g;
|
||||
# $typeclass =~s{\-}{_}g;
|
||||
$self->set_typemap_entry($typeclass);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,62 +237,14 @@ C<--server> or C<-s> option to the call to C<wsdl2perl.pl>.
|
||||
|
||||
perl wsdl2perl.pl -s -b BASE_DIR URL
|
||||
|
||||
Note that SOAP::WSDL only includes a basic CGI based SOAP servers by now -
|
||||
while more advanced servers (like standalone or mod_perl based) are no big
|
||||
deal, no base implementation is included yet.
|
||||
|
||||
=head1 Troubleshooting
|
||||
|
||||
=head2 Accessing HTTPS webservices
|
||||
|
||||
You need Crypt::SSLeay installed to access HTTPS webservices.
|
||||
|
||||
=head2 Accessing protected web services
|
||||
|
||||
Passing a userndame and password, or a client certificate and key, to the
|
||||
transport layer is highly dependent on the transport backend.
|
||||
|
||||
=head3 Accessing HTTP(S) webservices with basic/digest authentication
|
||||
|
||||
When using SOAP::WSDL::Transport::HTTP (SOAP::Lite not installed), add a
|
||||
method called "get_basic_credentials" to SOAP::WSDL::Transport::HTTP:
|
||||
|
||||
*SOAP::WSDL::Transport::HTTP::get_basic_credentials = sub {
|
||||
return ($user, $password);
|
||||
};
|
||||
|
||||
When using SOAP::Transport::HTTP (SOAP::Lite is installed), do the same to
|
||||
this backend:
|
||||
|
||||
*SOAP::Transport::HTTP::Client::get_basic_credentials = sub {
|
||||
return ($user, $password);
|
||||
};
|
||||
|
||||
=head3 Accessing HTTP(S) webservices protected by NTLM authentication
|
||||
|
||||
Besides passing user credentials as when accessing a web service protected
|
||||
by basic or digest authentication, you also need to enforce connection
|
||||
keep_alive on the transport backens.
|
||||
|
||||
To do so, pass a I<proxy> argument to the new() method of the generated
|
||||
class. This unfortunately means that you have to set the endpoint URL, too:
|
||||
|
||||
my $interface = MyInterfaces::SERVICE_NAME::PORT_NAME->new({
|
||||
proxy => [ $url, keep_alive => 1 ]
|
||||
});
|
||||
|
||||
You may, of course, decide to just hack the generated class. Be advised that
|
||||
subclassing might be a more appropriate solution - re-generating overwrites
|
||||
changes in interface classes.
|
||||
|
||||
=head3 Accessing HTTPS webservices protected by certificate authentication
|
||||
|
||||
You need Crypt::SSLeay installed to access HTTPS webservices.
|
||||
|
||||
See L<Crypt::SSLeay> on how to configure client certificate authentication.
|
||||
SOAP::WSDL currently includes classes for building a basic CGI and a
|
||||
mod_perl 2 based SOAP server.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<SOAP::WSDL::Manual::Cookbook> cooking recipes for accessing web services,
|
||||
altering the XML Serializer and others.
|
||||
|
||||
L<SOAP::WSDL::Manual::XSD> SOAP::WSDL's XML Schema implementation
|
||||
|
||||
L<SOAP::WSDL::Manual::Glossary> The meaning of all these words
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %part_of :ATTR(:name<part> :default<[]>);
|
||||
|
||||
1;
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %body_of :ATTR(:name<body> :default<[]>);
|
||||
my %header_of :ATTR(:name<header> :default<[]>);
|
||||
my %headerfault_of :ATTR(:name<headerfault> :default<[]>);
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
my %input_of :ATTR(:name<input> :default<[]>);
|
||||
my %output_of :ATTR(:name<output> :default<[]>);
|
||||
|
||||
@@ -6,6 +6,8 @@ use Class::Std::Fast::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %element_of :ATTR(:name<element> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %binding_of :ATTR(:name<binding> :default<()>);
|
||||
my %address_of :ATTR(:name<address> :default<()>);
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
@@ -3,5 +3,8 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %location :ATTR(:name<location> :default<()>);
|
||||
1;
|
||||
@@ -3,6 +3,9 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %use_of :ATTR(:name<use> :default<q{}>);
|
||||
my %namespace_of :ATTR(:name<namespace> :default<q{}>);
|
||||
my %encodingStyle_of :ATTR(:name<encodingStyle> :default<q{}>);
|
||||
|
||||
@@ -3,10 +3,14 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %use_of :ATTR(:name<use> :default<q{}>);
|
||||
my %namespace_of :ATTR(:name<namespace> :default<q{}>);
|
||||
my %encodingStyle_of :ATTR(:name<encodingStyle> :default<q{}>);
|
||||
my %message_of :ATTR(:name<message> :default<()>);
|
||||
my %part_of :ATTR(:name<part> :default<q{}>);
|
||||
|
||||
|
||||
1;
|
||||
@@ -3,4 +3,6 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::Header);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
1;
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %style_of :ATTR(:name<style> :default<()>);
|
||||
my %soapAction_of :ATTR(:name<soapAction> :default<()>);
|
||||
|
||||
@@ -3,7 +3,7 @@ use strict;
|
||||
use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
@@ -74,15 +74,15 @@ This means you can do something like:
|
||||
|
||||
=head2 get_faultcode / set_faultcode
|
||||
|
||||
Getter/setter for object's the faultcode property.
|
||||
Getter/setter for object's faultcode property.
|
||||
|
||||
=head2 get_faultstring / set_faultstring
|
||||
|
||||
Getter/setter for object's the faultstring property.
|
||||
Getter/setter for object's faultstring property.
|
||||
|
||||
=head2 get_faultactor / set_faultactor
|
||||
|
||||
Getter/setter for object's the faultactor property.
|
||||
Getter/setter for object's faultactor property.
|
||||
|
||||
=head2 get_detail / set_detail
|
||||
|
||||
@@ -101,9 +101,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 427 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Fault11.pm 427 2007-12-02 22:20:24Z kutterma $
|
||||
$Id: Fault11.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -4,7 +4,9 @@ use strict;
|
||||
use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use Scalar::Util qw(blessed);
|
||||
our $VERSION=q{2.00_27};
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
|
||||
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
|
||||
@@ -120,10 +122,10 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 510 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: XSD.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||
$Id: XSD.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
+40
-1
@@ -6,7 +6,7 @@ use Scalar::Util qw(blessed);
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
|
||||
our $VERSION = q{2.00_27};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %dispatch_to_of :ATTR(:name<dispatch_to> :default<()>);
|
||||
my %action_map_ref_of :ATTR(:name<action_map_ref> :default<{}>);
|
||||
@@ -160,6 +160,45 @@ of the deserialized messages).
|
||||
A hash-based dispatcher could be implemented by examining the top level
|
||||
hash keys.
|
||||
|
||||
=head1 EXCEPTION HANDLING
|
||||
|
||||
=head2 Builtin exceptions
|
||||
|
||||
SOAP::WSDL::Server handles the following errors itself:
|
||||
|
||||
In case of errors, a SOAP Fault containing an appropriate error message
|
||||
is returned.
|
||||
|
||||
=over
|
||||
|
||||
=item * XML parsing errors
|
||||
|
||||
=item * Configuration errors
|
||||
|
||||
=back
|
||||
|
||||
=head2 Throwing exceptions
|
||||
|
||||
The proper way to throw a exception is just to die -
|
||||
SOAP::WSDL::Server::CGI catches the exception and sends a SOAP Fault
|
||||
back to the client.
|
||||
|
||||
If you want more control over the SOAP Fault sent to the client, you can
|
||||
die with a SOAP::WSDL::SOAP::Fault11 object - or just let the
|
||||
SOAP::Server's deserializer create one for you:
|
||||
|
||||
my $soap = MyServer::SomeService->new();
|
||||
|
||||
die $soap->get_deserializer()->generate_fault({
|
||||
code => 'soap:Server',
|
||||
role => 'urn:localhost',
|
||||
message => "The error message to pas back",
|
||||
detail => "Some details on the error",
|
||||
});
|
||||
|
||||
You may use any other object as exception, provided it has a
|
||||
serialize() method which returns the object's XML representation.
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
Copyright 2004-2008 Martin Kutter.
|
||||
|
||||
+10
-36
@@ -12,7 +12,7 @@ use Class::Std::Fast::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::Server);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# mostly copied from SOAP::Lite. Unfortunately we can't use SOAP::Lite's CGI
|
||||
# server directly - we would have to swap out it's base class...
|
||||
@@ -39,7 +39,7 @@ sub handle {
|
||||
my $content = q{};
|
||||
my $buffer;
|
||||
|
||||
# do wen need to use bytes; here ?
|
||||
# do we need to use bytes; here ?
|
||||
binmode(STDIN);
|
||||
while (read(STDIN,$buffer,$length - length($content))) {
|
||||
$content .= $buffer;
|
||||
@@ -64,22 +64,22 @@ sub handle {
|
||||
my $response_message = eval { $self->SUPER::handle($request) };
|
||||
# caveat: SOAP::WSDL::SOAP::Typelib::Fault11 is false in bool context...
|
||||
if ($@ || blessed $@) {
|
||||
my $exception = $@;
|
||||
$response = HTTP::Response->new(500);
|
||||
if (blessed $@) {
|
||||
$response->header('Content-type' => 'text/xml; charset="utf-8"');
|
||||
if (blessed($exception)) {
|
||||
$response->content( $self->get_serializer->serialize({
|
||||
body =>$@
|
||||
body => $exception
|
||||
})
|
||||
);
|
||||
}
|
||||
else {
|
||||
$response->content($@);
|
||||
$response->content($exception);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$response = HTTP::Response->new(200);
|
||||
$response->header(
|
||||
'Content-type' => 'text/xml; charset="utf-8"'
|
||||
);
|
||||
$response->header('Content-type' => 'text/xml; charset="utf-8"');
|
||||
$response->content( $response_message );
|
||||
{
|
||||
use bytes;
|
||||
@@ -140,35 +140,9 @@ or the like, but provides a basic SOAP server using SOAP::WSDL::Server.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head1 EXCEPTION HANDLING
|
||||
=head2 handle
|
||||
|
||||
SOAP::WSDL::CGI handles the following errors:
|
||||
|
||||
=over
|
||||
|
||||
=item * XML parsing error
|
||||
|
||||
=back
|
||||
|
||||
The proper way to throw a exception is just to die -
|
||||
SOAP::WSDL::Server::CGI catches the exception and sends a SOAP Fault
|
||||
back to the client.
|
||||
|
||||
If you want more control over the SOAP Fault sent to the client, you can
|
||||
die with a SOAP::WSDL::SOAP::Fault11 object - or just let the
|
||||
SOAP::Server's deserializer create one for you:
|
||||
|
||||
my $soap = MyServer::SomeService->new();
|
||||
|
||||
die $soap->get_deserializer()->generate_fault({
|
||||
code => 'soap:Server',
|
||||
role => 'urn:localhost',
|
||||
message => "The error message to pas back",
|
||||
detail => "Some details on the error",
|
||||
});
|
||||
|
||||
You may use any other object as exception, provided it has a
|
||||
serialize() method which returns the object's XML representation.
|
||||
See synopsis above.
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %port_of :ATTR(:name<port> :default<[]>);
|
||||
|
||||
1;
|
||||
|
||||
@@ -2,6 +2,8 @@ package SOAP::WSDL::Transport::HTTP;
|
||||
use strict;
|
||||
use base qw(LWP::UserAgent);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# create methods normally inherited from SOAP::Client
|
||||
SUBFACTORY: {
|
||||
no strict qw(refs);
|
||||
@@ -88,10 +90,10 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 399 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: HTTP.pm 399 2007-11-19 19:20:52Z kutterma $
|
||||
$Id: HTTP.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'basic';
|
||||
use SOAP::WSDL::Factory::Transport;
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# register on loading
|
||||
SOAP::WSDL::Factory::Transport->register( http => __PACKAGE__ );
|
||||
SOAP::WSDL::Factory::Transport->register( https => __PACKAGE__ );
|
||||
|
||||
@@ -40,7 +41,7 @@ SOAP::WSDL::Transport::Test - Loopback transport class for SOAP::WSDL
|
||||
|
||||
use SOAP::WSDL::Client;
|
||||
use SOAP::WSDL::Transport::Loopback;
|
||||
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new()
|
||||
$soap->get_transport->set_base_dir('.');
|
||||
$soap->call('method', \%body, \%header);
|
||||
@@ -71,5 +72,5 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: HTTP.pm 218 2007-09-10 16:19:23Z kutterma $
|
||||
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $
|
||||
|
||||
|
||||
=cut
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use SOAP::WSDL::Factory::Transport;
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
SOAP::WSDL::Factory::Transport->register( http => __PACKAGE__ );
|
||||
SOAP::WSDL::Factory::Transport->register( https => __PACKAGE__ );
|
||||
@@ -66,7 +66,7 @@ SOAP::WSDL::Transport::Test - Test transport class for SOAP::WSDL
|
||||
|
||||
use SOAP::WSDL::Client;
|
||||
use SOAP::WSDL::Transport::Test;
|
||||
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new()
|
||||
$soap->get_transport->set_base_dir('.');
|
||||
$soap->call('method', \%body, \%header);
|
||||
@@ -125,5 +125,5 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: HTTP.pm 218 2007-09-10 16:19:23Z kutterma $
|
||||
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $
|
||||
|
||||
|
||||
=cut
|
||||
@@ -2,7 +2,7 @@ package SOAP::WSDL::TypeLookup;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION=q{2.00_31};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %TYPE_FROM = (
|
||||
# wsdl:
|
||||
|
||||
@@ -5,6 +5,8 @@ use SOAP::WSDL::XSD::Schema::Builtin;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %schema_of :ATTR(:name<schema> :default<[]>);
|
||||
|
||||
sub START {
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<enumeration value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<attribute
|
||||
# default = string
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<attributeGroup
|
||||
# id = ID
|
||||
|
||||
@@ -4,6 +4,11 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# only used in SOAP::WSDL - will be obsolete once SOAP::WSDL uses the
|
||||
# generative approach, too
|
||||
|
||||
sub serialize {
|
||||
my ($self, $name, $value, $opt) = @_;
|
||||
my $xml;
|
||||
|
||||
@@ -6,8 +6,11 @@ use Class::Std::Fast::Storable;
|
||||
use Scalar::Util qw(blessed);
|
||||
use base qw/SOAP::WSDL::Base/;
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# id provided by Base
|
||||
# name provided by Base
|
||||
# annotation provided by Base
|
||||
my %length_of :ATTR(:name<length> :default<[]>);
|
||||
my %minLength_of :ATTR(:name<minLength> :default<[]>);
|
||||
my %maxLength_of :ATTR(:name<maxLength> :default<[]>);
|
||||
@@ -21,7 +24,7 @@ my %minInclusive :ATTR(:name<minInclusive> :default<[]>);
|
||||
my %maxExclusive :ATTR(:name<maxExclusive> :default<[]>);
|
||||
my %maxInclusive :ATTR(:name<maxInclusive> :default<[]>);
|
||||
|
||||
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
||||
|
||||
my %attribute_of :ATTR(:name<attribute> :default<()>);
|
||||
my %element_of :ATTR(:name<element> :default<()>);
|
||||
my %group_of :ATTR(:name<group> :default<()>);
|
||||
|
||||
@@ -4,9 +4,11 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
||||
# id provided by Base
|
||||
# name provided by Base
|
||||
# annotation provided by Base
|
||||
my %simpleType_of :ATTR(:name<simpleType> :default<()>);
|
||||
my %complexType_of :ATTR(:name<complexType> :default<()>);
|
||||
my %facet_of :ATTR(:name<facet> :default<()>);
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<enumeration value="">
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package SOAP::WSDL::XSD::Pattern;
|
||||
package SOAP::WSDL::XSD::FractionDigits;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<pattern value="">
|
||||
|
||||
@@ -15,4 +15,4 @@ our $VERSION=q{2.00_33};
|
||||
# may be defined as atomic simpleType
|
||||
my %value_of :ATTR(:name<value> :default<()>);
|
||||
|
||||
1;
|
||||
1;
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<xs:group name="myModelGroup">
|
||||
# <xs:sequence>
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<maxLength value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<minExclusive value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<pattern value="">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# child elements
|
||||
my %attributeGroup_of :ATTR(:name<attributeGroup> :default<[]>);
|
||||
|
||||
@@ -6,6 +6,8 @@ use SOAP::WSDL::XSD::Schema;
|
||||
use SOAP::WSDL::XSD::Builtin;
|
||||
use base qw(SOAP::WSDL::XSD::Schema);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
# all builtin types - add validation (e.g. content restrictions) later...
|
||||
my %BUILTINS = (
|
||||
'anyURI' => {},
|
||||
@@ -96,9 +98,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 583 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Builtin.pm 583 2008-03-24 07:44:06Z kutterma $
|
||||
$Id: Builtin.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Schema/Builtin.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %length_of :ATTR(:name<length> :default<[]>);
|
||||
my %minLength_of :ATTR(:name<minLength> :default<[]>);
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<totalDigits value="">
|
||||
|
||||
|
||||
@@ -4,11 +4,15 @@ use warnings;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Element);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub start_tag {
|
||||
# my ($self, $opt, $value) = @_;
|
||||
return q{} if (@_ < 3);
|
||||
my $ns = $_[0]->get_xmlns();
|
||||
if ($ns eq 'http://www.w3.org/XML/1998/namespace') {
|
||||
return qq{ xml:$_[1]->{ name }="};
|
||||
}
|
||||
return qq{ $_[1]->{ name }="};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@ use strict;
|
||||
use warnings;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
sub serialize {
|
||||
# we work on @_ for performance.
|
||||
# $_[1] ||= {}; # $option_ref
|
||||
# TODO: What about namespaces?
|
||||
return ${ $_[0]->_serialize({ attr => 1 }) };
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ use strict;
|
||||
use warnings;
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
our $VERSION=q{2.00_25};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::anyType;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||
@@ -90,7 +90,7 @@ L</OVERLOADED OPERATORS>
|
||||
package MySimpleType;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::SimpleType
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::string
|
||||
@@ -237,7 +237,7 @@ Returns true/false in boolean context.
|
||||
|
||||
Returns 1 / 0 in numeric context.
|
||||
|
||||
boolean objects have a special method for deleteing their value, because
|
||||
boolean objects have a special method for deleting their value, because
|
||||
calling C<setl_value(undef)> results in the value being set to false.
|
||||
|
||||
$obj->delete_value();
|
||||
|
||||
@@ -5,11 +5,12 @@ use warnings;
|
||||
use Carp;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use Scalar::Util qw(blessed);
|
||||
use Data::Dumper;
|
||||
require Class::Std::Fast::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
||||
|
||||
our $VERSION = '2.00_33';
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %ELEMENTS_FROM;
|
||||
my %ATTRIBUTES_OF;
|
||||
@@ -25,15 +26,27 @@ our $___xml_attribute_of_ref = \%xml_attr_of;
|
||||
# STORABLE_ methods for supporting Class::Std::Fast::Storable.
|
||||
# We could also handle them via AUTOMETHOD,
|
||||
# but AUTOMETHOD should always croak...
|
||||
# Do we really need this ?
|
||||
# ... looks like we do...
|
||||
sub STORABLE_freeze_pre {}
|
||||
sub STORABLE_freeze_post {}
|
||||
sub STORABLE_thaw_pre {}
|
||||
sub STORABLE_thaw_post {}
|
||||
# Actually, AUTOMETHOD is faster (~1%) if Class::Std::Fast is loaded
|
||||
# properly, and slower (~10%) if not.
|
||||
# Hmmm. Trade 1% for 10?
|
||||
|
||||
#sub STORABLE_freeze_pre {}
|
||||
#sub STORABLE_freeze_post {}
|
||||
#sub STORABLE_thaw_pre {}
|
||||
#sub STORABLE_thaw_post {}
|
||||
|
||||
my %STORABLE_METHODS = (
|
||||
STORABLE_freeze_pre => undef,
|
||||
STORABLE_freeze_post => undef,
|
||||
STORABLE_thaw_pre => undef,
|
||||
STORABLE_thaw_post => undef,
|
||||
);
|
||||
|
||||
# for error reporting. Eases working with data objects...
|
||||
sub AUTOMETHOD {
|
||||
# return before unpacking @_ for speed reasons
|
||||
return if exists $STORABLE_METHODS{$_};
|
||||
|
||||
my ($self, $ident, @args_from) = @_;
|
||||
|
||||
my $class = ref $self || $self or die "Cannot call AUTOMETHOD as function";
|
||||
@@ -240,7 +253,7 @@ sub _factory {
|
||||
xmlns # xmlns
|
||||
}xms # get_elements is inlined for performance.
|
||||
? ()
|
||||
: do { use Data::Dumper;
|
||||
: do {
|
||||
croak "unknown field $_ in $class. Valid fields are:\n"
|
||||
. join(', ', @{ $ELEMENTS_FROM{ $class } }) . "\n"
|
||||
. "Structure given:\n" . Dumper @_ };
|
||||
@@ -268,16 +281,22 @@ sub _factory {
|
||||
if (defined $element) {
|
||||
$element = [ $element ] if not ref $element eq 'ARRAY';
|
||||
my $name = $_;
|
||||
|
||||
my $target_namespace = $_[0]->get_xmlns();
|
||||
map {
|
||||
# serialize element elements with their own serializer
|
||||
# but name them like they're named here.
|
||||
if ( $_->isa( 'SOAP::WSDL::XSD::Typelib::Element' ) ) {
|
||||
$_->serialize({ name => $name });
|
||||
# serialize elements of different namespaces
|
||||
# with namespace declaration
|
||||
($target_namespace ne $_->get_xmlns())
|
||||
? $_->serialize({ name => $name, qualified => 1 })
|
||||
: $_->serialize({ name => $name });
|
||||
}
|
||||
# serialize complextype elments (of other types) with their
|
||||
# serializer, but add element tags around.
|
||||
else {
|
||||
# TODO: check whether we have to handle
|
||||
# types from different namespaces special, too
|
||||
join q{}, $_->start_tag({ name => $name , %{ $option_ref } })
|
||||
, $_->serialize($option_ref)
|
||||
, $_->end_tag({ name => $name , %{ $option_ref } });
|
||||
@@ -432,9 +451,9 @@ This means you may set element properties by passing
|
||||
Examples are similar to the examples provided for new() above.
|
||||
|
||||
Note that you cannot delete a property by setting it to undef - this sets
|
||||
the property to a empty property object (with vaue undef).
|
||||
the property to an empty property object (with value undef).
|
||||
|
||||
To delete a property, say
|
||||
To delete a property, say:
|
||||
|
||||
$obj->set_FOO();
|
||||
|
||||
@@ -481,9 +500,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 583 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: ComplexType.pm 583 2008-03-24 07:44:06Z kutterma $
|
||||
$Id: ComplexType.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -3,7 +3,7 @@ package SOAP::WSDL::XSD::Typelib::Element;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use strict;
|
||||
|
||||
our $VERSION=q{2.00_29};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
my %NAME;
|
||||
my %NILLABLE;
|
||||
@@ -28,6 +28,7 @@ BLOCK: {
|
||||
no strict qw(refs);
|
||||
while (my ($name, $value) = each %method_lookup ) {
|
||||
*{ "__set$name" } = sub {
|
||||
# TODO the "or die" is bullshit - at least the error message is wrong...
|
||||
my $class = ref $_[0] || $_[0] or die "Cannot call __set$name without parameter";
|
||||
$value->{ $class } = $_[1];
|
||||
};
|
||||
@@ -175,9 +176,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 564 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: Element.pm 564 2008-02-23 13:31:39Z kutterma $
|
||||
$Id: Element.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -3,11 +3,15 @@ package SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
use strict;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::SimpleType::restriction;
|
||||
use strict;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::SimpleType);
|
||||
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -83,9 +87,9 @@ faint of heart).
|
||||
simpleType classes derived via restriction must inherit from these classes in
|
||||
exactly this order:
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType # you may leave out this
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType::restriction # derive by retriction
|
||||
The::Restriction::Base::Class # resytriction base
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType # you may leave this out
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType::restriction # derive by restriction
|
||||
The::Restriction::Base::Class # restriction base
|
||||
|
||||
The::Restriction::Base::Class can either be a builtin class (see
|
||||
SOAP::WSDL::XSD::Builtin) or another simpleType class.
|
||||
@@ -129,9 +133,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 REPOSITORY INFORMATION
|
||||
|
||||
$Rev: 477 $
|
||||
$Rev: 616 $
|
||||
$LastChangedBy: kutterma $
|
||||
$Id: SimpleType.pm 477 2007-12-24 10:23:52Z kutterma $
|
||||
$Id: SimpleType.pm 616 2008-04-22 21:51:49Z kutterma $
|
||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -4,7 +4,7 @@ use warnings;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
our $VERSION=q{2.00_33};
|
||||
use version; our $VERSION = qv('2.00.01');
|
||||
|
||||
#<pattern value="">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user