Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21efa286af |
@@ -4,13 +4,13 @@ $build = Module::Build->new(
|
|||||||
create_makefile_pl => 'passthrough',
|
create_makefile_pl => 'passthrough',
|
||||||
dist_abstract => 'SOAP with WSDL support',
|
dist_abstract => 'SOAP with WSDL support',
|
||||||
dist_name => 'SOAP-WSDL',
|
dist_name => 'SOAP-WSDL',
|
||||||
dist_version => '2.00_17',
|
dist_version => '2.00_18',
|
||||||
module_name => 'SOAP::WSDL',
|
module_name => 'SOAP::WSDL',
|
||||||
license => 'artistic',
|
license => 'artistic',
|
||||||
requires => {
|
requires => {
|
||||||
'Class::Std' => q/v0.0.8/,
|
'Class::Std' => q/v0.0.8/,
|
||||||
'Class::Std::Storable' => 0,
|
'Class::Std::Storable' => 0,
|
||||||
'Data::Dumper' => 0,
|
'Data::Dumper' => 0,
|
||||||
'Date::Parse' => 0,
|
'Date::Parse' => 0,
|
||||||
'Date::Format' => 0,
|
'Date::Format' => 0,
|
||||||
'File::Basename' => 0,
|
'File::Basename' => 0,
|
||||||
@@ -25,7 +25,7 @@ $build = Module::Build->new(
|
|||||||
buildrequires => {
|
buildrequires => {
|
||||||
'Class::Std' => q/v0.0.8/,
|
'Class::Std' => q/v0.0.8/,
|
||||||
'Class::Std::Storable' => 0,
|
'Class::Std::Storable' => 0,
|
||||||
'Cwd' => 0,
|
'Cwd' => 0,
|
||||||
'Date::Parse' => 0,
|
'Date::Parse' => 0,
|
||||||
'Date::Format' => 0,
|
'Date::Format' => 0,
|
||||||
'Getopt::Long' => 0,
|
'Getopt::Long' => 0,
|
||||||
@@ -33,7 +33,7 @@ $build = Module::Build->new(
|
|||||||
'LWP::UserAgent' => 0,
|
'LWP::UserAgent' => 0,
|
||||||
'File::Basename' => 0,
|
'File::Basename' => 0,
|
||||||
'File::Path' => 0,
|
'File::Path' => 0,
|
||||||
'File::Spec' => 0,
|
'File::Spec' => 0,
|
||||||
'Storable' => 0,
|
'Storable' => 0,
|
||||||
'Test::More' => 0,
|
'Test::More' => 0,
|
||||||
'Template' => 0,
|
'Template' => 0,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Release notes for SOAP::WSDL 2.00_17
|
Release notes for SOAP::WSDL 2.00_18
|
||||||
-------
|
-------
|
||||||
|
|
||||||
I'm proud to present a new pre-release version of SOAP::WSDL.
|
I'm proud to present a new pre-release version of SOAP::WSDL.
|
||||||
@@ -20,7 +20,7 @@ Features:
|
|||||||
the module's internals
|
the module's internals
|
||||||
* Thorough test suite
|
* Thorough test suite
|
||||||
o SOAP::WSDL is heavily regression tested, with a test coverage of
|
o SOAP::WSDL is heavily regression tested, with a test coverage of
|
||||||
over 90%.
|
over 95%.
|
||||||
* SOAP::Lite like look and feel
|
* SOAP::Lite like look and feel
|
||||||
o Where possible, SOAP::WSDL mimics SOAP::Lite's API to allow easy migrations
|
o Where possible, SOAP::WSDL mimics SOAP::Lite's API to allow easy migrations
|
||||||
* XML schema based class library for creating data objects
|
* XML schema based class library for creating data objects
|
||||||
@@ -33,6 +33,27 @@ Features:
|
|||||||
|
|
||||||
The following changes have been made:
|
The following changes have been made:
|
||||||
|
|
||||||
|
2.00_18
|
||||||
|
----
|
||||||
|
The following features were added (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924):
|
||||||
|
|
||||||
|
* [ 1790983 ] Create generator Plugin API
|
||||||
|
Generator factory is SOAP::WSDL::Factory::Generator
|
||||||
|
|
||||||
|
The following bugs have been fixed (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921):
|
||||||
|
|
||||||
|
* [ 1805252 ] t/SOAP/WSDL/XSD/Typelib/Builtin/004_time.t fails
|
||||||
|
The default timezone conversion has been fixed.
|
||||||
|
|
||||||
|
The following uncategorized improvements have been made:
|
||||||
|
|
||||||
|
* Documentation improvements
|
||||||
|
* Test updates
|
||||||
|
* readable() has been converted into a no-op, as it already had no effect
|
||||||
|
any more
|
||||||
|
|
||||||
2.00_17
|
2.00_17
|
||||||
----
|
----
|
||||||
The following features were added (the numbers in square brackets are the
|
The following features were added (the numbers in square brackets are the
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ lib/SOAP/WSDL/Expat/MessageParser.pm
|
|||||||
lib/SOAP/WSDL/Expat/MessageStreamParser.pm
|
lib/SOAP/WSDL/Expat/MessageStreamParser.pm
|
||||||
lib/SOAP/WSDL/Expat/WSDLParser.pm
|
lib/SOAP/WSDL/Expat/WSDLParser.pm
|
||||||
lib/SOAP/WSDL/Factory/Deserializer.pm
|
lib/SOAP/WSDL/Factory/Deserializer.pm
|
||||||
|
lib/SOAP/WSDL/Factory/Generator.pm
|
||||||
lib/SOAP/WSDL/Factory/Serializer.pm
|
lib/SOAP/WSDL/Factory/Serializer.pm
|
||||||
lib/SOAP/WSDL/Factory/Transport.pm
|
lib/SOAP/WSDL/Factory/Transport.pm
|
||||||
lib/SOAP/WSDL/Generator/Template.pm
|
lib/SOAP/WSDL/Generator/Template.pm
|
||||||
@@ -90,12 +91,12 @@ lib/SOAP/WSDL/Generator/Visitor/Typelib.pm
|
|||||||
lib/SOAP/WSDL/Generator/Visitor/Typemap.pm
|
lib/SOAP/WSDL/Generator/Visitor/Typemap.pm
|
||||||
lib/SOAP/WSDL/Manual.pod
|
lib/SOAP/WSDL/Manual.pod
|
||||||
lib/SOAP/WSDL/Manual/Glossary.pod
|
lib/SOAP/WSDL/Manual/Glossary.pod
|
||||||
|
lib/SOAP/WSDL/Manual/Parser.pod
|
||||||
lib/SOAP/WSDL/Manual/WS_I.pod
|
lib/SOAP/WSDL/Manual/WS_I.pod
|
||||||
lib/SOAP/WSDL/Manual/XSD.pod
|
lib/SOAP/WSDL/Manual/XSD.pod
|
||||||
lib/SOAP/WSDL/Message.pm
|
lib/SOAP/WSDL/Message.pm
|
||||||
lib/SOAP/WSDL/Operation.pm
|
lib/SOAP/WSDL/Operation.pm
|
||||||
lib/SOAP/WSDL/OpMessage.pm
|
lib/SOAP/WSDL/OpMessage.pm
|
||||||
lib/SOAP/WSDL/Parser.pod
|
|
||||||
lib/SOAP/WSDL/Part.pm
|
lib/SOAP/WSDL/Part.pm
|
||||||
lib/SOAP/WSDL/Port.pm
|
lib/SOAP/WSDL/Port.pm
|
||||||
lib/SOAP/WSDL/PortType.pm
|
lib/SOAP/WSDL/PortType.pm
|
||||||
@@ -262,6 +263,7 @@ t/SOAP/WSDL/Factory/Transport.t
|
|||||||
t/SOAP/WSDL/Generator/Template.t
|
t/SOAP/WSDL/Generator/Template.t
|
||||||
t/SOAP/WSDL/Generator/Visitor.t
|
t/SOAP/WSDL/Generator/Visitor.t
|
||||||
t/SOAP/WSDL/Generator/Visitor/Typemap.t
|
t/SOAP/WSDL/Generator/Visitor/Typemap.t
|
||||||
|
t/SOAP/WSDL/Generator/XCS.t
|
||||||
t/SOAP/WSDL/Generator/XSD.t
|
t/SOAP/WSDL/Generator/XSD.t
|
||||||
t/SOAP/WSDL/Generator/XSD_unsupported.t
|
t/SOAP/WSDL/Generator/XSD_unsupported.t
|
||||||
t/SOAP/WSDL/Transport/01_Test.t
|
t/SOAP/WSDL/Transport/01_Test.t
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: SOAP-WSDL
|
name: SOAP-WSDL
|
||||||
version: 2.00_17
|
version: 2.00_18
|
||||||
author: []
|
author: []
|
||||||
abstract: SOAP with WSDL support
|
abstract: SOAP with WSDL support
|
||||||
license: artistic
|
license: artistic
|
||||||
@@ -57,6 +57,9 @@ provides:
|
|||||||
file: lib/SOAP/WSDL/Expat/MessageStreamParser.pm
|
file: lib/SOAP/WSDL/Expat/MessageStreamParser.pm
|
||||||
SOAP::WSDL::Factory::Deserializer:
|
SOAP::WSDL::Factory::Deserializer:
|
||||||
file: lib/SOAP/WSDL/Factory/Deserializer.pm
|
file: lib/SOAP/WSDL/Factory/Deserializer.pm
|
||||||
|
SOAP::WSDL::Factory::Generator:
|
||||||
|
file: lib/SOAP/WSDL/Factory/Generator.pm
|
||||||
|
version: 2.00_18
|
||||||
SOAP::WSDL::Factory::Serializer:
|
SOAP::WSDL::Factory::Serializer:
|
||||||
file: lib/SOAP/WSDL/Factory/Serializer.pm
|
file: lib/SOAP/WSDL/Factory/Serializer.pm
|
||||||
version: 2.00_17
|
version: 2.00_17
|
||||||
@@ -219,6 +222,7 @@ provides:
|
|||||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm
|
||||||
SOAP::WSDL::XSD::Typelib::Builtin::time:
|
SOAP::WSDL::XSD::Typelib::Builtin::time:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm
|
||||||
|
version: 2.00_18
|
||||||
SOAP::WSDL::XSD::Typelib::Builtin::token:
|
SOAP::WSDL::XSD::Typelib::Builtin::token:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm
|
||||||
SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte:
|
SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte:
|
||||||
|
|||||||
+27
-14
@@ -5,7 +5,7 @@ use Pod::Usage;
|
|||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
use SOAP::WSDL::Expat::WSDLParser;
|
use SOAP::WSDL::Expat::WSDLParser;
|
||||||
use SOAP::WSDL::Generator::Template::XSD;
|
use SOAP::WSDL::Factory::Generator;
|
||||||
use Term::ReadKey;
|
use Term::ReadKey;
|
||||||
|
|
||||||
my %opt = (
|
my %opt = (
|
||||||
@@ -16,7 +16,8 @@ my %opt = (
|
|||||||
typemap_prefix => 'MyTypemaps',
|
typemap_prefix => 'MyTypemaps',
|
||||||
interface_prefix => 'MyInterfaces',
|
interface_prefix => 'MyInterfaces',
|
||||||
base_path => 'lib/',
|
base_path => 'lib/',
|
||||||
proxy => undef
|
proxy => undef,
|
||||||
|
generator => 'XSD',
|
||||||
);
|
);
|
||||||
|
|
||||||
{ # a block just to scope "no warnings"
|
{ # a block just to scope "no warnings"
|
||||||
@@ -57,6 +58,7 @@ GetOptions(\%opt,
|
|||||||
keep_alive
|
keep_alive
|
||||||
user=s
|
user=s
|
||||||
password=s
|
password=s
|
||||||
|
generator=s
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -91,20 +93,29 @@ if ($opt{typemap_include}) {
|
|||||||
%typemap = do $opt{typemap_include};
|
%typemap = do $opt{typemap_include};
|
||||||
}
|
}
|
||||||
|
|
||||||
my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
my $generator = SOAP::WSDL::Factory::Generator->get_generator({ type => $opt{'generator'} });
|
||||||
type_prefix => $opt{ type_prefix },
|
|
||||||
typemap_prefix => $opt{ typemap_prefix },
|
if (%typemap) {
|
||||||
element_prefix => $opt{ element_prefix },
|
if ($generator->can('set_typemap')) {
|
||||||
interface_prefix => $opt{ interface_prefix },
|
$generator->set_typemap( \%typemap );
|
||||||
OUTPUT_PATH => $opt{ base_path },
|
}
|
||||||
definitions => $definitions,
|
else {
|
||||||
});
|
warn "Typemap snippet given, but generator does not support it\n";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$generator->set_type_prefix( $opt{ type_prefix }) if $generator->can('set_type_prefix');
|
||||||
|
$generator->set_typemap_prefix( $opt{ typemap_prefix }) if $generator->can('set_typemap_prefix');
|
||||||
|
$generator->set_element_prefix($opt{ element_prefix }) if $generator->can('set_element_prefix');
|
||||||
|
$generator->set_interface_prefix($opt{ interface_prefix }) if $generator->can('set_interface_prefix');
|
||||||
|
$generator->set_OUTPUT_PATH($opt{ base_path }) if $generator->can('set_OUTPUT_PATH');
|
||||||
|
$generator->set_definitions($definitions) if $generator->can('set_definitions');
|
||||||
|
$generator->set_wsdl($xml) if $generator->can('set_wsdl');
|
||||||
|
|
||||||
# start with typelib, as errors will most likely occur here...
|
# start with typelib, as errors will most likely occur here...
|
||||||
$generator->generate_typelib();
|
$generator->generate();
|
||||||
$generator->generate_interface();
|
|
||||||
$generator->generate_typemap({ (%typemap) ? (typemap => \%typemap) : () });
|
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
|
||||||
@@ -133,13 +144,15 @@ wsdl2perl.pl - create perl bindings for SOAP webservices.
|
|||||||
base_path b Path to create classes in.
|
base_path b Path to create classes in.
|
||||||
Default: .
|
Default: .
|
||||||
typemap_include mi File to include in typemap. Must eval() to a valid
|
typemap_include mi File to include in typemap. Must eval() to a valid
|
||||||
perl hash (not a has ref !).
|
perl hash (not a hash ref !).
|
||||||
proxy x HTTP(S) proxy to use (if any). wsdl2perl will also
|
proxy x HTTP(S) proxy to use (if any). wsdl2perl will also
|
||||||
use the proxy settings specified via the HTTP_PROXY
|
use the proxy settings specified via the HTTP_PROXY
|
||||||
and HTTPS_PROXY environment variables.
|
and HTTPS_PROXY environment variables.
|
||||||
keep_alive Use http keep_alive.
|
keep_alive Use http keep_alive.
|
||||||
user Username for HTTP authentication
|
user Username for HTTP authentication
|
||||||
password Password. wsdl2perl will prompt if not given.
|
password Password. wsdl2perl will prompt if not given.
|
||||||
|
generator g Generator to use.
|
||||||
|
Default: XSD
|
||||||
help h Show help content
|
help h Show help content
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ SOAP::WSDL::Expat::Message2Hash - Convert SOAP messages to perl hash refs
|
|||||||
|
|
||||||
Real fast expat based SOAP message parser.
|
Real fast expat based SOAP message parser.
|
||||||
|
|
||||||
See L<SOAP::WSDL::Parser> for details.
|
See L<SOAP::WSDL::Manual::Parser> for details.
|
||||||
|
|
||||||
=head1 Bugs and Limitations
|
=head1 Bugs and Limitations
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ SOAP::WSDL::Expat::MessageParser - Convert SOAP messages to custom object trees
|
|||||||
|
|
||||||
Real fast expat based SOAP message parser.
|
Real fast expat based SOAP message parser.
|
||||||
|
|
||||||
See L<SOAP::WSDL::Parser> for details.
|
See L<SOAP::WSDL::Manual::Parser> for details.
|
||||||
|
|
||||||
=head2 Skipping unwanted items
|
=head2 Skipping unwanted items
|
||||||
|
|
||||||
@@ -234,8 +234,8 @@ This module may be used under the same terms as perl itself.
|
|||||||
|
|
||||||
$ID: $
|
$ID: $
|
||||||
|
|
||||||
$LastChangedDate: 2007-10-03 20:46:56 +0200 (Mit, 03 Okt 2007) $
|
$LastChangedDate: 2007-10-07 19:27:58 +0200 (Son, 07 Okt 2007) $
|
||||||
$LastChangedRevision: 305 $
|
$LastChangedRevision: 313 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
|
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ SOAP::WSDL::Expat::MessageStreamParser - Convert SOAP messages to custom object
|
|||||||
|
|
||||||
ExpatNB based parser for parsing huge documents.
|
ExpatNB based parser for parsing huge documents.
|
||||||
|
|
||||||
See L<SOAP::WSDL::Parser> for details.
|
See L<SOAP::WSDL::Manual::Parser> for details.
|
||||||
|
|
||||||
=head1 Bugs and Limitations
|
=head1 Bugs and Limitations
|
||||||
|
|
||||||
@@ -68,8 +68,8 @@ This module may be used under the same terms as perl itself.
|
|||||||
|
|
||||||
$ID: $
|
$ID: $
|
||||||
|
|
||||||
$LastChangedDate: 2007-10-03 20:46:56 +0200 (Mit, 03 Okt 2007) $
|
$LastChangedDate: 2007-10-07 19:27:58 +0200 (Son, 07 Okt 2007) $
|
||||||
$LastChangedRevision: 305 $
|
$LastChangedRevision: 313 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
|
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
package SOAP::WSDL::Factory::Generator;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
our $VERSION='2.00_18';
|
||||||
|
|
||||||
|
my %GENERATOR = (
|
||||||
|
'XSD' => 'SOAP::WSDL::Generator::Template::XSD',
|
||||||
|
);
|
||||||
|
|
||||||
|
# class method
|
||||||
|
sub register {
|
||||||
|
my ($class, $ref_type, $package) = @_;
|
||||||
|
$GENERATOR{ $ref_type } = $package;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_generator {
|
||||||
|
my ($self, $args_of_ref) = @_;
|
||||||
|
|
||||||
|
# sanity check
|
||||||
|
# die "no generator registered for generation method $args_of_ref->{ type }"
|
||||||
|
#
|
||||||
|
my $generator_class = (exists ($GENERATOR{ $args_of_ref->{ type } }))
|
||||||
|
? $GENERATOR{ $args_of_ref->{ type } }
|
||||||
|
: $args_of_ref->{ type };
|
||||||
|
|
||||||
|
# load module
|
||||||
|
eval "require $generator_class"
|
||||||
|
or die "Cannot load generator $generator_class", $@;
|
||||||
|
|
||||||
|
return $generator_class->new();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
=pod
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
SOAP::WSDL::Factory:Generator - Factory for retrieving generator objects
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
# from SOAP::WSDL::Client:
|
||||||
|
$generator = SOAP::WSDL::Factory::Generator->get_generator({
|
||||||
|
soap_version => $soap_version,
|
||||||
|
});
|
||||||
|
|
||||||
|
# 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
|
||||||
|
generator objects for SOAP::WSDL.
|
||||||
|
|
||||||
|
The actual work is done by specific generator classes.
|
||||||
|
|
||||||
|
SOAP::WSDL::Generator tries to load one of the following classes:
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item * the class registered for the scheme via register()
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head1 METHODS
|
||||||
|
|
||||||
|
=head2 register
|
||||||
|
|
||||||
|
SOAP::WSDL::Generator->register('Lite', 'MyWickedGenerator');
|
||||||
|
|
||||||
|
Globally registers a class for use as generator class.
|
||||||
|
|
||||||
|
=head2 get_generator
|
||||||
|
|
||||||
|
Returns an object of the generator class for this endpoint.
|
||||||
|
|
||||||
|
=head1 WRITING YOUR OWN GENERATOR CLASS
|
||||||
|
|
||||||
|
=head2 Registering a generator
|
||||||
|
|
||||||
|
Generator classes may register with SOAP::WSDL::Factory::Generator.
|
||||||
|
|
||||||
|
Registering a generator class with SOAP::WSDL::Factory::Generator is done
|
||||||
|
by executing the following code where $version is the SOAP version the
|
||||||
|
class should be used for, and $class is the class name.
|
||||||
|
|
||||||
|
SOAP::WSDL::Factory::Generator->register( $version, $class);
|
||||||
|
|
||||||
|
To auto-register your transport class on loading, execute register() in
|
||||||
|
your generator class (see L<SYNOPSIS|SYNOPSIS> above).
|
||||||
|
|
||||||
|
=head2 Generator package layout
|
||||||
|
|
||||||
|
Generator modules must be named equal to the generator class they contain.
|
||||||
|
There can only be one generator class per generator module.
|
||||||
|
|
||||||
|
=head2 Methods to implement
|
||||||
|
|
||||||
|
Generator classes must implement the following methods:
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item * new
|
||||||
|
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
=item * generate
|
||||||
|
|
||||||
|
Generate SOAP interface
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
Generators may implements one or more of the following configuration
|
||||||
|
methods. All of them are tried via can() by wsdl2perl.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item * set_wsdl
|
||||||
|
|
||||||
|
Set the raw WSDL XML. Implement if you have your own WSDL parser.
|
||||||
|
|
||||||
|
=item * set_definitions
|
||||||
|
|
||||||
|
Sets the (parsed) SOAP::WSDL::Definitions object.
|
||||||
|
|
||||||
|
=item * set_type_prefix
|
||||||
|
|
||||||
|
Sets the prefix for XML Schema type classes
|
||||||
|
|
||||||
|
=item * set_element_prefix
|
||||||
|
|
||||||
|
Sets the prefix for XML Schema element classes
|
||||||
|
|
||||||
|
=item * set_typemap_prefix
|
||||||
|
|
||||||
|
Sets the prefix for typemap classes (class resolvers).
|
||||||
|
|
||||||
|
=item * set_interface_prefix
|
||||||
|
|
||||||
|
Sets the prefix for interface classes
|
||||||
|
|
||||||
|
=item * set_typemap
|
||||||
|
|
||||||
|
Set user-defined typemap snippet
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head1 LICENSE
|
||||||
|
|
||||||
|
Copyright (c) 2004-2007 Martin Kutter.
|
||||||
|
|
||||||
|
This file is part of SOAP-WSDL. You may distribute/modify it under the same
|
||||||
|
terms as perl itself
|
||||||
|
|
||||||
|
=head1 AUTHOR
|
||||||
|
|
||||||
|
Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||||
|
|
||||||
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
|
$Rev: 302 $
|
||||||
|
$LastChangedBy: kutterma $
|
||||||
|
$Id: Generator.pm 302 2007-09-30 19:25:25Z kutterma $
|
||||||
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Generator.pm $
|
||||||
|
|
||||||
|
=cut
|
||||||
@@ -18,18 +18,18 @@ my %OUTPUT_PATH_of :ATTR(:name<OUTPUT_PATH> :default<.>);
|
|||||||
|
|
||||||
sub START {
|
sub START {
|
||||||
my ($self, $ident, $arg_ref) = @_;
|
my ($self, $ident, $arg_ref) = @_;
|
||||||
$tt_of{$ident} = Template->new(
|
}
|
||||||
|
|
||||||
|
sub _process :PROTECTED {
|
||||||
|
my ($self, $template, $arg_ref, $output) = @_;
|
||||||
|
my $ident = ident $self;
|
||||||
|
my $tt = $tt_of{$ident} ||= Template->new(
|
||||||
DEBUG => 1,
|
DEBUG => 1,
|
||||||
EVAL_PERL => $EVAL_PERL_of{ $ident },
|
EVAL_PERL => $EVAL_PERL_of{ $ident },
|
||||||
RECURSION => $RECURSION_of{ $ident },
|
RECURSION => $RECURSION_of{ $ident },
|
||||||
INCLUDE_PATH => $INCLUDE_PATH_of{ $ident },
|
INCLUDE_PATH => $INCLUDE_PATH_of{ $ident },
|
||||||
OUTPUT_PATH => $OUTPUT_PATH_of{ $ident },
|
OUTPUT_PATH => $OUTPUT_PATH_of{ $ident },
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
sub _process :PROTECTED {
|
|
||||||
my ($self, $template, $arg_ref, $output) = @_;
|
|
||||||
my $tt = $self->get_tt();
|
|
||||||
$tt->process( $template,
|
$tt->process( $template,
|
||||||
{
|
{
|
||||||
definitions => $self->get_definitions,
|
definitions => $self->get_definitions,
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ use SOAP::WSDL::Generator::Visitor::Typemap;
|
|||||||
use SOAP::WSDL::Generator::Visitor::Typelib;
|
use SOAP::WSDL::Generator::Visitor::Typelib;
|
||||||
use base qw(SOAP::WSDL::Generator::Template);
|
use base qw(SOAP::WSDL::Generator::Template);
|
||||||
|
|
||||||
my %output_of :ATTR(:name<output> :default<()>);
|
my %output_of :ATTR(:name<output> :default<()>);
|
||||||
|
my %typemap_of :ATTR(:name<typemap> :default<({})>);
|
||||||
|
|
||||||
sub BUILD {
|
sub BUILD {
|
||||||
my ($self, $ident, $arg_ref) = @_;
|
my ($self, $ident, $arg_ref) = @_;
|
||||||
@@ -21,6 +22,13 @@ sub BUILD {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub generate {
|
||||||
|
my $self = shift;
|
||||||
|
$self->generate_typelib();
|
||||||
|
$self->generate_interface();
|
||||||
|
$self->generate_typemap();
|
||||||
|
}
|
||||||
|
|
||||||
sub generate_typelib {
|
sub generate_typelib {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
@@ -73,7 +81,8 @@ sub generate_typemap {
|
|||||||
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||||
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::TOKEN',
|
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::TOKEN',
|
||||||
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||||
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||||
|
%{ $typemap_of{ident $self }},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for my $service (@{ $self->get_definitions->get_service }) {
|
for my $service (@{ $self->get_definitions->get_service }) {
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ L<SOAP::WSDL::XSD::Typelib::ComplexType>, L<SOAP::WSDL::XSD::Typelib::SimpleType
|
|||||||
L<SOAP::WSDL::XSD::Typelib::Element> tell you how to create subclasses of XML schema
|
L<SOAP::WSDL::XSD::Typelib::Element> tell you how to create subclasses of XML schema
|
||||||
types.
|
types.
|
||||||
|
|
||||||
L<SOAP::WSDL::Parser> will tell you how to create a typemap class.
|
L<SOAP::WSDL::Manual::Parser> will tell you how to create a typemap class.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ class. This unfortunately means that you have to set the endpoint URL, too:
|
|||||||
|
|
||||||
You may, of course, decide to just hack the generated class. Be advised that
|
You may, of course, decide to just hack the generated class. Be advised that
|
||||||
subclassing might be a more appropriate solution - re-generating overwrites
|
subclassing might be a more appropriate solution - re-generating overwrites
|
||||||
your changes.
|
changes in interface classes.
|
||||||
|
|
||||||
=head3 Accessing HTTPS webservices protected by certificate authentication
|
=head3 Accessing HTTPS webservices protected by certificate authentication
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
SOAP::WSDL::Parser - How SOAP::WSDL parses XML messages
|
SOAP::WSDL::Manual::Parser - How SOAP::WSDL parses XML messages
|
||||||
|
|
||||||
=head1 Which XML message does SOAP::WSDL parse ?
|
=head1 Which XML message does SOAP::WSDL parse ?
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
SOAP::WSDL::XSD - SOAP::WSDL's XML Schema implementation
|
SOAP::WSDL::Manual::XSD - SOAP::WSDL's XML Schema implementation
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
@@ -15,6 +15,32 @@ class (usually in it's own file).
|
|||||||
Atomic types are either directly included in the class of their parent's
|
Atomic types are either directly included in the class of their parent's
|
||||||
node, or as sub-package in their parent class' file.
|
node, or as sub-package in their parent class' file.
|
||||||
|
|
||||||
|
While the implementation is still incomplete, it covers the XML schema
|
||||||
|
definitions used by most object mappers.
|
||||||
|
|
||||||
|
=head1 USAGE
|
||||||
|
|
||||||
|
You can use SOAP::WSDL::XSD based classes just like any perl class - you may
|
||||||
|
instantiate it, inherit from it etc.
|
||||||
|
|
||||||
|
You should be aware, that SOAP::WSDL::XSD based classes are inside-out
|
||||||
|
classes using Class::Std, though - things you would expect from hash-based
|
||||||
|
classes like using the blessed hash ref as data storage won't work.
|
||||||
|
|
||||||
|
Moreover, most classes override Class::Std's default constructor for speed -
|
||||||
|
you should not expect BUILD or START methods to work, unless you call them
|
||||||
|
yourself (or define a new constructor).
|
||||||
|
|
||||||
|
All SOAP::WSDL::XSD based complexType classes allow a hash ref mathing their
|
||||||
|
data structure as only parameter to new(). You may mix hash and list refs and
|
||||||
|
objects in the structure passed to new - as long as the structure matches, it
|
||||||
|
will work fine.
|
||||||
|
|
||||||
|
All SOAP::WSDL::XSD based simpleType (and builtin) classes accept a single
|
||||||
|
hash ref with the only key "value" and the value to be set as value.
|
||||||
|
|
||||||
|
=head1 HOW IT WORKS
|
||||||
|
|
||||||
=head2 Base classes
|
=head2 Base classes
|
||||||
|
|
||||||
SOAP::WSDL::XSD provides a set of base classes for the construction of XML
|
SOAP::WSDL::XSD provides a set of base classes for the construction of XML
|
||||||
@@ -43,7 +69,14 @@ L</TRANSLATION RULES> for details.
|
|||||||
|
|
||||||
=head3 complexType construction class
|
=head3 complexType construction class
|
||||||
|
|
||||||
For the construction of complexType classes, the
|
For the construction of complexType classes, the construction class
|
||||||
|
SOAP::WSDL::XSD::Typelib::ComplexType is provided. It provides a __factory
|
||||||
|
method for placing attributes in generated classes, and generating
|
||||||
|
appropriate setter/getter accessors.
|
||||||
|
|
||||||
|
The setters are special: They handle complex data structures of any type
|
||||||
|
(meaning hash refs, list refs and objects, and any combination of them), as
|
||||||
|
long as their structure matches the expected structure.
|
||||||
|
|
||||||
=head1 TRANSLATION RULES
|
=head1 TRANSLATION RULES
|
||||||
|
|
||||||
@@ -81,9 +114,9 @@ SOAP::WSDL::XSD::Typelib::Element and from the base type of the atomic type.
|
|||||||
|
|
||||||
Element atomic Type
|
Element atomic Type
|
||||||
base class base class
|
base class base class
|
||||||
^ ^
|
^ ^
|
||||||
| |
|
| |
|
||||||
-------------
|
--------------
|
||||||
|
|
|
|
||||||
element simpleType class
|
element simpleType class
|
||||||
|
|
||||||
@@ -95,9 +128,9 @@ SOAP::WSDL::XSD::Typelib::ComplexType.
|
|||||||
|
|
||||||
Element complexType
|
Element complexType
|
||||||
base class base class
|
base class base class
|
||||||
^ ^
|
^ ^
|
||||||
| |
|
| |
|
||||||
-------------
|
--------------
|
||||||
|
|
|
|
||||||
element complexType class
|
element complexType class
|
||||||
|
|
||||||
@@ -108,14 +141,36 @@ TODO add more elaborate description
|
|||||||
Some content models are not implemented yet. The content models
|
Some content models are not implemented yet. The content models
|
||||||
implemented are described below.
|
implemented are described below.
|
||||||
|
|
||||||
=head3 complexType with "sequence" variety
|
|
||||||
|
|
||||||
=head3 complexType with "all" variety
|
=head3 complexType with "all" variety
|
||||||
|
|
||||||
|
Complex types with "all" variety inherit from
|
||||||
|
SOAP::WSDL::XSD::Typelib::ComplexType, and call it's factory method for
|
||||||
|
creating fields and accessors/mutators for the complexType's elements.
|
||||||
|
|
||||||
|
All element's type classes are loaded. Complex type classes have a "has a"
|
||||||
|
relationship to their element fields.
|
||||||
|
|
||||||
|
Element fields may either be element classes (for element ref="") or type
|
||||||
|
classes (for element type=""). No extra element classes are created for
|
||||||
|
a complexType's elements.
|
||||||
|
|
||||||
|
complexType
|
||||||
|
base class
|
||||||
|
^
|
||||||
|
|
|
||||||
|
complexType all
|
||||||
|
---------------- has a
|
||||||
|
element name="a" ------------> Element or type class object
|
||||||
|
element name="b" ------------> Element or type class object
|
||||||
|
|
||||||
The implementation for all does enforce the order of elements as described
|
The implementation for all does enforce the order of elements as described
|
||||||
in the WSDL, even though this is not required by the XML Schema
|
in the WSDL, even though this is not required by the XML Schema
|
||||||
specification.
|
specification.
|
||||||
|
|
||||||
|
=head3 complexType with "sequence" variety
|
||||||
|
|
||||||
|
The implementation of the "sequence" variety is the same as for all.
|
||||||
|
|
||||||
=head3 complexType with "choice" variety
|
=head3 complexType with "choice" variety
|
||||||
|
|
||||||
The implementation for choice currently is the same as for all - which means,
|
The implementation for choice currently is the same as for all - which means,
|
||||||
@@ -130,6 +185,13 @@ no check for occurence are made.
|
|||||||
ComplexType classes with restriction variety inherit from their base type.
|
ComplexType classes with restriction variety inherit from their base type.
|
||||||
No additional processing or content checking is performed yet.
|
No additional processing or content checking is performed yet.
|
||||||
|
|
||||||
|
complexType
|
||||||
|
base type class
|
||||||
|
^
|
||||||
|
|
|
||||||
|
complexType
|
||||||
|
restriction
|
||||||
|
|
||||||
Note that complexType with restriction variety classes don't exhibit their
|
Note that complexType with restriction variety classes don't exhibit their
|
||||||
type via the xsi:type attribute yet, so they currently cannot be used as
|
type via the xsi:type attribute yet, so they currently cannot be used as
|
||||||
a replacement for their base type.
|
a replacement for their base type.
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ use warnings;
|
|||||||
use Date::Parse;
|
use Date::Parse;
|
||||||
use Date::Format;
|
use Date::Format;
|
||||||
|
|
||||||
|
our $VERSION='2.00_18';
|
||||||
|
|
||||||
# Speed up. Class::Std::new is slow - and we don't need it's functionality...
|
# Speed up. Class::Std::new is slow - and we don't need it's functionality...
|
||||||
BEGIN {
|
BEGIN {
|
||||||
use Class::Std::Storable;
|
use Class::Std::Storable;
|
||||||
@@ -40,8 +42,16 @@ sub set_value {
|
|||||||
# We leave out the optional nanoseconds part, as it would always be empty.
|
# We leave out the optional nanoseconds part, as it would always be empty.
|
||||||
else {
|
else {
|
||||||
# strptime sets empty values to undef - and strftime doesn't like that...
|
# strptime sets empty values to undef - and strftime doesn't like that...
|
||||||
# we even need to set it to 1 to prevent a "Day '0' out of range 1..31" warning...
|
# we even need to set it to 1 to prevent a "Day '0' out of range 1..31" warning..
|
||||||
my @time_from = map { ! defined $_ ? 1 : $_ } strptime($_[1]);
|
|
||||||
|
# we need to set the current date for correct TZ conversion -
|
||||||
|
# could be daylight savings time
|
||||||
|
my @now = localtime;
|
||||||
|
my @time_from = map { my $alternative = shift @now;
|
||||||
|
! defined $_
|
||||||
|
? $alternative
|
||||||
|
: $_ } strptime($_[1]);
|
||||||
|
undef $time_from[-1];
|
||||||
my $time_str = strftime( '%H:%M:%S%z', @time_from );
|
my $time_str = strftime( '%H:%M:%S%z', @time_from );
|
||||||
substr $time_str, -2, 0, ':';
|
substr $time_str, -2, 0, ':';
|
||||||
$_[0]->SUPER::set_value($time_str);
|
$_[0]->SUPER::set_value($time_str);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ my $soap = SOAP::WSDL->new(
|
|||||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
||||||
outputxml => 1, # required, if not set ::SOM serializer will be loaded on
|
outputxml => 1, # required, if not set ::SOM serializer will be loaded on
|
||||||
# call
|
# call
|
||||||
readable => 1,
|
|
||||||
)->wsdlinit();
|
)->wsdlinit();
|
||||||
|
|
||||||
$soap->servicename('MessageGateway');
|
$soap->servicename('MessageGateway');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 6;
|
use Test::More tests => 5;
|
||||||
use lib 't/lib';
|
use lib 't/lib';
|
||||||
use lib '../lib';
|
use lib '../lib';
|
||||||
use lib 'lib';
|
use lib 'lib';
|
||||||
@@ -39,14 +39,12 @@ else
|
|||||||
# TODO factor out into different test
|
# TODO factor out into different test
|
||||||
|
|
||||||
my $soap = SOAP::WSDL->new(
|
my $soap = SOAP::WSDL->new(
|
||||||
readable => 1,
|
|
||||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
||||||
)->wsdlinit();
|
)->wsdlinit();
|
||||||
|
|
||||||
$soap->servicename('MessageGateway');
|
$soap->servicename('MessageGateway');
|
||||||
|
|
||||||
ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" );
|
ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" );
|
||||||
ok( $soap->readable( 0 ) , "Set readable");
|
|
||||||
|
|
||||||
sub xml {
|
sub xml {
|
||||||
q{<SOAP-ENV:Envelope
|
q{<SOAP-ENV:Envelope
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ my $soap;
|
|||||||
#2
|
#2
|
||||||
ok( $soap = SOAP::WSDL->new(
|
ok( $soap = SOAP::WSDL->new(
|
||||||
wsdl => 'file://' . $path . '/../../acceptance/wsdl/03_complexType-all.wsdl',
|
wsdl => 'file://' . $path . '/../../acceptance/wsdl/03_complexType-all.wsdl',
|
||||||
readable =>1,
|
|
||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
#3
|
#3
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ my $soap = SOAP::WSDL->new();
|
|||||||
|
|
||||||
|
|
||||||
TODO: {
|
TODO: {
|
||||||
local $TODO="implement <choice> support";
|
local $TODO="implement tests";
|
||||||
fail "serialize choice element";
|
fail "serialize choice element";
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,6 @@ my $soap = SOAP::WSDL->new();
|
|||||||
|
|
||||||
|
|
||||||
TODO: {
|
TODO: {
|
||||||
local $TODO="implement <complexContent> support";
|
local $TODO="implement <complexContent> tests";
|
||||||
fail "serialize complexContent element";
|
fail "serialize complexContent element";
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,6 @@ my $soap;
|
|||||||
#2
|
#2
|
||||||
ok( $soap = SOAP::WSDL->new(
|
ok( $soap = SOAP::WSDL->new(
|
||||||
wsdl => 'file://' . $path . '/../../acceptance/wsdl/03_complexType-element-ref.wsdl',
|
wsdl => 'file://' . $path . '/../../acceptance/wsdl/03_complexType-element-ref.wsdl',
|
||||||
readable => 1,
|
|
||||||
no_dispatch => 1,
|
no_dispatch => 1,
|
||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,10 @@ my $soap = undef;
|
|||||||
|
|
||||||
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
||||||
|
|
||||||
#2
|
|
||||||
ok( $soap = SOAP::WSDL->new(
|
ok( $soap = SOAP::WSDL->new(
|
||||||
wsdl => 'file:///' . $path . '/../../acceptance/wsdl/04_element-simpleType.wsdl'
|
wsdl => 'file:///' . $path . '/../../acceptance/wsdl/04_element-simpleType.wsdl'
|
||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
#3
|
|
||||||
$soap->readable(1);
|
|
||||||
|
|
||||||
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
||||||
# which requires SOAP::Lite
|
# which requires SOAP::Lite
|
||||||
$soap->outputxml(1);
|
$soap->outputxml(1);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ ok( $soap = SOAP::WSDL->new(
|
|||||||
wsdl => 'file:///' . $path . '/../../acceptance/wsdl/05_simpleType-list.wsdl'
|
wsdl => 'file:///' . $path . '/../../acceptance/wsdl/05_simpleType-list.wsdl'
|
||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
$soap->readable(1);
|
|
||||||
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
||||||
# which requires SOAP::Lite
|
# which requires SOAP::Lite
|
||||||
$soap->outputxml(1);
|
$soap->outputxml(1);
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ ok( $soap = SOAP::WSDL->new(
|
|||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
#3
|
#3
|
||||||
$soap->readable(1);
|
|
||||||
ok( $soap->wsdlinit(
|
ok( $soap->wsdlinit(
|
||||||
servicename => 'testService',
|
servicename => 'testService',
|
||||||
), 'parsed WSDL' );
|
), 'parsed WSDL' );
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ ok $soap = SOAP::WSDL->new(
|
|||||||
), 'Instantiated object';
|
), 'Instantiated object';
|
||||||
|
|
||||||
#3
|
#3
|
||||||
$soap->readable(1);
|
|
||||||
ok $soap->wsdlinit(), 'parsed WSDL';
|
ok $soap->wsdlinit(), 'parsed WSDL';
|
||||||
$soap->no_dispatch(1);
|
$soap->no_dispatch(1);
|
||||||
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
# won't work without - would require SOAP::WSDL::Deserializer::SOM,
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More;
|
||||||
|
use File::Spec;
|
||||||
|
use File::Basename;
|
||||||
|
eval { require XML::Compile::WSDL11 }
|
||||||
|
or plan skip_all => 'Cannot test without XML::Compile::WSDL11';
|
||||||
|
|
||||||
|
eval { require XML::LibXML }
|
||||||
|
or plan skip_all => 'Cannot test without XML::LibXML';
|
||||||
|
|
||||||
|
plan skip_all => 'XML::Compile::WSDL11 is not functional yet';
|
||||||
|
|
||||||
|
plan tests => qw(no_plan);
|
||||||
|
|
||||||
|
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
||||||
|
|
||||||
|
my $libxml = XML::LibXML->new();
|
||||||
|
my $xml = $libxml->parse_file("$path/../../../acceptance/wsdl/generator_test.wsdl");
|
||||||
|
|
||||||
|
my $wsdl = XML::Compile::WSDL11->new($xml);
|
||||||
|
my $schemas = $wsdl->schemas;
|
||||||
|
my $operation = $wsdl->operation('testHeader');
|
||||||
|
|
||||||
|
my $client = $operation->prepareClient();
|
||||||
@@ -2,6 +2,17 @@ use Test::More tests => 3;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use lib '../lib';
|
use lib '../lib';
|
||||||
|
use Date::Parse;
|
||||||
|
use Date::Format;
|
||||||
|
|
||||||
|
sub timezone {
|
||||||
|
my @time = localtime;
|
||||||
|
my $tz = strftime('%z', @time);
|
||||||
|
substr $tz, -2, 0, ':';
|
||||||
|
return $tz;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $timezone = timezone;
|
||||||
|
|
||||||
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::time');
|
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::time');
|
||||||
my $obj;
|
my $obj;
|
||||||
@@ -9,7 +20,7 @@ my $obj;
|
|||||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new();
|
$obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new();
|
||||||
|
|
||||||
$obj->set_value( '12:23:03' );
|
$obj->set_value( '12:23:03' );
|
||||||
is $obj->get_value() , '12:23:03+01:00', 'conversion';
|
is $obj->get_value() , "12:23:03$timezone", 'conversion';
|
||||||
|
|
||||||
$obj->set_value( '12:23:03.12345+01:00' ), ;
|
$obj->set_value( '12:23:03.12345+01:00' ), ;
|
||||||
is $obj->get_value() , '12:23:03.12345+01:00', 'no conversion';
|
is $obj->get_value() , '12:23:03.12345+01:00', 'no conversion';
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||||
|
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||||
>
|
>
|
||||||
<types>
|
<types>
|
||||||
<xsd:schema targetNamespace="urn:Test">
|
<xsd:schema targetNamespace="urn:Test">
|
||||||
@@ -197,9 +198,9 @@
|
|||||||
</portType>
|
</portType>
|
||||||
|
|
||||||
<binding type="tns:testPort" name="testBinding">
|
<binding type="tns:testPort" name="testBinding">
|
||||||
<operation name="testChoice">
|
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
<operation name="testChoice">
|
||||||
<soap:operation soapAction="testChoice"/>
|
<soap:operation soapAction="testChoice" style="document"/>
|
||||||
<input>
|
<input>
|
||||||
<soap:body use="literal"/>
|
<soap:body use="literal"/>
|
||||||
</input>
|
</input>
|
||||||
@@ -209,8 +210,7 @@
|
|||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="test">
|
<operation name="test">
|
||||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
<soap:operation soapAction="test" style="document"/>
|
||||||
<soap:operation soapAction="test"/>
|
|
||||||
<input>
|
<input>
|
||||||
<soap:body use="literal"/>
|
<soap:body use="literal"/>
|
||||||
</input>
|
</input>
|
||||||
@@ -218,10 +218,8 @@
|
|||||||
<soap:body use="literal"/>
|
<soap:body use="literal"/>
|
||||||
</output>
|
</output>
|
||||||
</operation>
|
</operation>
|
||||||
|
|
||||||
<operation name="testHeader">
|
<operation name="testHeader">
|
||||||
<soap:operation soapAction="testHeader"/>
|
<soap:operation soapAction="testHeader"/>
|
||||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
|
||||||
<input>
|
<input>
|
||||||
<soap:body use="literal" parts="tns:testBody"/>
|
<soap:body use="literal" parts="tns:testBody"/>
|
||||||
<soap:header use="literal" part="tns:testHeader" message="tns:testHeaderRequest"/>
|
<soap:header use="literal" part="tns:testHeader" message="tns:testHeaderRequest"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user