diff --git a/Build.PL b/Build.PL index 75bc1e7..6cac398 100644 --- a/Build.PL +++ b/Build.PL @@ -5,7 +5,7 @@ $build = Module::Build->new( create_makefile_pl => 'passthrough', dist_abstract => 'SOAP with WSDL support', dist_name => 'SOAP-WSDL', - dist_version => '2.00_27', + dist_version => '2.00_28', module_name => 'SOAP::WSDL', license => 'artistic', requires => { diff --git a/Changes b/Changes index 3e6a80c..6d847ea 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -Release notes for SOAP::WSDL 2.00_27 +Release notes for SOAP::WSDL 2.00_28 ------- I'm proud to present a new pre-release version of SOAP::WSDL. @@ -34,6 +34,20 @@ Features: The following changes have been made: +2.00_28 + +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): +The numbers with # are CPAN RT IDs (http://rt.cpan.org/). + + * #32062: minor doc fixes + * [ 1852988 ] Generated Interface POD is invalid + * [ 1855583 ] t/SOAP/WSDL/XSD/Typelib/ComplexType.t requires Test::Warn + +The following uncategorized improvements have been made: + + * Updated SOAP::WSDL::Manual::WS_I to reflect new Server modules + 2.00_27 The following features were added (the numbers in square brackets are the diff --git a/META.yml b/META.yml index 3ebbb16..81faf17 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SOAP-WSDL -version: 2.00_27 +version: 2.00_28 author: - 'Martin Kutter ' abstract: SOAP with WSDL support @@ -44,7 +44,7 @@ provides: version: 2.00_25 SOAP::WSDL::Definitions: file: lib/SOAP/WSDL/Definitions.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::Deserializer::Hash: file: lib/SOAP/WSDL/Deserializer/Hash.pm version: 2.00_25 @@ -56,13 +56,13 @@ provides: version: 2.00_25 SOAP::WSDL::Expat::Base: file: lib/SOAP/WSDL/Expat/Base.pm - version: 2.00_24 + version: 2.00_27 SOAP::WSDL::Expat::Message2Hash: file: lib/SOAP/WSDL/Expat/Message2Hash.pm - version: 2.00_24 + version: 2.00_27 SOAP::WSDL::Expat::MessageParser: file: lib/SOAP/WSDL/Expat/MessageParser.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::Expat::MessageStreamParser: file: lib/SOAP/WSDL/Expat/MessageStreamParser.pm version: 2.00_24 @@ -83,7 +83,7 @@ provides: version: 2.00_25 SOAP::WSDL::Generator::Template::XSD: file: lib/SOAP/WSDL/Generator/Template/XSD.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::Generator::Visitor: file: lib/SOAP/WSDL/Generator/Visitor.pm version: 2.00_25 @@ -120,13 +120,13 @@ provides: version: 2.00_25 SOAP::WSDL::Serializer::XSD: file: lib/SOAP/WSDL/Serializer/XSD.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::Server: file: lib/SOAP/WSDL/Server.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::Server::CGI: file: lib/SOAP/WSDL/Server/CGI.pm - version: 2.00_26 + version: 2.00_27 SOAP::WSDL::Service: file: lib/SOAP/WSDL/Service.pm SOAP::WSDL::Transport::HTTP: @@ -256,10 +256,10 @@ provides: file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm SOAP::WSDL::XSD::Typelib::ComplexType: file: lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::XSD::Typelib::Element: file: lib/SOAP/WSDL/XSD/Typelib/Element.pm - version: 2.00_25 + version: 2.00_27 SOAP::WSDL::XSD::Typelib::SimpleType: file: lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm SOAP::WSDL::XSD::Typelib::SimpleType::restriction: diff --git a/example/hello.pl b/example/hello.pl index b810b58..846a42b 100644 --- a/example/hello.pl +++ b/example/hello.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; use warnings; -use lib 'lib'; # just needed because interface lies here +use lib 'lib'; # just needed because interface lies here # I have to generate the interface using wsdl2perl.pl before use MyInterfaces::HelloWorld::HelloWorldSoap; diff --git a/example/hello_lite.pl b/example/hello_lite.pl index 3f99fe1..733f04a 100644 --- a/example/hello_lite.pl +++ b/example/hello_lite.pl @@ -13,15 +13,16 @@ $soap->on_action( sub { "urn:HelloWorld#sayHello" }); $soap->autotype(0); # I have to lookup the top level element's namespace from the WSDL +$soap->default_ns('urn:HelloWorld'); + # I have to encode all parameters as SOAP::Data objects # I have to know the order of parameters my $som = $soap->call( - SOAP::Data->name("sayHello") - ->attr({ xmlns => 'urn:HelloWorld' }), + "sayHello", SOAP::Data->name('name')->value( $ARGV[1] || '"Your name"'), SOAP::Data->name('givenName')->value( $ARGV[0] || '"Your given name"'), ); die $som->fault->{ faultstring } if ($som->fault); -print $som->result, "\n"; \ No newline at end of file +print $som->result, "\n"; diff --git a/example/person.pl b/example/person.pl index fc526f4..19ef578 100644 --- a/example/person.pl +++ b/example/person.pl @@ -1,10 +1,12 @@ +use strict; +use warnings; use lib 'lib'; use MyInterfaces::TestService::TestPort; my $soap = MyInterfaces::TestService::TestPort->new(); -$soap->outputxml(1); -my $result = $soap->ListPerson({}); -# print "Found " . scalar @{ $result->get_out->get_NewElement } . " persons\n"; +my $result = $soap->ListPerson({}) + or die "error calling SOAP method"; + +print "Found " . @{ $result->get_out()->get_NewElement } . " persons\n"; -print $result; diff --git a/example/wsdl/Person.wsdl b/example/wsdl/Person.wsdl index a46b6a2..26770b5 100644 --- a/example/wsdl/Person.wsdl +++ b/example/wsdl/Person.wsdl @@ -1,107 +1,121 @@ - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + + - - - - + + + + + + + + - - - - - + + + + + + + + + + + - - - - - + + + - - - - - - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + - + - + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/lib/SOAP/WSDL.pm b/lib/SOAP/WSDL.pm index 23987d6..5a53dfa 100644 --- a/lib/SOAP/WSDL.pm +++ b/lib/SOAP/WSDL.pm @@ -669,12 +669,12 @@ The following facets have no influence yet: =item * L -Full featured SOAP-library, little WSDL support. Supports rpc-encoded style +Full featured SOAP-library, little WSDL support. Supports rpc-encoded style only. Many protocols supported. =item * L / L -Creates parser/generator functions for SOAP messages. Includes SOAP Client +Creates parser/generator functions for SOAP messages. Includes SOAP Client and Server implementatios. You might want to give it a try, especially if you need to adhere very @@ -730,9 +730,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 457 $ + $Rev: 477 $ $LastChangedBy: kutterma $ - $Id: WSDL.pm 457 2007-12-16 08:02:06Z kutterma $ + $Id: WSDL.pm 477 2007-12-24 10:23:52Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $ =cut diff --git a/lib/SOAP/WSDL/Definitions.pm b/lib/SOAP/WSDL/Definitions.pm index d771094..3a8305f 100644 --- a/lib/SOAP/WSDL/Definitions.pm +++ b/lib/SOAP/WSDL/Definitions.pm @@ -9,7 +9,7 @@ use List::Util qw(first); use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Base); -our $VERSION='2.00_25'; +our $VERSION='2.00_27'; my %types_of :ATTR(:name :default<[]>); my %message_of :ATTR(:name :default<()>); @@ -105,7 +105,7 @@ Returns the message matching the namespace/localname pair passed as arguments. Accessors/Mutators for accessing / setting the EtypesE child element(s). -=head1 LICENSE and COPYRIGHT +=head1 LICENSE AND COPYRIGHT Copyright 2004-2007 Martin Kutter. @@ -118,9 +118,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 431 $ + $Rev: 477 $ $LastChangedBy: kutterma $ - $Id: Definitions.pm 431 2007-12-03 19:39:11Z kutterma $ + $Id: Definitions.pm 477 2007-12-24 10:23:52Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Definitions.pm $ =cut diff --git a/lib/SOAP/WSDL/Expat/Base.pm b/lib/SOAP/WSDL/Expat/Base.pm index 45a5691..e5b2894 100644 --- a/lib/SOAP/WSDL/Expat/Base.pm +++ b/lib/SOAP/WSDL/Expat/Base.pm @@ -3,7 +3,7 @@ use strict; use warnings; use XML::Parser::Expat; -our $VERSION = '2.00_24'; +our $VERSION = '2.00_27'; sub new { my ($class, $args) = @_; @@ -41,4 +41,38 @@ sub get_data { return $_[0]->{ data }; } -1; \ No newline at end of file +1; + +=pod + +=head1 NAME + +SOAP::WSDL::Expat::Base - Base class for XML::Parser::Expat based XML parsers + +=head1 DESCRIPTION + +Base class for XML::Parser::Expat based XML parsers. All XML::SAX::Expat based +parsers in SOAP::WSDL inherit from this class. + +=head1 AUTHOR + +Replace the whitespace by @ for E-Mail Address. + + Martin Kutter Emartin.kutter fen-net.deE + +=head1 LICENSE AND COPYRIGHT + +Copyright 2004-2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 Repository information + + $Id: $ + + $LastChangedDate: 2007-09-10 18:19:23 +0200 (Mo, 10 Sep 2007) $ + $LastChangedRevision: 218 $ + $LastChangedBy: kutterma $ + + $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $ diff --git a/lib/SOAP/WSDL/Expat/Message2Hash.pm b/lib/SOAP/WSDL/Expat/Message2Hash.pm index 31db2d5..667c2be 100644 --- a/lib/SOAP/WSDL/Expat/Message2Hash.pm +++ b/lib/SOAP/WSDL/Expat/Message2Hash.pm @@ -4,7 +4,7 @@ use strict; use warnings; use base qw(SOAP::WSDL::Expat::Base); -our $VERSION = '2.00_24'; +our $VERSION = '2.00_27'; sub _initialize { my ($self, $parser) = @_; @@ -113,13 +113,16 @@ Replace the whitespace by @ for E-Mail Address. Martin Kutter Emartin.kutter fen-net.deE -=head1 COPYING +=head1 LICENSE AND COPYRIGHT -This module may be used under the same terms as perl itself. +Copyright 2004-2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself =head1 Repository information - $ID: $ + $Id: $ $LastChangedDate: 2007-09-10 18:19:23 +0200 (Mo, 10 Sep 2007) $ $LastChangedRevision: 218 $ diff --git a/lib/SOAP/WSDL/Expat/MessageParser.pm b/lib/SOAP/WSDL/Expat/MessageParser.pm index d7ca217..208e8a1 100644 --- a/lib/SOAP/WSDL/Expat/MessageParser.pm +++ b/lib/SOAP/WSDL/Expat/MessageParser.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Carp qw(croak confess); -our $VERSION = q{2.00_25}; +our $VERSION = q{2.00_27}; use SOAP::WSDL::XSD::Typelib::Builtin; use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; @@ -260,7 +260,7 @@ See L for details. Sometimes there's unneccessary information transported in SOAP messages. To skip XML nodes (including all child nodes), just edit the type map for -the message, set the type map entry to '__SKIP__', and comment out all +the message, set the type map entry to '__SKIP__', and comment out all child elements you want to skip. =head1 Bugs and Limitations @@ -281,16 +281,19 @@ Replace the whitespace by @ for E-Mail Address. Martin Kutter Emartin.kutter fen-net.deE -=head1 COPYING +=head1 LICENSE AND COPYRIGHT -This module may be used under the same terms as perl itself. +Copyright 2004-2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself =head1 Repository information - $ID: $ + $Id: $ - $LastChangedDate: 2007-12-07 21:04:06 +0100 (Fr, 07 Dez 2007) $ - $LastChangedRevision: 444 $ + $LastChangedDate: 2007-12-24 11:23:52 +0100 (Mo, 24 Dez 2007) $ + $LastChangedRevision: 477 $ $LastChangedBy: kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $ diff --git a/lib/SOAP/WSDL/Expat/MessageStreamParser.pm b/lib/SOAP/WSDL/Expat/MessageStreamParser.pm index e7f8888..881193f 100644 --- a/lib/SOAP/WSDL/Expat/MessageStreamParser.pm +++ b/lib/SOAP/WSDL/Expat/MessageStreamParser.pm @@ -56,22 +56,22 @@ See L for details. See SOAP::WSDL::Expat::MessageParser -=head1 LICENSE AND COPYRIGHT - -Copyright 2007 Martin Kutter. All rights reserved. - -This file is part of SOAP-WSDL. You may distribte/modify it under -the same terms as perl itself - =head1 AUTHOR Martin Kutter Emartin.kutter fen-net.deE +=head1 LICENSE AND COPYRIGHT + +Copyright 2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + =head1 REPOSITORY INFORMATION - $Rev: 391 $ + $Rev: 477 $ $LastChangedBy: kutterma $ - $Id: MessageStreamParser.pm 391 2007-11-17 21:56:13Z kutterma $ + $Id: MessageStreamParser.pm 477 2007-12-24 10:23:52Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageStreamParser.pm $ =cut diff --git a/lib/SOAP/WSDL/Expat/WSDLParser.pm b/lib/SOAP/WSDL/Expat/WSDLParser.pm index 0555fe5..b419cb4 100644 --- a/lib/SOAP/WSDL/Expat/WSDLParser.pm +++ b/lib/SOAP/WSDL/Expat/WSDLParser.pm @@ -145,3 +145,43 @@ sub _fixup_attrs { 1; + +=pod + +=head1 NAME + +SOAP::WSDL::Expat::WSDLParser - Parse WSDL files into object trees + +=head1 SYNOPSIS + + my $parser = SOAP::WSDL::Expat::WSDLParser->new(); + $parser->parse( $xml ); + my $obj = $parser->get_data(); + +=head1 DESCRIPTION + +WSDL parser used by SOAP::WSDL. + +=head1 AUTHOR + +Replace the whitespace by @ for E-Mail Address. + + Martin Kutter Emartin.kutter fen-net.deE + +=head1 LICENSE AND COPYRIGHT + +Copyright 2004-2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 Repository information + + $Id: $ + + $LastChangedDate: 2007-12-24 11:23:52 +0100 (Mo, 24 Dez 2007) $ + $LastChangedRevision: 477 $ + $LastChangedBy: kutterma $ + + $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ + diff --git a/lib/SOAP/WSDL/Factory/Deserializer.pm b/lib/SOAP/WSDL/Factory/Deserializer.pm index 275d75a..6774745 100644 --- a/lib/SOAP/WSDL/Factory/Deserializer.pm +++ b/lib/SOAP/WSDL/Factory/Deserializer.pm @@ -137,7 +137,7 @@ passed as a single hash ref: Copyright 2007 Martin Kutter. All rights reserved. -This file is part of SOAP-WSDL. You may distribte/modify it under +This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself =head1 AUTHOR diff --git a/lib/SOAP/WSDL/Factory/Generator.pm b/lib/SOAP/WSDL/Factory/Generator.pm index caff6af..ea6294c 100644 --- a/lib/SOAP/WSDL/Factory/Generator.pm +++ b/lib/SOAP/WSDL/Factory/Generator.pm @@ -155,7 +155,7 @@ Set user-defined typemap snippet Copyright 2007 Martin Kutter. All rights reserved. -This file is part of SOAP-WSDL. You may distribte/modify it under +This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself =head1 AUTHOR diff --git a/lib/SOAP/WSDL/Generator/Template/XSD.pm b/lib/SOAP/WSDL/Generator/Template/XSD.pm index be8163d..bb50cd2 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD.pm +++ b/lib/SOAP/WSDL/Generator/Template/XSD.pm @@ -5,7 +5,7 @@ use Class::Std::Fast::Storable; use File::Basename; use File::Spec; -our $VERSION = q{2.00_25}; +our $VERSION = q{2.00_27}; use SOAP::WSDL::Generator::Visitor::Typemap; use SOAP::WSDL::Generator::Visitor::Typelib; @@ -57,8 +57,8 @@ sub generate { sub generate_typelib { my ($self, $arg_ref) = @_; # $output_of{ ident $self } = ""; - my @schema = exists $arg_ref->{ schema } - ? @{ $arg_ref->{schema} } + my @schema = exists $arg_ref->{ schema } + ? @{ $arg_ref->{schema} } : @{ $self->get_definitions()->first_types()->get_schema() }; for my $type (map { @{ $_->get_type() } , @{ $_->get_element() } } @schema[1..$#schema] ) { $type->_accept( $self ); diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt index 4cb5b42..8f41f2c 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt @@ -1,4 +1,8 @@ -package [% interface_prefix %]::[% service.get_name.replace('\.', '::').replace('-', '_') %]::[% port.get_name.replace('^.+\.','').replace('-', '_') %]; +[% interface_name = interface_prefix _ '::' + _ service.get_name.replace('\.', '::') _ '::' + _ port.get_name.replace('^.+\.',''); +interface_name = interface_name.replace('-','_'); -%] +package [% interface_name %]; use strict; use warnings; use Class::Std::Fast::Storable; @@ -33,13 +37,12 @@ __END__ =head1 NAME - -[% interface_prefix %]::[% service.get_name.replace('\.', '::').replace('-', '_') %]::[% port.get_name.replace('\.', '::').replace('-', '_') %] - SOAP Interface for the [% service.get_name %] Web Service +[% interface_name %] - SOAP Interface for the [% service.get_name %] Web Service =head1 SYNOPSIS - use [% interface_prefix %]::[% service.get_name.replace('\.', '::').replace('-', '_') %]::[% port.get_name.replace('\.', '::').replace('-', '_') %]; - my $interface = [% interface_prefix %]::[% service.get_name.replace('\.', '::').replace('-', '_') %]::[% port.get_name.replace('\.', '::').replace('-', '_') %]->new(); + use [% interface_name %]; + my $interface = [% interface_name %]->new(); my $response; [% FOREACH operation = binding.get_operation; diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Server.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Server.tt index 8d05f4e..51ec29f 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Server.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Server.tt @@ -1,4 +1,8 @@ -package [% server_prefix %]::[% service.get_name.replace('\.', '::') %]::[% port.get_name.replace('^.+\.','') %]; +[% server_name = server_prefix _ '::' + _ service.get_name.replace('\.', '::') _ '::' + _ port.get_name.replace('^.+\.',''); +server_name = server_name.replace('-','_'); -%] +package [% server_name %]; use strict; use warnings; use Class::Std::Fast::Storable; @@ -23,7 +27,7 @@ my $action_map_ref = { sub START { my ($self, $ident, $arg_ref) = @_; - eval "require $transport_class_of{ $ident }" + eval "require $transport_class_of{ $ident }" or die "Cannot load transport class $transport_class_of{ $ident }: $@"; $transport_of{ $ident } = $transport_class_of{ $ident }->new({ action_map_ref => $action_map_ref, @@ -46,12 +50,12 @@ __END__ =head1 NAME -[% interface_prefix %]::[% service.get_name.replace('\.', '::') %]::[% port.get_name.replace('\.', '::') %] - SOAP Server Class for the [% service.get_name %] Web Service +[% server_name %] - SOAP Server Class for the [% service.get_name %] Web Service =head1 SYNOPSIS - use [% server_prefix %]::[% service.get_name.replace('\.', '::') %]::[% port.get_name.replace('\.', '::') %]; - my $server = [% server_prefix %]::[% service.get_name.replace('\.', '::') %]::[% port.get_name.replace('\.', '::') %]->new({ + use [% server_name %]; + my $server = [% server_name %]->new({ dispatch_to => 'My::Handler::Class', transport_class => 'SOAP::WSDL::Server::CGI', # optional, default }); @@ -79,7 +83,7 @@ located at [% port.first_address.get_location %]. Constructor. -The C argument is mandatory. It must be a class or object +The C argument is mandatory. It must be a class or object implementing the SOAP Service methods listed below. =head2 SOAP Service methods diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Operation.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Operation.tt index 4bca2cc..2cd0cb1 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Operation.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Operation.tt @@ -8,8 +8,8 @@ port_op.get_documentation %] my ($self, $body, $header) = @_; # body is a ??? object - sorry, POD not implemented yet # header is a ??? object - sorry, POD not implemented yet - + # do something with body and header... - + return [% INCLUDE Server/POD/Message.tt %] } diff --git a/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/OutPart.tt b/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/OutPart.tt index 07b3f8f..50b5c97 100644 --- a/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/OutPart.tt +++ b/lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/OutPart.tt @@ -3,7 +3,7 @@ #element; #STOP; -%] - [% element_prefix %]::[% element.get_name.replace('\.', '::') %]->new([% + [% element_prefix %]::[% element.get_name.replace('\.', '::') %]->new([% type = element.first_complexType || element.first_simpleType || definitions.first_types.find_type( element.expand( element.get_type ) ); INCLUDE Interface/POD/Type.tt; %] diff --git a/lib/SOAP/WSDL/Generator/Visitor.pm b/lib/SOAP/WSDL/Generator/Visitor.pm index bf6d8ba..04150db 100644 --- a/lib/SOAP/WSDL/Generator/Visitor.pm +++ b/lib/SOAP/WSDL/Generator/Visitor.pm @@ -48,7 +48,7 @@ SOAP::WSDL::Generator::Visitor - SOAP::WSDL's Visitor-based Code Generator =head1 DESCRIPTION -SOAP::WSDL featores a code generating facility. This code generation facility +SOAP::WSDL features a code generating facility. This code generation facility (in fact there are several of them) is implemented as Visitor to SOAP::WSDL::Base-derived objects. @@ -186,8 +186,8 @@ mimicing .NET's .asmx example pages. =back -All these behaviours could well (and has historically been) implemented in the -classes holding the WSDL data. This made these classes rather bloated, and +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 versions of SOAP::WSDL). diff --git a/lib/SOAP/WSDL/Manual.pod b/lib/SOAP/WSDL/Manual.pod index e396d19..e11020a 100644 --- a/lib/SOAP/WSDL/Manual.pod +++ b/lib/SOAP/WSDL/Manual.pod @@ -111,7 +111,7 @@ included perldoc will be, too - if not, blame the web service author. print $result; The above handling of errors ("die $result if not $result") may look a bit -strange - it is due to the nature of the +strange - it is due to the nature of the L objects SOAP::WSDL uses for signalling failure. @@ -232,7 +232,7 @@ L will tell you how to create a typemap class. =head1 Creating a SOAP Server -Creating a SOAP server works just like creating a client - just add the +Creating a SOAP server works just like creating a client - just add the C<--server> or C<-s> option to the call to C. perl wsdl2perl.pl -s -b BASE_DIR URL diff --git a/lib/SOAP/WSDL/Manual/WS_I.pod b/lib/SOAP/WSDL/Manual/WS_I.pod index 560d31c..88b78bd 100644 --- a/lib/SOAP/WSDL/Manual/WS_I.pod +++ b/lib/SOAP/WSDL/Manual/WS_I.pod @@ -84,7 +84,7 @@ SOAP::WSDL::Expat::MessageParser allows the use of XML Declarations. the soap:Body element. SOAP::WSDL::Serializer::SOAP11 does not emit children of soap:Envelope following -the soap:Body element. Other serializers may behave differentls. +the soap:Body element. Other serializers may behave different. =head2 R1012 @@ -302,6 +302,73 @@ SOAP::WSDL::Expat::MessageParser checks the namespace of the SOAP envelope. SOAP::WSDL::Expat::MessageParser does not check that Envelope is the root element, yet. +=head2 R1110 + + An INSTANCE MAY accept connections on TCP port 80 (HTTP) + +SOAP::WSDL::Server::CGI may be used in a web server listening at port 80. + +=head2 R1124 + + An INSTANCE MUST use a 2xx HTTP status code for responses that + indicate a successful outcome of a request. + +SOAP::WSDL::Server::CGI sends a 2xx HTTP status code for successful requests. + +=head2 R1111 + + An INSTANCE SHOULD use a "200 OK" HTTP status code for responses + that contain a SOAP message that is not a SOAP fault. + +SOAP::WSDL::Server::CGI does this. + +=head2 R1112 + + An INSTANCE SHOULD use either a "200 OK" or "202 Accepted" HTTP + status code for a response that does do not contain a SOAP message + but indicates successful HTTP outcome of a request. + +SOAP::WSDL::Server::CGI does this. + +=head2 R1130 + + An INSTANCE MUST use HTTP status code "307 Temporary Redirect" + when redirecting a request to a different endpoint. + +SOAP::WSDL::Server::CGI has no means of redirecting. The web server running +a SOAP::WSDL::Server::CGI script is responsible for redirecting with a 307 +HTTP status code. + +=head2 R1125 + + An INSTANCE MUST use a 4xx HTTP status code for responses that indicate + a problem with the format of the request. + +SOAP::WSDL does this. + +=head2 R1113 + + An INSTANCE SHOULD use a "400 Bad Request "HTTP status code, if the + request message is a malformed HTTP request, or not well-formed XML. + +SOAP::WSDL does this. + +=head2 R1114 + + An INSTANCE SHOULD use a "405 Method not Allowed" HTTP status code if the + request method was not "POST". + +SOAP::WSDL does this. + +=head2 R1115 + + An INSTANCE SHOULD use a "415 Unsupported Media Type" HTTP status code if + the Content-Type HTTP request header did not have a value consistent with + the value specified for the corresponding binding of the input message. + +SOAP::WSDL::Server::CGI does not support any content type other than text/xml +and application/xml yet. + =head1 RULES NOT CONFIRMED @@ -310,7 +377,7 @@ element, yet. A RECEIVER MUST accept messages that include the Unicode Byte Order Mark (BOM). -May automatically work with XML::Parser::Expat, but is not testet yet. +May automatically work with XML::Parser::Expat, but is not tested yet. TODO write test. If not confirmed, add encoding support. @@ -339,6 +406,8 @@ TODO add processing of arbitrary attributes to SOAP::WSDL::SOAP::Typelib::Fault1 A RECEIVER MUST accept fault messages that carry an xml:lang attribute on the faultstring element. +SOAP::WSDL::Expat::MessageParser currently ignores all attributes. + TODO add processing of the xml:lang attribute to SOAP::WSDL::SOAP::Typelib::Fault11 =head2 R1007 @@ -555,94 +624,37 @@ SOAP::WSDL does not check mandatory header blocks yet. SOAP::WSDL does not check mandatory header blocks yet. -=head2 R1110 - - An INSTANCE MAY accept connections on TCP port 80 (HTTP) - -SOAP::WSDL does not act as server yet. - -=head2 R1124 - - An INSTANCE MUST use a 2xx HTTP status code for responses that - indicate a successful outcome of a request. - -SOAP::WSDL does not act as server yet. - -=head2 R1111 - - An INSTANCE SHOULD use a "200 OK" HTTP status code for responses - that contain a SOAP message that is not a SOAP fault. - -SOAP::WSDL does not act as server yet. - -=head2 R1112 - - An INSTANCE SHOULD use either a "200 OK" or "202 Accepted" HTTP - status code for a response that does do not contain a SOAP message - but indicates successful HTTP outcome of a request. - -SOAP::WSDL does not act as server yet. - -=head2 R1130 - - An INSTANCE MUST use HTTP status code "307 Temporary Redirect" - when redirecting a request to a different endpoint. - -SOAP::WSDL does not act as server yet. - -=head2 R1125 - - An INSTANCE MUST use a 4xx HTTP status code for responses that indicate - a problem with the format of the request. - -SOAP::WSDL does not act as server yet. - -=head2 R1113 - - An INSTANCE SHOULD use a "400 Bad Request "HTTP status code, if the - request message is a malformed HTTP request, or not well-formed XML. - -SOAP::WSDL does not act as server yet. - -=head2 R1114 - - An INSTANCE SHOULD use a "405 Method not Allowed" HTTP status code if the - request method was not "POST". - -SOAP::WSDL does not act as server yet. - -=head2 R1115 - - An INSTANCE SHOULD use a "415 Unsupported Media Type" HTTP status code if - the Content-Type HTTP request header did not have a value consistent with - the value specified for the corresponding binding of the input message. - -SOAP::WSDL does not act as server yet. - =head2 R1120 An INSTANCE MAY use the HTTP state mechanism ("Cookies"). -SOAP::WSDL does not act as server yet. +SOAP::WSDL::Server::CGI does not use cookies. A web server running a +SOAP::WSDL::Server::CGI script may use cookies.. =head2 R1122 An INSTANCE using Cookies SHOULD conform to RFC2965. -SOAP::WSDL does not act as server yet. + +SOAP::WSDL::Server::CGI does not use cookies. A web server running a +SOAP::WSDL::Server::CGI script may use cookies.. =head2 R1121 An INSTANCE SHOULD NOT require consumer support for Cookies in order to function correctly -SOAP::WSDL does not act as server yet. + +SOAP::WSDL::Server::CGI does not use cookies. A web server running a +SOAP::WSDL::Server::CGI script may use cookies. =head2 R1123 The value of the cookie MUST be considered to be opaque by the CONSUMER. -SOAP::WSDL does not act as server yet. + +SOAP::WSDL::Server::CGI does not use cookies. A web server running a +SOAP::WSDL::Server::CGI script may use cookies. =head2 R2028 @@ -1237,9 +1249,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 391 $ + $Rev: 478 $ $LastChangedBy: kutterma $ - $Id: WS_I.pod 391 2007-11-17 21:56:13Z kutterma $ + $Id: WS_I.pod 478 2007-12-27 14:15:01Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $ =cut diff --git a/lib/SOAP/WSDL/Serializer/XSD.pm b/lib/SOAP/WSDL/Serializer/XSD.pm index a6b4457..2f9bba8 100644 --- a/lib/SOAP/WSDL/Serializer/XSD.pm +++ b/lib/SOAP/WSDL/Serializer/XSD.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Class::Std::Fast::Storable; use Scalar::Util qw(blessed); -our $VERSION=q{2.00_25}; +our $VERSION=q{2.00_27}; my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/'; my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance'; @@ -62,10 +62,10 @@ sub serialize_body { return join ( q{}, "<$opt->{ namespace }->{ $SOAP_NS }\:Body>", defined $data - ? ref $data eq 'ARRAY' + ? ref $data eq 'ARRAY' ? join q{}, map { blessed $_ ? $_->serialize_qualified() : () } @{ $data } - : blessed $data - ? $data->serialize_qualified + : blessed $data + ? $data->serialize_qualified() : () : (), "{ namespace }->{ $SOAP_NS }\:Body>", @@ -119,9 +119,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 444 $ + $Rev: 477 $ $LastChangedBy: kutterma $ - $Id: XSD.pm 444 2007-12-07 20:04:06Z kutterma $ + $Id: XSD.pm 477 2007-12-24 10:23:52Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $ =cut diff --git a/lib/SOAP/WSDL/Server.pm b/lib/SOAP/WSDL/Server.pm index 0be3c40..f61aba8 100644 --- a/lib/SOAP/WSDL/Server.pm +++ b/lib/SOAP/WSDL/Server.pm @@ -6,7 +6,7 @@ use Scalar::Util qw(blessed); use SOAP::WSDL::Factory::Deserializer; use SOAP::WSDL::Factory::Serializer; -our $VERSION = q{2.00_25}; +our $VERSION = q{2.00_27}; my %dispatch_to_of :ATTR(:name :default<()>); my %action_map_ref_of :ATTR(:name :default<{}>); @@ -28,7 +28,7 @@ sub handle { soap_version => '1.1' }); -# TODO: factor out dispatcher logic into dispatcher factory + dispatcher +# TODO: factor out dispatcher logic into dispatcher factory + dispatcher # classes # $dispatcher_of{ $ident } ||= SOAP::WSDL::Factory::Dispatcher->get_dispatcher({}); @@ -143,12 +143,12 @@ SOAP::WSDL::Server basically follows the architecture sketched below | Handler | ------------------------------------- -All of the components (Transport class, deserializer, dispatcher and +All of the components (Transport class, deserializer, dispatcher and serializer) are implemented as plugins. -The architecture is not implemented as planned yet, but the dispatcher is +The architecture is not implemented as planned yet, but the dispatcher is currently part of SOAP::WSDL::Server, which aggregates serializer and -deserializer, and is subclassed by transport classes (of which +deserializer, and is subclassed by transport classes (of which SOAP::WSDL::Server::CGI is the only implemented one yet). The dispatcher is currently based on the SOAPAction header. This does not diff --git a/lib/SOAP/WSDL/Server/CGI.pm b/lib/SOAP/WSDL/Server/CGI.pm index f40cb99..ef26da1 100644 --- a/lib/SOAP/WSDL/Server/CGI.pm +++ b/lib/SOAP/WSDL/Server/CGI.pm @@ -12,13 +12,13 @@ use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Server); -our $VERSION=q{2.00_26}; +our $VERSION=q{2.00_27}; # 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... # # This should be a warning for us: We should not handle methods via inheritance, -# but via some plugin mechanism, to allow alternative handlers to be plugge +# but via some plugin mechanism, to allow alternative handlers to be plugged # in. sub handle { @@ -26,7 +26,7 @@ sub handle { my $response; my $length = $ENV{'CONTENT_LENGTH'} || 0; - if (!$length) { + if (!$length) { $response = HTTP::Response->new(411); # LENGTH REQUIRED $self->_output($response); return; @@ -37,7 +37,7 @@ sub handle { } my $content = q{}; - my $buffer; + my $buffer; binmode(STDIN); while (read(STDIN,$buffer,$length - length($content))) { $content .= $buffer; @@ -47,10 +47,10 @@ sub handle { $ENV{'REQUEST_METHOD'} || '' => $ENV{'SCRIPT_NAME'}, HTTP::Headers->new( map { - (/^HTTP_(.+)/i - ? ($1=~m/SOAPACTION/) + (/^HTTP_(.+)/i + ? ($1=~m/SOAPACTION/) ?('SOAPAction') - :($1) + :($1) : $_ ) => $ENV{$_} } keys %ENV), @@ -93,15 +93,14 @@ sub _output :PRIVATE { my ($self, $response) = @_; # imitate nph- cgi for IIS (pointed by Murray Nesbitt) my $status = defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/ - ? $ENV{SERVER_PROTOCOL} || 'HTTP/1.0' + ? $ENV{SERVER_PROTOCOL} || 'HTTP/1.0' : 'Status:'; my $code = $response->code; - binmode(STDOUT); + binmode(STDOUT); print STDOUT "$status $code ", HTTP::Status::status_message($code) , "\015\012", $response->headers_as_string("\015\012") , "\015\012", $response->content; - } 1; diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm index d88eabe..79a04cf 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin.pm @@ -409,11 +409,11 @@ Replace whitespace by @ in e-mail address. Martin Kutter Emartin.kutter fen-net.deE -=head1 Licenxe +=head1 LICENSE AND COPYRIGHT Copyright 2004-2007 Martin Kutter. -This library is free software, you may distribute/modify it under the +This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself =cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm b/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm index 3196680..e739523 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm @@ -3,6 +3,7 @@ use strict; use warnings; use Date::Parse; use Date::Format; +use Time::Zone; use Class::Std::Fast::Storable constructor => 'none', cache => 1; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); @@ -16,13 +17,17 @@ sub set_value { [\+\-] \d{2} \: \d{2} $ }xms ); - + no warnings qw(uninitialized); # strptime sets empty values to undef - and strftime doesn't like that... my @time_from = map { ! defined $_ ? 0 : $_ } strptime($_[1]); undef $time_from[$#time_from]; - my $time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from ); + my $time_str = do { # no warnings; + strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from ); + }; + + # insert : in timezone info substr $time_str, -2, 0, ':'; $_[0]->SUPER::set_value($time_str); } diff --git a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm index 9d739f1..d906992 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm @@ -9,7 +9,7 @@ require Class::Std::Fast::Storable; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType); -our $VERSION = '2.00_25'; +our $VERSION = '2.00_27'; my %ELEMENTS_FROM; my %ATTRIBUTES_OF; @@ -412,10 +412,10 @@ No facets are implemented yet. =head1 LICENSE AND COPYRIGHT -Copyright (c) 2007 Martin Kutter. All rights reserved. +Copyright 2007 Martin Kutter. -This file is part of SOAP-WSDL. You may distribute/modify it under -the same terms as perl itself. +This file is part of SOAP-WSDL. You may distribute/modify it under the same +terms as perl itself =head1 AUTHOR @@ -423,9 +423,9 @@ Martin Kutter Emartin.kutter fen-net.deE =head1 REPOSITORY INFORMATION - $Rev: 452 $ + $Rev: 477 $ $LastChangedBy: kutterma $ - $Id: ComplexType.pm 452 2007-12-12 14:46:54Z kutterma $ + $Id: ComplexType.pm 477 2007-12-24 10:23:52Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $ =cut diff --git a/lib/SOAP/WSDL/XSD/Typelib/Element.pm b/lib/SOAP/WSDL/XSD/Typelib/Element.pm index aa4e551..33fcfeb 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/Element.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/Element.pm @@ -2,7 +2,7 @@ package SOAP::WSDL::XSD::Typelib::Element; use strict; -our $VERSION=q{2.00_25}; +our $VERSION=q{2.00_27}; my %NAME; my %NILLABLE; @@ -159,4 +159,24 @@ namespace combination (Default for SOAP::WSDL::Envelope). =back +=head1 LICENSE AND COPYRIGHT + +Copyright 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 Emartin.kutter fen-net.deE + +=head1 REPOSITORY INFORMATION + + $Rev: 477 $ + $LastChangedBy: kutterma $ + $Id: Element.pm 477 2007-12-24 10:23:52Z kutterma $ + $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $ + =cut + + diff --git a/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm b/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm index 892346f..acbcba8 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm @@ -116,15 +116,23 @@ No facets are implemented yet. =back +=head1 LICENSE AND COPYRIGHT + +Copyright 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 -Replace whitespace by @ in e-mail address. +Martin Kutter Emartin.kutter fen-net.deE - Martin Kutter Emartin.kutter fen-net.deE +=head1 REPOSITORY INFORMATION -=head1 COPYING - -This library is free software, you may distribute/modify it under the -same terms as perl itself + $Rev: 477 $ + $LastChangedBy: kutterma $ + $Id: SimpleType.pm 477 2007-12-24 10:23:52Z kutterma $ + $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm $ =cut + diff --git a/t/SOAP/WSDL/12_binding.t b/t/SOAP/WSDL/12_binding.t index 6d9268a..4c5ba21 100644 --- a/t/SOAP/WSDL/12_binding.t +++ b/t/SOAP/WSDL/12_binding.t @@ -1,4 +1,5 @@ use strict; +use warnings; use lib '../../../lib'; use Test::More tests => 4; use SOAP::WSDL; @@ -11,17 +12,13 @@ my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; - print "# Using SOAP::WSDL Version $SOAP::WSDL::VERSION\n"; # chdir to my location my $soap = undef; -my $path = File::Spec->rel2abs( dirname __FILE__ ); - my $proxy = 'http://127.0.0.1/testPort'; - ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl' ) ); diff --git a/t/SOAP/WSDL/Deserializer/SOM.t b/t/SOAP/WSDL/Deserializer/SOM.t index 0fd4c47..27a7348 100644 --- a/t/SOAP/WSDL/Deserializer/SOM.t +++ b/t/SOAP/WSDL/Deserializer/SOM.t @@ -19,7 +19,7 @@ my $data = $som->match('/a')->valueof; is $data->{ c } , 3; SKIP: { - skip "SOAP::Lite > 0.69 required" , 2 if ($SOAP::Lite::VERSION < 0.69); + skip "SOAP::Lite > 0.69 required" , 2 if ($SOAP::Lite::VERSION lt '0.69'); is $data->{ b }->[0] , 1, "array values - SOAP::Lite $SOAP::Lite::VERSION";; is $data->{ b }->[1] , 2, "array values - SOAP::Lite $SOAP::Lite::VERSION";; } diff --git a/t/SOAP/WSDL/XSD/Typelib/Builtin/date.t b/t/SOAP/WSDL/XSD/Typelib/Builtin/date.t index 61348e3..d558405 100644 --- a/t/SOAP/WSDL/XSD/Typelib/Builtin/date.t +++ b/t/SOAP/WSDL/XSD/Typelib/Builtin/date.t @@ -1,9 +1,10 @@ use Test::More tests => 30; use strict; -use Carp qw(cluck); - -$SIG{__WARN__} = sub { cluck @_ }; use warnings; +#use Carp qw(cluck); +# +#$SIG{__WARN__} = sub { cluck @_ }; +#use warnings; use lib '../lib'; use Date::Format; use Date::Parse; diff --git a/t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t b/t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t index 3303fa1..4729c07 100644 --- a/t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t +++ b/t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t @@ -1,7 +1,7 @@ -use Test::More tests => 7; use strict; use warnings; use lib '../lib'; +use Test::More tests => 7; use Date::Parse; use Date::Format; diff --git a/t/SOAP/WSDL/XSD/Typelib/ComplexType.t b/t/SOAP/WSDL/XSD/Typelib/ComplexType.t index e72a8c9..92c9745 100644 --- a/t/SOAP/WSDL/XSD/Typelib/ComplexType.t +++ b/t/SOAP/WSDL/XSD/Typelib/ComplexType.t @@ -45,7 +45,7 @@ package main; use Test::More tests => 100; use Storable; -my $have_warn = eval { use Test::Warn; 1; }; +my $have_warn = eval { require Test::Warn; import Test::Warn; 1; }; my $obj; @@ -67,7 +67,7 @@ is scalar keys %{ $hash_of_ref }, 0; SKIP: { skip 'Cannot test warnings without Test::Warn', 1 if not $have_warn; - warning_is { $obj->add_test() } 'attempting to add empty value to MyType'; + warning_is( sub { $obj->add_test() }, 'attempting to add empty value to MyType' ); } $obj = MyType->new({ test => 'Test1'});