SOAP-WSDL-3.003/0000755000175000017500000000000012507276245007762 5ustar SOAP-WSDL-3.003/t/0000755000175000017500000000000012507276245010225 5ustar SOAP-WSDL-3.003/t/003_wsdl_based_serializer.t0000644000175000017500000000513012377443515015334 0ustar use Test::More tests => 11; use lib '../lib'; use File::Basename qw(dirname); use Cwd; my $path = dirname __FILE__; use_ok(qw/SOAP::WSDL::Expat::WSDLParser/); my $filter; my $parser; ok($parser = SOAP::WSDL::Expat::WSDLParser->new() ); eval { $parser->parse_file( "$path/test.wsdl" ) }; if ($@) { fail("parsing WSDL: $@"); die "Can't test without parsed WSDL"; } else { pass("parsing XML"); } my $wsdl; ok( $wsdl = $parser->get_data() , "get object tree"); my $schema = $wsdl->first_types(); my $opt = { readable => 0, autotype => 1, namespace => $wsdl->get_xmlns(), indent => "\t", typelib => $schema, }; is( $schema->find_type( 'urn:myNamespace', 'testSimpleType1' )->serialize( 'test', 1 , $opt ), q{1} , "serialize simple type"); is( $schema->find_type( 'urn:myNamespace', 'testSimpleList' )->serialize( 'testList', [ 1, 2, 3 ] , $opt), q{1 2 3}, "serialize simple list type" ); is( $schema->find_element( 'urn:myNamespace', 'TestElement' )->serialize( undef, 1 , $opt), q{1}, "Serialize element" ); $opt->{ readable } = 0; is( $schema->find_type( 'urn:myNamespace', 'length3')->serialize( 'TestComplex', { size => -13, unit => 'BLA' } , $opt ), q{} . q{-13} . q{BLA} , "serialize complex type" ); is( $schema->find_element( 'urn:myNamespace', 'TestElementComplexType')->serialize( undef, { size => -13, unit => 'BLA' } , $opt ), q{} . q{-13} . q{BLA}, "element with complex type" ); is( $schema->find_type( 'urn:myNamespace', 'complex')->serialize( 'complexComplex', { 'length' => { size => -13, unit => 'BLA' }, 'int' => 1 }, $opt ), q{} . q{} . q{-13} . q{BLA} . q{1}, "nested complex type" ); is( $wsdl->find_message('urn:myNamespace', 'testRequest')->first_part()->serialize( undef, { test => { length => { size => -13, unit => 'BLA' } , int => 3 } }, $opt ), q{} . q{} . q{-13} . q{BLA} . q{3} , "Message part" ); SOAP-WSDL-3.003/t/SOAP/0000755000175000017500000000000012507276245010767 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL_1.wsdl0000644000175000017500000000377412375112740012656 0ustar SOAP-WSDL-3.003/t/SOAP/WSDL_EMPTY_DEFINITIONS.wsdl0000644000175000017500000000050412375112740015233 0ustar SOAP-WSDL-3.003/t/SOAP/WSDL_NO_BINDING.wsdl0000644000175000017500000000377412375112740014164 0ustar SOAP-WSDL-3.003/t/SOAP/WSDL.t0000644000175000017500000000465512377443515011740 0ustar use strict; use warnings; use Test::More tests => 13; use File::Spec; use File::Basename qw(dirname); use_ok qw(SOAP::WSDL); my $path = File::Spec->rel2abs(dirname( __FILE__ ) ); $path =~s{\\}{/}xmsg; # fix for windows my $soap = SOAP::WSDL->new(); $soap->wsdl("file://$path/WSDL_NOT_FOUND.wsdl"); eval { $soap->wsdlinit() }; like $@, qr{ does \s not \s exist }x, 'does not exist'; eval { $soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_NOT_FOUND.wsdl"); }; like $@, qr{ does \s not \s exist }x, 'does not exist (constructor)'; $soap = SOAP::WSDL->new(); $soap->wsdl( "file://$path/WSDL_EMPTY_DEFINITIONS.wsdl"); eval { $soap->wsdlinit() }; like $@, qr{ unable \s to \s extract \s schema \s from \s WSDL }x, 'empty definition'; # Try out all call() variants eval { $soap->call('NewOperation', 'value'); }; like $@, qr{ unable \s to \s extract \s schema \s from \s WSDL }x, 'empty definition'; $soap = SOAP::WSDL->new(); $soap->wsdl( "file://$path/WSDL_NO_MESSAGE.wsdl"); eval { $soap->wsdlinit() }; # eval { $soap->call('NewOperation', 'value'); }; like $@, qr{ Message \s \{http://www.example.org/WSDL_1/\}NewOperationRequest \s not \s found }x, 'empty definition'; $soap = SOAP::WSDL->new(); $soap->wsdl( "file://$path/WSDL_1.wsdl"); $soap->wsdlinit(); $soap->no_dispatch(1); like $soap->call('NewOperation', NewOperation => { in => 'test' }), qr{ test }x; like $soap->call('NewOperation', { NewOperation => { in => 'test' } }), qr{ test }x; $soap->set_proxy('http://foo.de', timeout => 256); is $soap->get_client->get_transport()->timeout(), 256, 'timeout'; $soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_1.wsdl", servicename => 'NewService', portname => 'NewPort', no_dispatch => 1, keep_alive => 1, ); $soap->proxy('http://example.org'); like $soap->call('NewOperation', NewOperation => { in => 'test' }), qr{ test }x; like $soap->call('NewOperation', { NewOperation => { in => 'test' } }), qr{ test }x; eval { $soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_NO_BINDING.wsdl", servicename => 'NewService', portname => 'NewPort', no_dispatch => 1, ); }; like $@, qr{ no \s binding }x, 'No binding error'; eval { $soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_NO_PORTTYPE.wsdl", servicename => 'NewService', portname => 'NewPort', no_dispatch => 1, ); }; like $@, qr{ cannot \s find \s portType }x, 'No porttype error'; SOAP-WSDL-3.003/t/SOAP/WSDL_NO_PORTTYPE.wsdl0000644000175000017500000000377412375112740014400 0ustar SOAP-WSDL-3.003/t/SOAP/WSDL/0000755000175000017500000000000012507276245011540 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/06_keep_alive.t0000644000175000017500000000157212375112740014333 0ustar use Test::More tests => 6; use strict; use warnings; use diagnostics; use lib '../lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $soap; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl', keep_alive => 1, ), 'Instantiated object' ); ok( ($soap->servicename('testService') ), 'set service' ); ok( ($soap->portname('testPort2') ) ,'set portname'); ok( $soap->wsdlinit(), 'parsed WSDL' ); eval { $soap = SOAP::WSDL->new( wsdl => 'file:///' . $path . '/../../acceptance/wsdl/FOOBAR', keep_alive => 1, ); }; like $@, qr{ does \s not \s exist }x, 'error on non-existant WSDL';SOAP-WSDL-3.003/t/SOAP/WSDL/11_helloworld.NET.t0000644000175000017500000000303112375112740015013 0ustar #!/usr/bin/perl -w ####################################################################################### # # 2_helloworld.t # # Acceptance test for message encoding, based on .NET wsdl and example code. # SOAP::WSDL's encoding doesn't I match the .NET example, because # .NET doesn't always specify types (SOAP::WSDL does), and the namespace # prefixes chosen are different (maybe the encoding style, too ? this would be a bug !) # ######################################################################################## use strict; use Test::More tests => 4; use lib '../../../lib/'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok q/SOAP::WSDL/; ### test vars END print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n"; print "# Acceptance test against sample output with simple WSDL\n"; my $data = { name => 'test', givenName => 'test', }; my $soap = undef; ok $soap = SOAP::WSDL->new( wsdl => 'file://'.$url.'/../../acceptance/wsdl/11_helloworld.wsdl', no_dispatch => 1 ), 'Create SOAP::WSDL object'; # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); $soap->proxy('http://helloworld/helloworld.asmx'); ok $soap->wsdlinit( servicename => 'Service1', ), 'wsdlinit'; ok $soap->call('sayHello', 'sayHello' => $data), 'soap call'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/0000755000175000017500000000000012507276245012176 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/SimpleType.t0000644000175000017500000000214512375112740014450 0ustar use strict; use warnings; use Test::More tests => 12; use_ok qw(SOAP::WSDL::XSD::SimpleType); my $obj = SOAP::WSDL::XSD::SimpleType->new(); $obj->set_list({ LocalName => 'foo', Value => 'bar'}, { LocalName => 'itemType', Value => 'xsd:int'} ); is $obj->get_flavor(), 'list'; is $obj->get_itemType(), 'xsd:int'; is $obj->serialize('Foo', ['Foo', 'Bar']), 'Foo Bar'; $obj->set_union({ LocalName => 'foo', Value => 'bar'}, { LocalName => 'memberTypes', Value => 'xsd:int'} ); is $obj->get_flavor(), 'union'; is $obj->get_base()->[0], 'xsd:int'; $obj->set_union({ LocalName => 'foo', Value => 'bar'}, { LocalName => 'memberTypes', Value => 'xsd:int xsd:string'} ); is $obj->get_flavor(), 'union'; is $obj->get_base()->[1], 'xsd:string'; is $obj->serialize('Foo', 'Foobar'), 'Foobar'; $obj->set_flavor('enumeration'); is $obj->serialize('Foo', 'Foobar'), 'Foobar'; # TODO die on non-serializable content... $obj->set_flavor(''); is $obj->serialize('Foo', 'Foobar'), ''; ok eval { $obj->set_restriction({ LocalName => 'bar'}, { LocalName => 'base', Value => 'string' }); 1; };SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Schema.t0000644000175000017500000000166212375112740013560 0ustar use strict; use warnings; use Test::More tests => 4; use SOAP::WSDL::XSD::Element; use_ok qw(SOAP::WSDL::XSD::Schema); my $obj = SOAP::WSDL::XSD::Schema->new({ element => [ SOAP::WSDL::XSD::Element->new({ name => 'foo', xmlns => { '#default' => 'bar' }, }), SOAP::WSDL::XSD::Element->new({ name => 'foo', targetNamespace => 'baz', xmlns => { '#default' => 'baz' }, }), SOAP::WSDL::XSD::Element->new({ name => 'foobar', targetNamespace => 'bar', xmlns => { '#default' => 'bar' }, }), ] }); my $found= $obj->find_element('bar', 'foobar'); is $found->get_name(), 'foobar', 'found Element'; $found = $obj->find_element('baz', 'foo'); is $found->get_name(), 'foo', 'found Element'; $found = $obj->find_element('baz', 'foobar'); is $found, undef, 'find_Element returns undef on unknown Element';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Builtin.t0000644000175000017500000000053012375112740013757 0ustar use strict; use warnings; use Test::More tests => 2; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::Builtin); my $foo = SOAP::WSDL::XSD::Builtin->new(); $foo->set_targetNamespace('bar'); eval { $foo->serialize( 'foo', 'bar', { autotype => 1 , namespace => {} } ) }; like $@, qr{^No \s prefix \s found \s for \s namespace \s bar}x;SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/AttributeGroup.t0000644000175000017500000000025012375112740015330 0ustar use strict; use warnings; use Test::More tests => 2; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::AttributeGroup); ok my $group = SOAP::WSDL::XSD::AttributeGroup->new(); SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/0000755000175000017500000000000012507276245013606 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/0000755000175000017500000000000012507276245015214 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/token.t0000644000175000017500000000075712375112740016522 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN; my $NMTOKEN = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN->new(); is $NMTOKEN->get_value(), undef; $NMTOKEN = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN->new({}); is $NMTOKEN->get_value(), undef; ok $NMTOKEN = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN->new({ value => 127 }); is "$NMTOKEN", "127", 'stringification'; ok $NMTOKEN->isa('SOAP::WSDL::XSD::Typelib::Builtin::token'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.t0000644000175000017500000000064512375112740017453 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth->new(); ok defined $obj; ok $obj->set_value('1271'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth->new({ value => '1271-12' }); is "$obj", "1271-12", 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/gDay.t0000644000175000017500000000065012375112740016256 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::gDay; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::gDay->new(); ok defined $obj; ok $obj->set_value('27'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::gDay->new({ value => 27 }); is $obj * 1, 27, 'numerification'; is "$obj", "27", 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/date.t0000644000175000017500000000553412375112740016315 0ustar use Test::More tests => 31; use strict; use warnings; #use Carp qw(cluck); # #$SIG{__WARN__} = sub { cluck @_ }; #use warnings; use lib '../lib'; use Date::Format; use Date::Parse; use_ok('SOAP::WSDL::XSD::Typelib::Builtin::date'); my $obj; sub timezone { my @time = map { defined $_ ? $_ : 0 } strptime shift; my $tz = strftime('%z', @time); substr $tz, -2, 0, ':'; return $tz; } my %dates = ( '2007/12/31' => '2007-12-31', '2007:08:31' => '2007-08-31', '30 Aug 2007' => '2007-08-30', ); my %localized_date_of = ( '2007-12-31T00:00:00.0000000+0000' => '2007-12-31+00:00', '2007-12-31T00:00:00.0000000+0130' => '2007-12-31+01:30', '2007-12-31T00:00:00.0000000+0200' => '2007-12-31+02:00', '2007-12-31T00:00:00.0000000+0300' => '2007-12-31+03:00', '2007-12-31T00:00:00.0000000+0400' => '2007-12-31+04:00', '2007-12-31T00:00:00.0000000+0500' => '2007-12-31+05:00', '2007-12-31T00:00:00.0000000+0600' => '2007-12-31+06:00', '2007-12-31T00:00:00.0000000+0700' => '2007-12-31+07:00', '2007-12-31T00:00:00.0000000+0800' => '2007-12-31+08:00', '2007-12-31T00:00:00.0000000+0900' => '2007-12-31+09:00', '2007-12-31T00:00:00.0000000+1000' => '2007-12-31+10:00', '2007-12-31T00:00:00.0000000+1100' => '2007-12-31+11:00', '2007-12-31T00:00:00.0000000+1200' => '2007-12-31+12:00', '2007-12-31T00:00:00.0000000-0100' => '2007-12-31-01:00', '2007-12-31T00:00:00.0000000-0200' => '2007-12-31-02:00', '2007-12-31T00:00:00.0000000-0300' => '2007-12-31-03:00', '2007-12-31T00:00:00.0000000-0400' => '2007-12-31-04:00', '2007-12-31T00:00:00.0000000-0500' => '2007-12-31-05:00', '2007-12-31T00:00:00.0000000-0600' => '2007-12-31-06:00', '2007-12-31T00:00:00.0000000-0700' => '2007-12-31-07:00', '2007-12-31T00:00:00.0000000-0800' => '2007-12-31-08:00', '2007-12-31T00:00:00.0000000-0900' => '2007-12-31-09:00', '2007-12-31T00:00:00.0000000-1000' => '2007-12-31-10:00', '2007-12-31T00:00:00.0000000-1100' => '2007-12-31-11:00', '2007-12-31T00:00:00.0000000-1200' => '2007-12-31-12:00', ); $obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new(); $obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new({}); $obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new({ value => '2007-12-31' }); while (my ($date, $converted) = each %localized_date_of ) { $obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new(); $obj->set_value( $date ); is $obj->get_value() , $converted , 'conversion'; } while (my ($date, $converted) = each %dates ) { $obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new(); $obj->set_value( $date ); is $obj->get_value() , $converted . timezone($date), 'conversion'; } $obj->set_value( '2037-12-31+12:00' ); is $obj->get_value() , '2037-12-31+12:00', 'no conversion on match'; $obj->set_value('2007-12-31+01:00'); is $obj->get_value(), '2007-12-31+01:00'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/long.t0000644000175000017500000000065512375112740016336 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::long; my $long = SOAP::WSDL::XSD::Typelib::Builtin::long->new(); ok defined $long; ok $long->set_value('127'); ok $long = SOAP::WSDL::XSD::Typelib::Builtin::long->new({ value => 127 }); is $long * 1, 127, 'numerification'; is "$long", "127", 'stringification'; ok $long->isa('SOAP::WSDL::XSD::Typelib::Builtin::decimal'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.t0000644000175000017500000000077612375112740017672 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt; my $unsignedInt = SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt->new(); ok defined $unsignedInt; ok $unsignedInt->set_value('127'); ok $unsignedInt = SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt->new({ value => 127 }); is $unsignedInt * 1, 127, 'numerification'; is "$unsignedInt", "127", 'stringification'; ok $unsignedInt->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/anyType.t0000644000175000017500000000212212375112740017017 0ustar use strict; use warnings; use Test::More tests => 4; use Scalar::Util qw(blessed); use_ok qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType); is SOAP::WSDL::XSD::Typelib::Builtin::anyType->get_xmlns(), 'http://www.w3.org/2001/XMLSchema', 'get_xmlns'; #is SOAP::WSDL::XSD::Typelib::Builtin::anyType->serialize(), q{}, 'serialize to empty'; is SOAP::WSDL::XSD::Typelib::Builtin::anyType->start_tag(), q{}, 'serialize to empty'; is SOAP::WSDL::XSD::Typelib::Builtin::anyType->start_tag({ name => 'foo'}), q{}, 'serialize with name'; exit 0; __END__ # cannot instantiate abstract type... my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new(); ok blessed $obj, 'constructor returned blessed reference'; $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new({ xmlns => 'urn:Siemens.mosaic' }); ok blessed $obj, 'constructor returned blessed reference'; is $obj->get_xmlns(), 'http://www.w3.org/2001/XMLSchema', 'get_xmlns'; is $obj->start_tag({ name => 'test' }), '', 'start_tag'; is $obj->end_tag({ name => 'test' }), '', 'end_tag'; is "$obj", q{}, 'serialize overloading';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.t0000644000175000017500000000212412375112740016626 0ustar use Test::More tests => 8; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS; my $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new(); is $NMTOKENS->get_value(), undef, 'get undef value'; $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({}); is $NMTOKENS->get_value(), undef, 'get undef value after new with {}'; ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => [ 127 , 'Test' ] }); is $NMTOKENS->serialize(), '127 Test', 'stringification'; ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => 'Test' }) , 'constructor'; is "$NMTOKENS", "Test", 'stringification'; $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => undef }); #{ # my $found = 0; # local $SIG{__WARN__} = sub { # # die $_[0]; # $found++ if $_[0] =~m{Use \s of \s uninitialized \s value}x; # }; # ok ! "$NMTOKENS"; # is $found, 1; #} ok $NMTOKENS->isa('SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN'), 'inheritance'; ok $NMTOKENS->isa('SOAP::WSDL::XSD::Typelib::Builtin::list'), 'inheritance'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.t0000644000175000017500000000077012375112740017626 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::base64Binary; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::base64Binary->new(); { no warnings qw(uninitialized); is "$obj", '', 'stringification'; } ok defined $obj; ok $obj->set_value('AAAA=='); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::base64Binary->new({ value => 'AAAA==' }); is "$obj", 'AAAA==', 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.t0000644000175000017500000000101012375112740020015 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong; my $unsignedLong = SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong->new(); ok defined $unsignedLong; ok $unsignedLong->set_value('127'); ok $unsignedLong = SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong->new({ value => 127 }); is $unsignedLong * 1, 127, 'numerification'; is "$unsignedLong", "127", 'stringification'; ok $unsignedLong->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/ID.t0000644000175000017500000000067512375112740015675 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::ID; my $ID = SOAP::WSDL::XSD::Typelib::Builtin::ID->new(); is $ID->get_value(), undef; $ID = SOAP::WSDL::XSD::Typelib::Builtin::ID->new({}); is $ID->get_value(), undef; ok $ID = SOAP::WSDL::XSD::Typelib::Builtin::ID->new({ value => 'Test' }); is "$ID", 'Test', 'stringification'; ok $ID->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.t0000644000175000017500000000101012375112740020021 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte; my $unsignedByte = SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte->new(); ok defined $unsignedByte; ok $unsignedByte->set_value('127'); ok $unsignedByte = SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte->new({ value => 127 }); is $unsignedByte * 1, 127, 'numerification'; is "$unsignedByte", "127", 'stringification'; ok $unsignedByte->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/float.t0000644000175000017500000000065112375112740016500 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::float; my $float = SOAP::WSDL::XSD::Typelib::Builtin::float->new(); ok $float = SOAP::WSDL::XSD::Typelib::Builtin::float->new({ value => 127.23 }); is $float * 1, 127.23, 'numerification'; is "$float", "127.23", 'stringification'; ok $float->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance'; # TODO test rangeSOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/integer.t0000644000175000017500000000103112375112740017021 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::integer; my $integer = SOAP::WSDL::XSD::Typelib::Builtin::integer->new(); is $integer->get_value(), undef; $integer = SOAP::WSDL::XSD::Typelib::Builtin::integer->new({}); is $integer->get_value(), undef; ok $integer = SOAP::WSDL::XSD::Typelib::Builtin::integer->new({ value => 127 }); is $integer * 1, 127, 'numerification'; is "$integer", "127", 'stringification'; ok $integer->isa('SOAP::WSDL::XSD::Typelib::Builtin::decimal'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.t0000644000175000017500000000073212375112740016224 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::IDREF; my $IDREF = SOAP::WSDL::XSD::Typelib::Builtin::IDREF->new(); is $IDREF->get_value(), undef; $IDREF = SOAP::WSDL::XSD::Typelib::Builtin::IDREF->new({}); is $IDREF->get_value(), undef; ok $IDREF = SOAP::WSDL::XSD::Typelib::Builtin::IDREF->new({ value => 127 }); is "$IDREF", "127", 'stringification'; ok $IDREF->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.t0000644000175000017500000000065612375112740016634 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::gMonth; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::gMonth->new(); ok defined $obj; ok $obj->set_value('12'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::gMonth->new({ value => 12 }); is $obj * 1, 12, 'numerification'; is "$obj", "12", 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.t0000644000175000017500000000075712375112740021175 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger; my $nonNegativeInteger = SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger->new(); ok $nonNegativeInteger = SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger->new({ value => 127 }); is $nonNegativeInteger * 1, 127, 'numerification'; is "$nonNegativeInteger", "127", 'stringification'; ok $nonNegativeInteger->isa('SOAP::WSDL::XSD::Typelib::Builtin::integer'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.t0000644000175000017500000000074412375112740016511 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::token; my $token = SOAP::WSDL::XSD::Typelib::Builtin::token->new(); is $token->get_value(), undef; $token = SOAP::WSDL::XSD::Typelib::Builtin::token->new({}); is $token->get_value(), undef; ok $token = SOAP::WSDL::XSD::Typelib::Builtin::token->new({ value => 127 }); is "$token", "127", 'stringification'; ok $token->isa('SOAP::WSDL::XSD::Typelib::Builtin::normalizedString'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/list.t0000644000175000017500000000147512375112740016353 0ustar package ListTest; use base qw(SOAP::WSDL::XSD::Typelib::Builtin::list SOAP::WSDL::XSD::Typelib::Builtin::string); package main; use Test::More tests => 11; use strict; use warnings; my $obj = ListTest->new(); is $obj->get_value(), undef; $obj = ListTest->new({}); is $obj->get_value(), undef; ok $obj = ListTest->new({ value => 'Test' }); is "$obj", 'Test', 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::string'), 'inheritance'; $obj->set_value(undef); is $obj->get_value, undef; is $obj->serialize(), '', 'serialize undef to empty string'; is $obj->serialize({ empty => 1 }), '', 'serialize undef to empty string'; $obj->set_value(42); is $obj->get_value, 42; is $obj->serialize(), '42', 'serialize undef to empty string'; $obj->set_value([1,2,3]); is $obj->serialize(), '1 2 3', 'list serialization';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/QName.t0000644000175000017500000000056212375112740016375 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::QName; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::QName->new(); ok defined $obj; ok $obj->set_value('wsdl:foo'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::QName->new({ value => 'wsdl:foo' }); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/boolean.t0000644000175000017500000000354212375112740017014 0ustar use Test::More tests => 29; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::boolean; my $bool; $bool = SOAP::WSDL::XSD::Typelib::Builtin::boolean->new(); ok defined $bool; is "$bool", '', 'serialized undef to empty string'; $bool = SOAP::WSDL::XSD::Typelib::Builtin::boolean->new({}); ok defined $bool; ok $bool = SOAP::WSDL::XSD::Typelib::Builtin::boolean->new({ value => 'true' }); is $bool * 1 , 1, 'numerification'; ok $bool, 'boolification'; is $bool->serialize(), 'true', 'serialization'; $bool->set_value('1'); is $bool->serialize(), 'true'; is "$bool", 1, 'stringification'; $bool ? pass 'boolification' : fail 'boolification'; $bool->set_value('0'); is $bool->serialize(), 'false'; ! $bool ? pass 'boolification' : fail 'boolification'; $bool->set_value(undef); is $bool->serialize(), 'false'; ! $bool ? pass 'boolification' : fail 'boolification'; $bool->set_value('false'); if ($bool) { fail 'boolification'; } else { pass 'boolification'; } is "$bool", '0', 'stringification'; ok $bool->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance'; is $bool->serialize({ name => 'test'}), 'false'; is $bool->serialize(), 'false'; $bool->delete_value(); is $bool->serialize, '', 'serialized undef to empty string'; is "$bool", '', 'stringified undef to empty string'; $bool->set_value(''); is $bool->serialize, 'false', 'serialized empty string to false'; is "$bool", 0, 'stringified empty string to 0'; $SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType::___value->{ ${ $bool } } = 'true'; is $bool->serialize(), 'true', 'serialization'; is "$bool", 1, 'stringification'; is 3 * $bool, 3, 'numerification'; $SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType::___value->{ ${ $bool } } = 'false'; is $bool->serialize(), 'false', 'serialization'; is "$bool", 0, 'numerification'; is 3 * $bool, 0, 'stringification';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/language.t0000644000175000017500000000073612375112740017162 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::language; my $Name = SOAP::WSDL::XSD::Typelib::Builtin::language->new(); is $Name->get_value(), undef; $Name = SOAP::WSDL::XSD::Typelib::Builtin::language->new({}); is $Name->get_value(), undef; ok $Name = SOAP::WSDL::XSD::Typelib::Builtin::language->new({ value => 'DE' }); is "$Name", "DE", 'stringification'; ok $Name->isa('SOAP::WSDL::XSD::Typelib::Builtin::token'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.t0000644000175000017500000000103012375112740017314 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::hexBinary; my $hexBinary = SOAP::WSDL::XSD::Typelib::Builtin::hexBinary->new(); is $hexBinary->get_value(), undef; $hexBinary = SOAP::WSDL::XSD::Typelib::Builtin::hexBinary->new({}); is $hexBinary->get_value(), undef; ok $hexBinary = SOAP::WSDL::XSD::Typelib::Builtin::hexBinary->new({ value => 'a1b2c3d4' }); is "$hexBinary", "a1b2c3d4", 'stringification'; ok $hexBinary->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.t0000644000175000017500000000134112375112740016404 0ustar use Test::More tests => 9; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::ENTITY; my $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new(); is $ENTITY->get_value(), undef; $ENTITY->set_value(127); is "$ENTITY", "127", 'stringification'; ok $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({ value => 127 }); is "$ENTITY", "127", 'stringification'; undef $ENTITY; $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({}); is $ENTITY->get_value(), undef; ok $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({ value => 127 }); is "$ENTITY", "127", 'stringification'; is $ENTITY->get_value(), "127", 'stringification'; ok $ENTITY->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/byte.t0000644000175000017500000000065312375112740016340 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::byte; my $byte = SOAP::WSDL::XSD::Typelib::Builtin::byte->new(); ok defined $byte; ok $byte->set_value('127'); ok $byte = SOAP::WSDL::XSD::Typelib::Builtin::byte->new({ value => 127 }); is $byte * 1, 127, 'numerification'; is "$byte", "127", 'stringification'; ok $byte->isa('SOAP::WSDL::XSD::Typelib::Builtin::short'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.t0000644000175000017500000000102212375112740020220 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort; my $unsignedShort = SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort->new(); ok defined $unsignedShort; ok $unsignedShort->set_value('127'); ok $unsignedShort = SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort->new({ value => 127 }); is $unsignedShort * 1, 127, 'numerification'; is "$unsignedShort", "127", 'stringification'; ok $unsignedShort->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/duration.t0000644000175000017500000000063312375112740017220 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::duration; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::duration->new(); ok defined $obj; ok $obj->set_value('27'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::duration->new({ value => 'P1347Y'}); is "$obj", 'P1347Y', 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.t0000644000175000017500000000074212375112740020554 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger; my $positiveInteger = SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger->new(); ok $positiveInteger = SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger->new({ value => 127 }); is $positiveInteger * 1, 127, 'numerification'; is "$positiveInteger", "127", 'stringification'; ok $positiveInteger->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/gYear.t0000644000175000017500000000066312375112740016445 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::gYear; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::gYear->new(); ok defined $obj; ok $obj->set_value('1271'); ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::gYear->new({ value => 1271 }); is $obj * 1, 1271, 'numerification'; is "$obj", "1271", 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.t0000644000175000017500000000131012375112740016340 0ustar use Test::More tests => 8; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::IDREFS; my $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new(); is $IDREFS->get_value(), undef; $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({}); is $IDREFS->get_value(), undef; ok $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({ value => [ 127 , 'Test' ] }); is $IDREFS->serialize(), "127 Test", 'stringification'; ok $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({ value => 'Test' }); is "$IDREFS", "Test", 'stringification'; ok $IDREFS->isa('SOAP::WSDL::XSD::Typelib::Builtin::IDREF'), 'inheritance'; ok $IDREFS->isa('SOAP::WSDL::XSD::Typelib::Builtin::list'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/int.t0000644000175000017500000000064012375112740016163 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::int; my $int = SOAP::WSDL::XSD::Typelib::Builtin::int->new(); ok defined $int; ok $int->set_value('127'); ok $int = SOAP::WSDL::XSD::Typelib::Builtin::int->new({ value => 127 }); is $int * 1, 127, 'numerification'; is "$int", "127", 'stringification'; ok $int->isa('SOAP::WSDL::XSD::Typelib::Builtin::long'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/Name.t0000644000175000017500000000074512375112740016257 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::Name; my $Name = SOAP::WSDL::XSD::Typelib::Builtin::Name->new(); is $Name->get_value(), undef; $Name = SOAP::WSDL::XSD::Typelib::Builtin::Name->new({}); is $Name->get_value(), undef; ok $Name = SOAP::WSDL::XSD::Typelib::Builtin::Name->new({ value => 'xsd:Test' }); is "$Name", "xsd:Test", 'stringification'; ok $Name->isa('SOAP::WSDL::XSD::Typelib::Builtin::normalizedString'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.t0000644000175000017500000000070312375112740017263 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay; my $gMonthDay = SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay->new(); ok defined $gMonthDay; ok $gMonthDay->set_value('12-27'); ok $gMonthDay = SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay->new({ value => '12-27' }); is "$gMonthDay", "12-27", 'stringification'; ok $gMonthDay->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.t0000644000175000017500000000155712375112740020734 0ustar use Test::More tests => 9; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::normalizedString; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::normalizedString->new(); is $obj->get_value(), undef; $obj = SOAP::WSDL::XSD::Typelib::Builtin::normalizedString->new({}); is $obj->get_value(), undef; ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::normalizedString->new({ value => 'Test' }); is "$obj", 'Test', 'stringification'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::string'), 'inheritance'; $obj->set_value(undef); is $obj->get_value, undef; $obj->set_value( "&\t\"Aber\"\n\r"); is $obj->get_value() , '& "Aber" '; is $obj->serialize, '& "Aber" <test>' , 'escape text on serialization'; is $obj->serialize({ name => 'test'}) , '& "Aber" <test>' , 'Serialization with name';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/short.t0000644000175000017500000000066312375112740016535 0ustar use Test::More tests => 6; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::short; my $short = SOAP::WSDL::XSD::Typelib::Builtin::short->new(); ok defined $short; ok $short->set_value('127'); ok $short = SOAP::WSDL::XSD::Typelib::Builtin::short->new({ value => 127 }); is $short * 1, 127, 'numerification'; is "$short", "127", 'stringification'; ok $short->isa('SOAP::WSDL::XSD::Typelib::Builtin::int'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.t0000644000175000017500000000075712375112740021235 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger; my $nonPositiveInteger = SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger->new(); ok $nonPositiveInteger = SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger->new({ value => 127 }); is $nonPositiveInteger * 1, 127, 'numerification'; is "$nonPositiveInteger", "127", 'stringification'; ok $nonPositiveInteger->isa('SOAP::WSDL::XSD::Typelib::Builtin::integer'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/NCName.t0000644000175000017500000000074712375112740016502 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::NCName; my $NCName = SOAP::WSDL::XSD::Typelib::Builtin::NCName->new(); is $NCName->get_value(), undef; $NCName = SOAP::WSDL::XSD::Typelib::Builtin::NCName->new({}); is $NCName->get_value(), undef; ok $NCName = SOAP::WSDL::XSD::Typelib::Builtin::NCName->new({ value => 'Test' }); is "$NCName", "Test", 'stringification'; ok $NCName->isa('SOAP::WSDL::XSD::Typelib::Builtin::Name'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.t0000644000175000017500000000074212375112740020514 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger; my $negativeInteger = SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger->new(); ok $negativeInteger = SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger->new({ value => 127 }); is $negativeInteger * 1, 127, 'numerification'; is "$negativeInteger", "127", 'stringification'; ok $negativeInteger->isa('SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.t0000644000175000017500000000100612375112740016621 0ustar use Test::More tests => 5; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::NOTATION; my $NOTATION = SOAP::WSDL::XSD::Typelib::Builtin::NOTATION->new(); is $NOTATION->get_value(), undef; $NOTATION = SOAP::WSDL::XSD::Typelib::Builtin::NOTATION->new({}); is $NOTATION->get_value(), undef; ok $NOTATION = SOAP::WSDL::XSD::Typelib::Builtin::NOTATION->new({ value => 'Test' }); is "$NOTATION", "Test", 'stringification'; ok $NOTATION->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.t0000644000175000017500000000404112375112740020173 0ustar use strict; use warnings; use Test::More tests => 26; use Scalar::Util qw(blessed); use Storable; use lib '../../../../../../lib'; use_ok qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new(); my $id = ${ $obj }; undef $obj; $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new(); is ${ $obj }, $id, 'object cache'; ok blessed $obj, 'constructor returned blessed reference'; $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => 'test1' }); ok blessed $obj, 'constructor returned blessed reference'; is $obj->get_value(), 'test1', 'get_value'; is $obj->get_xmlns(), 'http://www.w3.org/2001/XMLSchema', 'get_xmlns'; is $obj->start_tag({ name => 'test' }), '', 'start_tag'; is $obj->end_tag({ name => 'test' }), '', 'end_tag'; ok $obj->set_value('test'), 'set_value'; is $obj->get_value(), 'test', 'get_value'; is Storable::thaw(Storable::freeze($obj))->get_value, $obj->get_value(), 'frozen/thawed object keeps value'; is Storable::thaw(Storable::freeze($obj))->serialize, $obj->serialize(), 'frozen/thawed object serialize is same as original (overload works)'; ok ! $obj->attr(), 'attr'; is "$obj", q{test}, 'stringification overloading'; is $obj->serialize, q{test}, 'stringification overloading'; ok ($obj) ? pass 'boolean overloading' : fail 'boolean overloading'; ok ! $obj->set_value(undef), 'set_value with explicit undef'; is $obj->get_value(), undef, 'get_value'; { no warnings qw(uninitialized); is "$obj", q{}, 'stringification overloading'; } is $obj->serialize, q{}, 'stringification overloading'; ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => 'test2', }); is $obj->get_value(), 'test2', 'get_value on attr value'; $obj->set_value(undef); is $obj->serialize({ name => 'foo' }), '' , 'serialize undef value with name'; is $obj->serialize(), q{}, 'serialize undef value without name'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'), 'inheritance'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/time.t0000644000175000017500000000157712375112740016341 0ustar use Test::More tests => 3; use strict; use warnings; 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'); my $obj; $obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new({value => '12:23:33'}); $obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new({}); $obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new(); $obj->set_value( '12:23:03' ); is $obj->get_value() , "12:23:03$timezone", 'conversion'; $obj->set_value( '12:23:03.12345+01:00' ), ; is $obj->get_value() , '12:23:03.12345+01:00', 'no conversion'; # exit; #~ use Benchmark; #~ timethese 10000, { #~ xml => sub { $obj->set_value('2037-12-31T00:00:00.0000000+01:00') }, #~ string => sub { $obj->set_value('2037-12-31') }, #~ }SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.t0000644000175000017500000000123712375112740016543 0ustar use Test::More tests => 7; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::anyURI; my $anyURI = SOAP::WSDL::XSD::Typelib::Builtin::anyURI->new(); is $anyURI->get_value(), undef; $anyURI = SOAP::WSDL::XSD::Typelib::Builtin::anyURI->new({}); is $anyURI->get_value(), undef; ok $anyURI = SOAP::WSDL::XSD::Typelib::Builtin::anyURI->new({ value => 'isbn:1234567' }); is "$anyURI", "isbn:1234567", 'stringification'; ok $anyURI->set_value('http://example.org'); is "$anyURI", 'http://example.org', 'stringification'; $anyURI = SOAP::WSDL::XSD::Typelib::Builtin::anyURI->new(); ok $anyURI->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/decimal.t0000644000175000017500000000101612375112740016765 0ustar use Test::More tests => 6; use strict; use warnings; use Scalar::Util qw(blessed); use SOAP::WSDL::XSD::Typelib::Builtin::decimal; my $decimal = SOAP::WSDL::XSD::Typelib::Builtin::decimal->new(); ok blessed $decimal; is $decimal->get_value(), undef; ok $decimal = SOAP::WSDL::XSD::Typelib::Builtin::decimal->new({ value => 127 }); is $decimal * 1, 127, 'numerification'; is "$decimal", "127", 'stringification'; ok $decimal->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance'; # TODO: test range (bigint)SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/string.t0000644000175000017500000000140312375112740016675 0ustar use Test::More tests => 6; use strict; use warnings; use lib '../lib'; use_ok('SOAP::WSDL::XSD::Typelib::Builtin::string'); my $obj; $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => '& "Aber" '}); is $obj->serialize, '& "Aber" <test>' , 'escape text on serialization'; $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new(); $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new({}); $obj->set_value( '& "Aber" '); is $obj->get_value() , '& "Aber" '; is $obj, '& "Aber" '; is $obj->serialize(), '& "Aber" <test>' , 'escape text on serialization'; is $obj->serialize({ name => 'test'}) , '& "Aber" <test>' , 'Serialization with name';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t0000644000175000017500000000261212375112740017126 0ustar use strict; use warnings; use lib '../lib'; use Test::More tests => 9; use Date::Parse; use Date::Format; sub timezone { my @time = strptime shift; my $tz = strftime('%z', @time); substr $tz, -2, 0, ':'; return $tz; } use_ok('SOAP::WSDL::XSD::Typelib::Builtin::dateTime'); print "# timezone is " . timezone( scalar localtime(time) ) . "\n"; my $obj; my %dates = ( '2007-12-31 12:32' => '2007-12-31T12:32:00', '2007-08-31 00:32' => '2007-08-31T00:32:00', '30 Aug 2007' => '2007-08-30T00:00:00', ); $obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new(); $obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new({}); $obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new({ value => '2007-08-31T00:32:00' }); while (my ($date, $converted) = each %dates ) { $obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new(); $obj->set_value( $date ); local $^W; # really turn off warnings for the next line is $obj->get_value() , $converted . timezone($date), 'conversion with timezone'; } $obj->set_value('2007-12-31T00:00:00.0000000+01:00'); is $obj->get_value(), '2007-12-31T00:00:00.0000000+01:00'; $obj->set_value(undef); is $obj->get_value(), undef; eval { print $obj->set_value(0) }; ok $@, 'Die on illegal datetime ' . $@; eval { print $obj->set_value('A') }; ok $@, 'Die on illegal datetime'; eval { print $obj->set_value('8') }; ok $@, 'Die on illegal datetime'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Builtin/double.t0000644000175000017500000000066212375112740016647 0ustar use Test::More tests => 4; use strict; use warnings; use SOAP::WSDL::XSD::Typelib::Builtin::double; my $double = SOAP::WSDL::XSD::Typelib::Builtin::double->new(); ok $double = SOAP::WSDL::XSD::Typelib::Builtin::double->new({ value => 127.23 }); is $double * 1, 127.23, 'numerification'; is "$double", "127.23", 'stringification'; ok $double->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance'; # TODO test rangeSOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/ComplexType.t0000644000175000017500000002510412375112740016236 0ustar use strict; use warnings; package MyEmptyType; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); __PACKAGE__->_factory([],{},{}); package MyEmptyType2; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); __PACKAGE__->_factory(); package MyAttribute; use base qw(SOAP::WSDL::XSD::Typelib::Attribute SOAP::WSDL::XSD::Typelib::Builtin::string ); package MyType; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); { my %test_of :ATTR(:get); __PACKAGE__->_factory( [ 'test' ], { test => \%test_of, }, { test => 'SOAP::WSDL::XSD::Typelib::Builtin::string', }, ); } package MyElement; use base qw( SOAP::WSDL::XSD::Typelib::Element MyType ); __PACKAGE__->__set_name( 'MyElement' ); sub __get_attr_class { 'MyElement::_ATTR' }; package MyElement::_ATTR; use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); { my %test_of :ATTR(:get); my %test2_of :ATTR(:get); __PACKAGE__->_factory( [ 'test', 'test2' ], { test => \%test_of, test2 => \%test2_of, }, { test => 'SOAP::WSDL::XSD::Typelib::Builtin::string', test2 => 'MyAttribute', }, { test => 'test' } ); } package MyType2; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); my %test2_of :ATTR(:get); __PACKAGE__->_factory( [ 'test' ], { test => \%test2_of, }, { test => 'MyType', } ); package MyElementSimpleContent; { use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType SOAP::WSDL::XSD::Typelib::Builtin::string ); __PACKAGE__->__set_name( 'MyElementSimpleContent' ); sub __get_attr_class { 'MyElement::_ATTR' }; sub get_xmlns { 'http://www.w3.org/2001/XMLSchema' } } package main; use Test::More tests => 127; use Storable; my $have_warn = eval { require Test::Warn; import Test::Warn; 1; }; my $obj; for my $class (qw{MyEmptyType MyEmptyType2}) { $obj = $class->new(); is $obj->serialize, '', "$class object serializes to q{}"; is $obj->serialize({ name => 'test'}), '', "$class object serializes to with name=test"; } $obj = MyType->new({}); isa_ok $obj, 'MyType'; is $obj->get_test, undef, 'undefined element content'; my $hash_of_ref = $obj->as_hash_ref(); is scalar keys %{ $hash_of_ref }, 0; SKIP: { skip 'Cannot test warnings without Test::Warn', 1 if not $have_warn; warning_is( sub { $obj->add_test() }, 'attempting to add empty value to MyType' ); } $obj = MyType->new({ test => 'Test1'}); isa_ok $obj, 'MyType'; isa_ok $obj->get_test, 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $obj->get_test, 'Test1', 'element content'; $obj = MyType->new({ test => SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test2' }) }); isa_ok $obj, 'MyType'; isa_ok $obj->get_test, 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $obj->get_test, 'Test2', 'element content'; $obj = MyType->new({ test => { value => 'Test2' } # just a trick - pass it unaltered to new... }); isa_ok $obj, 'MyType'; isa_ok $obj->get_test, 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $obj->get_test, 'Test2', 'element content'; $hash_of_ref = $obj->as_hash_ref(); is $hash_of_ref->{ test }, 'Test2'; ok ! ref $hash_of_ref->{ test }; $obj = MyType->new({ test => [ SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test' }), SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test2' }) ], }); isa_ok $obj, 'MyType'; isa_ok $obj->get_test, 'ARRAY'; is $obj->get_test()->[0], 'Test', 'element content (list content [0])'; is $obj->get_test()->[1], 'Test2', 'element content (list content [1])'; $hash_of_ref = $obj->as_hash_ref(); is $hash_of_ref->{ test }->[0], 'Test'; ok ! ref $hash_of_ref->{ test }->[0]; is $hash_of_ref->{ test }->[1], 'Test2'; my $nested = MyType2->new({ test => $obj, }); is $nested->get_test, $obj, 'getter'; $nested = MyType2->new({ test => [$obj, $obj], }); is $nested->get_test->[0], $obj; # use Data::Dumper; # print Data::Dumper::Dumper $nested->as_hash_ref(); is $nested->as_hash_ref()->{ test }->[ 0 ]->{ test }->[0], 'Test' , 'as_hash_ref with nested elements'; $nested = MyType2->new({ test => { test => [ SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test' }), SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test2' }) ], }, }); $hash_of_ref = $nested->as_hash_ref(); is $hash_of_ref->{ test }->{ test }->[1], 'Test2'; $obj = MyType->new(); isa_ok $obj, 'MyType'; is $obj->get_test, undef, 'undefined element content'; $obj->add_test( SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'}) ); is $obj->get_test, 'TestString0', 'added element content'; for my $count (1..5) { $obj->add_test( SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => "TestString$count" }) ); is ref $obj->get_test(), 'ARRAY', 'element content structure'; is @{ $obj->get_test() }, $count+1, "element list length: " . ($count + 1); for my $index (0..$count-1) { is $obj->get_test->[$index], "TestString$index", "element content [$index]"; } } $obj->set_test(); is $obj->get_test, (), 'removed element content'; $obj = MyEmptyType->new(); is $obj->attr(), undef; $obj = MyElement->new(); isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet'; my $attr = $obj->attr({ test => 'TestAttribute', test2 => 'TestAttribute2' }); isa_ok $attr, 'SOAP::WSDL::XSD::Typelib::AttributeSet'; is $attr->serialize(), q{ test="TestAttribute" test2="TestAttribute2"}, 'attribute serialization'; is $obj->serialize(), q{}, 'Serialization with attributes'; $obj->attr()->set_test2('test'); is $obj->serialize(), q{}, 'Serialization with attributes'; # # cloning attributes... # ok exists $obj->as_hash_ref()->{ xmlattr }, 'as_hash_ref attributes'; is $obj->as_hash_ref()->{ xmlattr }->{ test }, 'TestAttribute', 'as_hash_ref attribute value'; is $obj->as_hash_ref()->{ xmlattr }->{ test2 }, 'test', 'as_hash_ref attribute value'; my $clone = ref($obj)->new($obj->as_hash_ref()); isnt $$clone, $$obj, 'clone is new object'; isnt ${ $clone->attr() }, ${ $obj->attr() }, 'cloned attrs are a new object'; is $clone->attr()->get_test(), 'TestAttribute'; # # end cloning attributes # $obj = MyType->new(); isa_ok $obj, 'MyType'; is $obj->get_test, undef; { no warnings; my $foo; eval { $foo = @{ $obj->get_test() } }; if (! $@) { is $foo, undef; } else { like $@ , qr{Can't \s use \s an \s undefined}x, 'get_ELEMENT still undef on ARRAYIFY'; } $obj->set_test( SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'}) ); } is $obj->get_test, 'TestString0'; eval { is @{ $obj->get_test() }, 1, 'ARRAYIFY get_ELEMENT' }; fail 'cannot ARRAYIFY get_ELEMENT' if ($@); my @serialized = ( 'TestString0TestString1', 'TestString0TestString1TestString2', 'TestString0TestString1TestString2TestString3', 'TestString0TestString1TestString2TestString3TestString4', 'TestString0TestString1TestString2TestString3TestString4TestString5', ); for my $count (1..5) { $obj->add_test( SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => "TestString$count" }) ); is ref $obj->get_test(), 'ARRAY'; is @{ $obj->get_test() }, $count+1; for my $index (0..$count-1) { is $obj->get_test->[$index], "TestString$index"; } is $obj->serialize(), $serialized[$count -1], "serialized $serialized[$count -1]"; } { my $clone = Storable::thaw( Storable::freeze( $obj )); is $clone->get_test()->[0], 'TestString0', 'clone via freeze/thaw'; } ## failure tests eval { $obj = MyType->new({ test => [ SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Test' }), \&CORE::die, ], }); }; like $@, qr{cannot \s use \s CODE}xms, 'error passing a code reference as list value to new()'; eval { $obj = MyType->new({ test => \&CORE::die, }); }; like $@, qr{cannot \s use \s CODE}xms, 'error passing a code reference to new()'; # TODO ignore XMLNS (for now) $obj = MyType->new({ xmlns => 'fubar'}); ok defined $obj; TODO: { local $TODO = "Support XML namespaces"; is $obj->get_xmlns(), 'fubar'; } eval { $obj = MyType->new({ foobar => 'fubar' }); }; like $@, qr{unknown \s field \s foobar \s in \s MyType }xms; eval { $obj->set_FOO(42) }; like $@, qr{Can't \s locate \s object \s method}x, 'error on calling unknown object method'; TODO: { local $TODO = "Identify calls to class methods"; eval { MyType->set_FOO(42) }; like $@, qr{Can't \s locate \s class \s method}x, 'error on calling unknown class method'; } ok ! MyType->can('set_FOO'), 'MyType->can("setFOO")'; ok ! UNIVERSAL::can('MyType', 'set_FOO'), 'UNIVERSAL::can("MyTypes", "set_FOO")'; eval { MyType->new({ FOO => 42 }) }; like $@, qr{unknown \s field \s}xm, 'error passing unknown field to constructor'; eval { # catch warning - local $SIG{__WARN__} = sub {}; SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD() }; like $@, qr{Cannot \s call}xm, 'error calling AUTOMETHOD as function'; eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, {}) }; like $@, qr{ No \s class \s given \s for \s }xms; eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, { test => 'HopeItDoesntExistOnYourSystem'}) }; like $@, qr{ Can't \s locate \s HopeItDoesntExistOnYourSystem.pm }xms; # print Dumper $obj = MyElementSimpleContent->new({ value => 'foo' }); $obj->attr({ test => 'foo', test2 => 'bar' }); is $obj->serialize_qualified(), 'foo'; $clone = ref($obj)->new($obj->as_hash_ref()); isnt $$clone, $$obj, 'clone is new object'; isnt ${ $clone->attr() }, ${ $obj->attr() }, 'cloned attrs are a new object'; is $clone->get_value(), 'foo'; ok ! exists $obj->as_hash_ref(1)->{ xmlattr }; { local $SOAP::WSDL::XSD::Typelib::ComplexType::AS_HASH_REF_WITHOUT_ATTRIBUTES = 1; ok ! exists $obj->as_hash_ref()->{ xmlattr }; ok ! exists $obj->as_hash_ref(1)->{ xmlattr }; } SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Attribute.t0000644000175000017500000000127312375112740015731 0ustar package XML::id; use strict; use warnings; use base qw(SOAP::WSDL::XSD::Typelib::Attribute SOAP::WSDL::XSD::Typelib::Builtin::string); sub get_xmlns { 'http://www.w3.org/XML/1998/namespace' }; __PACKAGE__->__set_name('id'); package main; use strict; use warnings; use Test::More tests => 4; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::Typelib::Attribute); no strict qw(refs); *{ 'SOAP::WSDL::XSD::Typelib::Attribute::get_xmlns' } = sub { 'urn:Test' }; is( SOAP::WSDL::XSD::Typelib::Attribute->start_tag(), ''); is(SOAP::WSDL::XSD::Typelib::Attribute->start_tag({ name => 'foo'}, 'bar'), q{ foo="}); my $id = XML::id->new({ value => 'foo' }); is( $id->serialize({ name => 'id' }), q{ xml:id="foo"});SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Typelib/Element.t0000644000175000017500000000320512375112740015354 0ustar use strict; use warnings; package MyElement; use base qw(SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Builtin::string ); __PACKAGE__->__set_name('MyElement'); __PACKAGE__->__set_nillable(1); package main; use Test::More tests => 18; my $obj; # All constructor variants $obj = MyElement->new(); $obj = MyElement->new({}); $obj = MyElement->new({ value => 'Test' }); is( MyElement->__get_nillable(), 1); is $obj->__get_nillable, 1; isa_ok $obj, 'MyElement'; is $obj->get_value(), 'Test'; $obj->set_value(undef); is $obj->serialize_qualified, ''; is $obj->serialize, ''; $obj->__set_nillable(1); is $obj->__get_nillable(), 1; $obj->__set_nillable(0); is $obj->__get_nillable(), 0; eval { SOAP::WSDL::XSD::Typelib::Element::__get_nillable() }; like $@, qr{Cannot \s call}xms; eval { SOAP::WSDL::XSD::Typelib::Element::__set_nillable() }; like $@, qr{Cannot \s call}xms; # useless test for increasing coverage... # Stores a value under the key "0" of the element class' private nillable # hash. # # Don't you ever abuse the element's this method for such bad stuff ! is SOAP::WSDL::XSD::Typelib::Element::__set_nillable(0,0), 0; is SOAP::WSDL::XSD::Typelib::Element::__get_nillable(0), 0; is $obj->start_tag({ name => 'foo'}), ''; is $obj->start_tag({empty => 1}), ''; is $obj->start_tag({nil => 1}), '', 'empty string with nil option and NILLABLE false'; is $obj->end_tag(), ''; is $obj->end_tag({ name => 'foo'}), ''; $obj->set_value('Test'); eval { is @{ $obj }, 1, 'ARRAYIFY' }; fail 'ARRAYIFY' if ($@); SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/ComplexType.t0000644000175000017500000000077112375112740014631 0ustar use strict; use warnings; use Test::More tests => 5; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::ComplexType); my $obj = SOAP::WSDL::XSD::ComplexType->new(); $obj->set_variety('extension'); eval { $obj->serialize('foo') }; like $@, qr{sorry, \s we \s just}xsm; $obj->set_targetNamespace('bar'); ok $obj->set_abstract(1); ok $obj->set_final(1); eval { $obj->serialize( 'foo', 'bar', { autotype => 1 , namespace => {} } ) }; like $@, qr{^No \s prefix \s found \s for \s namespace \s bar}x;SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Enumeration.t0000644000175000017500000000167512375112740014652 0ustar use strict; use warnings; use Test::More tests => 3; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::Enumeration); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $xml = q{ foobar }; my $schema = $parser->parse($xml); is $schema->find_type('urn:HelloWorld', 'test') ->get_enumeration()->[0]->get_value(), 'foo'; is $schema->find_type('urn:HelloWorld', 'test') ->get_enumeration()->[1]->get_value(), 'bar'; SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Attribute.t0000644000175000017500000000270512375112740014322 0ustar use strict; use warnings; use Test::More tests => 2; #qw(no_plan); use_ok qw(SOAP::WSDL::XSD::Attribute); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $xml = q{ }; my $schema = $parser->parse($xml); is $schema->find_element('urn:HelloWorld', 'sayHello') ->first_complexType() ->first_attribute()->get_name(), 'testAttr', 'found attribute';SOAP-WSDL-3.003/t/SOAP/WSDL/XSD/Element.t0000644000175000017500000000341612375112740013750 0ustar package Foo; sub serialize { $_[2] = q{} if not defined $_[2]; return "serialized $_[1] $_[2]" . join ' ', @{$_[3]->{ attributes } || [] } if $_[3]; } package main; use strict; use warnings; use Test::More tests => 16; use_ok qw(SOAP::WSDL::XSD::Element); my $element = SOAP::WSDL::XSD::Element->new(); is $element->first_simpleType(), undef; $element->set_simpleType('Foo'); is $element->first_simpleType(), 'Foo'; is $element->serialize('Foobar', 'Bar', { namespace => {} } ), 'serialized Foobar Bar'; is $element->serialize('Foobar', undef, { namespace => {} } ), 'serialized Foobar '; $element->set_simpleType( [ 'Foo', 'Bar' ]); is $element->first_simpleType(), 'Foo'; is $element->first_complexType(), undef; $element->set_complexType('Foo'); is $element->first_complexType(), 'Foo'; $element->set_complexType( [ 'Foo', 'Bar' ]); is $element->first_complexType(), 'Foo'; $element->set_default('Foo'); is $element->serialize('Foobar', undef, { namespace => {} } ), 'serialized Foobar Foo'; $element->set_targetNamespace('urn:foobar'); is $element->serialize('Foobar', undef, { namespace => {}, qualify => 1 } ), 'serialized Foobar Foo xmlns="urn:foobar"'; $element->set_targetNamespace('urn:foobar'); is $element->serialize('Foobar', 'Bar', { namespace => {}, qualify => 1 } ), 'serialized Foobar Bar xmlns="urn:foobar"'; $element->set_name('Bar'); is $element->serialize(undef, undef, { namespace => {} } ), 'serialized Bar Foo'; $element->set_fixed('Foobar'); is $element->serialize(undef, undef, { namespace => {} } ), 'serialized Bar Foobar'; $element->set_abstract('1'); is $element->serialize('Bar', undef, { namespace => {} } ), 'serialized Bar Foobar'; eval { $element->serialize(undef, undef, { namespace => {} } ) }; like $@, qr{cannot \s serialize \s abstract}xms; SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-group.t0000644000175000017500000000056112375112740015664 0ustar use Test::More tests => 2; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use Cwd; use File::Basename; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing. $@"; } use_ok qw/SOAP::WSDL/; my $soap = SOAP::WSDL->new(); TODO: { local $TODO="implement support"; fail "serialize group element"; }SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-sequence.t0000644000175000017500000000331412375112740016337 0ustar BEGIN { use Test::More tests => 6; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use Cwd; use File::Basename; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing. $@"; } } use_ok(qw/SOAP::WSDL/); my $xml; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/03_complexType-sequence.wsdl' ), 'Instantiated object' ); #3 ok( $soap->wsdlinit( checkoccurs => 1, servicename => 'testService', ), 'parsed WSDL' ); $soap->no_dispatch(1); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); #4 ok $xml = $soap->call('test', testSequence => { Test1 => 'Test 1', Test2 => 'Test 2', } ), 'Serialized complexType'; TODO: { local $TODO = "not implemented yet"; #5 eval { $xml = $soap->call('test', testSequence => { Test1 => 'Test 1', } ); }; ok( ($@), "Died on illegal number of elements" ); #6 eval { $xml = $soap->call('test', testSequence => { Test1 => 'Test 1', Test2 => [ 1, 2, 3, ] } ); }; ok( ($@), "Died on illegal number of elements" ); };SOAP-WSDL-3.003/t/SOAP/WSDL/Factory/0000755000175000017500000000000012507276245013147 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Factory/Transport.t0000644000175000017500000000544712375112740015332 0ustar use strict; use warnings; use Test::More tests => 15; use Scalar::Util qw(blessed); use SOAP::WSDL::Factory::Transport; eval { SOAP::WSDL::Factory::Transport->get_transport('') }; like $@, qr{^no transport}; eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl') }; like $@, qr{^no transport}; my $obj; SKIP: { # fake absence of SOAP::Lite eval q{ use Test::Without::Module qw(SOAP::Transport::HTTP); 1; } or skip "cannot fake absence of modules without Test::Without::Module", 7; # fake absence of SOAP::WSDL::Transport::HTTP - must throw error eval q{ use Test::Without::Module qw(SOAP::WSDL::Transport::HTTP); }; eval { SOAP::WSDL::Factory::Transport->get_transport('http') }; like $@, qr{Cannot \s load \s transport \s class \s SOAP::WSDL::Transport::HTTP}x; # try again - but now allow to load eval q{ no Test::Without::Module qw(SOAP::WSDL::Transport::HTTP); }; ok $obj = SOAP::WSDL::Factory::Transport->get_transport('http'), 'load backend'; ok $obj->isa('SOAP::WSDL::Transport::HTTP'), 'load SOAP::WSDL::Transport::HTTP'; # Play it again to test what happens when it's loaded # make loading fail (with Test::Without::Module), to make sure we # don't load it again eval q{ use Test::Without::Module qw(SOAP::WSDL::Transport::HTTP); }; ok $obj = SOAP::WSDL::Factory::Transport->get_transport('http'), 'get backend without loading'; ok $obj->isa('SOAP::WSDL::Transport::HTTP'), 'load SOAP::WSDL::Transport::HTTP'; eval q{ no Test::Without::Module qw(SOAP::WSDL::Transport::HTTP); }; eval q{ no Test::Without::Module qw(SOAP::Transport::HTTP); }; eval q{ require SOAP::Lite } or skip q{Cannot test loading SOAP::Lite's transport backend without SOAP::Lite}, 2; # try to load with SOAP::Lite install ok $obj = SOAP::WSDL::Factory::Transport->get_transport('http'), 'load backend'; ok $obj->isa('SOAP::Transport::HTTP::Client'), 'load SOAP::Transport::HTTP::Client backend'; } ok $obj = SOAP::WSDL::Factory::Transport->get_transport('http'); ok blessed $obj; SOAP::WSDL::Factory::Transport->register('zumsl', 'Hope_You_Have_No_Such_Package_Installed'); eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl:foo') }; like $@, qr{^Cannot load}; eval { SOAP::WSDL::Factory::Transport->register( \'zumsl', 'Foo') }; like $@, qr{^Cannot use reference}; # register and load a previously loaded backend SOAP::WSDL::Factory::Transport->register( 'zumsl', 'SOAP::WSDL::Transport::HTTP'); isa_ok( SOAP::WSDL::Factory::Transport->get_transport('zumsl:foo'), 'SOAP::WSDL::Transport::HTTP'); # register and load a previously unloaded backend SOAP::WSDL::Factory::Transport->register( 'zumsl', 'SOAP::WSDL::Transport::Loopback'); isa_ok(SOAP::WSDL::Factory::Transport->get_transport('zumsl:foo'), 'SOAP::WSDL::Transport::Loopback'); SOAP-WSDL-3.003/t/SOAP/WSDL/Factory/Deserializer.t0000644000175000017500000000115012375112740015743 0ustar use strict; use warnings; use Test::More tests => 4; use SOAP::WSDL::Factory::Deserializer; eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({ soap_version => 'zumsl' }) }; like $@, qr{^no deserializer}; ok my $serializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({ soap_version => '1.1' }); ok $serializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({}); SOAP::WSDL::Factory::Deserializer->register('1.1', 'Hope_You_Have_No_Such_Package_Installed'); eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({ soap_version => '1.1' }) }; like $@, qr{^Cannot load}; SOAP-WSDL-3.003/t/SOAP/WSDL/Factory/Serializer.t0000644000175000017500000000112312375112740015432 0ustar use strict; use warnings; use Test::More tests => 4; use SOAP::WSDL::Factory::Serializer; eval { SOAP::WSDL::Factory::Serializer->get_serializer({ soap_version => 'zumsl' }) }; like $@, qr{^no serializer}; ok my $serializer = SOAP::WSDL::Factory::Serializer->get_serializer({ soap_version => '1.1' }); ok $serializer = SOAP::WSDL::Factory::Serializer->get_serializer({}); SOAP::WSDL::Factory::Serializer->register('1.1', 'Hope_You_Have_No_Such_Package_Installed'); eval { SOAP::WSDL::Factory::Serializer->get_serializer({ soap_version => '1.1' }) }; like $@, qr{^Cannot load}; SOAP-WSDL-3.003/t/SOAP/WSDL/Deserializer/0000755000175000017500000000000012507276245014162 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Deserializer/XSD.t0000644000175000017500000000245212375112740015000 0ustar use strict; use warnings; package TestResolver; sub get_typemap { {} }; sub get_class {}; package main; use Test::More tests => 11; use SOAP::WSDL::Deserializer::XSD; my $obj; ok $obj = SOAP::WSDL::Deserializer::XSD->new(); ok $obj = SOAP::WSDL::Deserializer::XSD->new({ class_resolver => 'TestResolver', some_other_option => 'ignored', }); my $fault = $obj->generate_fault(); is $fault->get_faultstring(), 'Unknown error'; is $fault->get_faultactor(), 'urn:localhost'; is $fault->get_faultcode(), 'SOAP-ENV:Client'; isa_ok $obj->deserialize('rubbeldiekatz'), 'SOAP::WSDL::SOAP::Typelib::Fault11'; isa_ok $obj->deserialize(''), 'SOAP::WSDL::SOAP::Typelib::Fault11'; isa_ok $obj->deserialize(''), 'SOAP::WSDL::SOAP::Typelib::Fault11'; is $obj->deserialize(' '), undef, 'Deserialize empty envelope'; is $obj->get_strict(), 1; $obj->set_strict(0); is $obj->deserialize(' '), undef, 'Deserialize envelope with unknown element with strict disabled'; SOAP-WSDL-3.003/t/SOAP/WSDL/Deserializer/SOM.t0000644000175000017500000000223512375112740014777 0ustar use Test::More; eval { require SOAP::Lite; 1; } or do { plan skip_all => 'SOAP::Lite not available'; exit 0; }; print "# Using SOAP::Lite $SOAP::Lite::VERSION\n"; use lib '../../../lib'; plan tests => 13; use_ok qw(SOAP::WSDL::Deserializer::SOM); ok my $deserializer = SOAP::WSDL::Deserializer::SOM->new(); ok my $som = $deserializer->deserialize(q{123}); my $data = $som->match('/a')->valueof; is $data->{ c } , 3; SKIP: { 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";; } eval { $deserializer->generate_fault({ role => 'soap:Server', code => 'Test', message => 'Teststring' }); }; my $fault = $@; isa_ok $fault, 'SOAP::Fault'; is $fault->faultcode(), 'Test'; is $fault->faultactor(), 'soap:Server'; is $fault->faultstring(), 'Teststring'; $fault = $deserializer->deserialize(''); isa_ok $fault, 'SOAP::Fault'; is $fault->faultactor(), 'SOAP-ENV:Server'; like $fault->faultstring(), qr{no \s element \s found}x; SOAP-WSDL-3.003/t/SOAP/WSDL/Deserializer/Hash.t0000644000175000017500000000205712375112740015226 0ustar use Test::More tests => 13; use lib '../../../lib'; use_ok qw(SOAP::WSDL::Deserializer::Hash); # Try all instanciation variants ok my $deserializer = SOAP::WSDL::Deserializer::Hash->new(); ok $deserializer = SOAP::WSDL::Deserializer::Hash->new({ class_resolver => 'SomeFunkyClass', }); ok my $data = $deserializer->deserialize(q{123}); is $data->{a}->{b}->[0], 1; is $data->{a}->{b}->[1], 2; is $data->{a}->{c}, 3; # need 3 elements in array to trigger all branches... # need ignorable whitespace to trigger removal... ok $data = $deserializer->deserialize( q{ 1 2 3 }); is $data->{a}->{b}->[0]->{c}, 1; is $data->{a}->{b}->[1]->{c}, 2; eval { $deserializer->deserialize('grzlmpfh') }; ok $@->isa('SOAP::WSDL::SOAP::Typelib::Fault11'); my $fault = $deserializer->generate_fault({ message => 'Foo', code => 'Bar', role => 'mine', }); is $fault->get_faultstring(), 'Foo'; $fault = $deserializer->generate_fault({}); is $fault->get_faultstring(), 'Unknown error'; SOAP-WSDL-3.003/t/SOAP/WSDL/12_binding.t0000644000175000017500000000127612375112740013637 0ustar use strict; use warnings; use lib '../../../lib'; use Test::More tests => 4; use SOAP::WSDL; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); 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 $proxy = 'http://127.0.0.1/testPort'; ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl' ) ); ok $soap->servicename('testService'); ok $soap->portname('testPort'); ok $soap->wsdlinit( url => $proxy ); SOAP-WSDL-3.003/t/SOAP/WSDL/Typelib/0000755000175000017500000000000012507276245013150 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Typelib/Fault11.t0000644000175000017500000000112112375112740014535 0ustar use Test::More tests => 6; use strict; use warnings; # use_ok fails to trigger Class::Std's overloading attributes use SOAP::WSDL::SOAP::Typelib::Fault11; my $fault = SOAP::WSDL::SOAP::Typelib::Fault11->new({ faultcode => 'soap:Server', faultstring => 'Fault message', }); ok "$fault", 'stringification'; if ($fault) { fail 'boolify' } else { pass 'boolify' } ok ! $fault->as_bool() , 'as_bool'; is $fault->get_xmlns(), 'http://schemas.xmlsoap.org/soap/envelope/'; is $fault->get_faultcode(), 'soap:Server', 'content'; is $fault->get_faultstring(), 'Fault message', 'content';SOAP-WSDL-3.003/t/SOAP/WSDL/Part.t0000644000175000017500000000133412375112740012624 0ustar package MyTypelib; use strict; use warnings; sub find_element {}; sub find_type {}; package main; use strict; use warnings; use Test::More tests => 5; use_ok qw(SOAP::WSDL::Part); my $typelib = {}; eval { SOAP::WSDL::Part->serialize() }; like $@, qr{No typelib}; my $opt = { typelib => 'MyTypelib', namespace => { foo => 'bar'} }; my $data = {}; my $part = SOAP::WSDL::Part->new(); eval { $part->serialize('name', $data, $opt ) }; like $@, qr{Neither type nor element}; $part->set_type('foo:Foo'); eval { $part->serialize('name', $data, $opt ) }; like $@, qr{type foo:Foo}; $part->set_type(undef); $part->set_element('foo:Foo'); eval { $part->serialize('name', $data, $opt ) }; like $@, qr{element foo:Foo}; SOAP-WSDL-3.003/t/SOAP/WSDL/04_element-complexType.t0000644000175000017500000000011012375112740016150 0ustar use Test::More skip_all => 'TODO: implement tests'; use lib '../lib'; SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-complexContent.t0000644000175000017500000000060112375112740017525 0ustar use Test::More tests => 2; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use Cwd; use File::Basename; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing. $@"; } use_ok qw/SOAP::WSDL/; my $soap = SOAP::WSDL->new(); TODO: { local $TODO="implement tests"; fail "serialize complexContent element"; }SOAP-WSDL-3.003/t/SOAP/WSDL/Transport/0000755000175000017500000000000012507276245013534 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Transport/01_Test.t0000644000175000017500000000336612375112740015140 0ustar use Test::More tests => 9; use strict; use warnings; use File::Basename; use SOAP::WSDL::Client; my $soap; my $base_dir = dirname( __FILE__ ); use_ok(qw/SOAP::WSDL::Transport::Test/); $soap = SOAP::WSDL::Client->new(); $soap->set_proxy('http://somewhere.over.the.rainbow'); $soap->get_transport->set_base_dir( join '/', $base_dir, 'acceptance' ); ok $soap->get_transport->get_base_dir(); { local $SIG{__WARN__} = sub {}; my $response = $soap->call({ operation => 'test', soap_action => 'http://test' }, {}); ok ! $response, 'Returned fault on error'; is $response->get_faultcode(), 'soap:Server', 'faultcode'; is $response->get_faultactor(), 'urn:localhost', 'faultactor'; $soap->outputxml(1); $response = $soap->call({ operation => 'test', soap_action => 'http://test2' }, {}); is $response, 'test2', 'Returned file content'; } SKIP: { eval { require SOAP::WSDL::Deserializer::SOM; } or skip 'SOAP::WSDL::Deserializer::SOM required', 3; # requre SOAP::WSDL::Factory::Deserializer; SOAP::WSDL::Factory::Deserializer->register('1.1', 'SOAP::WSDL::Deserializer::SOM'); my $soap_som = SOAP::WSDL::Client->new(); $soap_som->set_proxy('http://somewhere.over.the.rainbow'); $soap_som->get_transport->set_base_dir( join '/', $base_dir, 'acceptance' ); my $som; ok $som = $soap_som->call({ operation => 'test', soap_action => 'http://test3' }, {}) , 'Call with SOAP::WSDL::Deserializer::SOM'; # In the somewhat weird logic of SOAP::Lite, the first node inside the root element # is the reault, all others are output parameters (and may be accessed via "paramsout") is $som->result(), 'Munich', 'Result match'; is $som->paramsout(), 'Germany' , 'Output parameter match'; } SOAP-WSDL-3.003/t/SOAP/WSDL/Transport/acceptance/0000755000175000017500000000000012507276245015622 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Transport/acceptance/test3.xml0000644000175000017500000000050112375112740017372 0ustar MunichGermanySOAP-WSDL-3.003/t/SOAP/WSDL/Transport/acceptance/test2.xml0000644000175000017500000000000512375112740017370 0ustar test2SOAP-WSDL-3.003/t/SOAP/WSDL/Transport/HTTP.t0000644000175000017500000000207412375112740014473 0ustar use Test::More tests => 8; use strict; use utf8; use SOAP::WSDL::Transport::HTTP; my $transport = SOAP::WSDL::Transport::HTTP->new(); ok $transport->is_success(1); ok $transport->code(200); ok $transport->status('200 OK'); ok $transport->message('OK'); my $result = $transport->send_receive(envelope => 'Test', action => 'foo'); ok ! $transport->is_success(); $result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ', action => 'foo'); ok ! $transport->is_success(); $result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ', action => 'foo', content_type => 'application/xml'); ok ! $transport->is_success(); { no warnings qw(redefine); my $request_sub =\&LWP::UserAgent::request; *LWP::UserAgent::request = sub { my $self = shift; my $request = shift; is $request->header('Content-Type'), 'text/xml; charset=utf-8'; return HTTP::Response->new( 200 ); }; $result = $transport->send_receive(envelope => 'Test', action => 'foo'); *LWP::UserAgent::request = $request_sub; } SOAP-WSDL-3.003/t/SOAP/WSDL/05_simpleType-list.t0000644000175000017500000000252212377751026015336 0ustar use Test::More tests => 8; use strict; use lib '../lib'; use lib 't/lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my ($soap, $xml, $xml2); #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/05_simpleType-list.wsdl' ), 'Instantiated object' ); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); #3 ok( $soap->wsdlinit( servicename => 'testService', ), 'parsed WSDL' ); $soap->no_dispatch(1); #4 ok $xml = $soap->call('test', testAll => [ 1, 2 ] ), 'Serialize list call'; #5 ok ( $xml2 = $soap->call('test', testAll => "1 2" ) , 'Serialized scalar call' ); #6 ok( $xml eq $xml2, 'Got expected result'); #7 TODO: { local $TODO = "implement minLength check"; eval { $xml = $soap->call('test', testAll => undef ) }; ok($@, 'Died on illegal number of elements (not enough)'); } #8 TODO: { local $TODO = "maxLength test not implemented"; eval { $xml = $soap->call('test', testAll => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ] ) }; ok($@, 'Died on illegal number of elements (more than maxLength)'); } SOAP-WSDL-3.003/t/SOAP/WSDL/Definitions.t0000644000175000017500000000150612375112740014172 0ustar use strict; use warnings; use Test::More tests => 4; use SOAP::WSDL::PortType; use_ok qw(SOAP::WSDL::Definitions); my $obj = SOAP::WSDL::Definitions->new({ portType => [ SOAP::WSDL::PortType->new({ name => 'foo', targetNamespace => 'bar', }), SOAP::WSDL::PortType->new({ name => 'foo', targetNamespace => 'baz', }), SOAP::WSDL::PortType->new({ name => 'foobar', targetNamespace => 'bar', }), ] }); my $found= $obj->find_portType('bar', 'foobar'); is $found->get_name(), 'foobar', 'found PortType'; $found = $obj->find_portType('baz', 'foo'); is $found->get_name(), 'foo', 'found PortType'; $found = $obj->find_portType('baz', 'foobar'); is $found, undef, 'find_PortType returns undef on unknown PortType';SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-choice.t0000644000175000017500000000026712375112740015765 0ustar use Test::More tests => 2; use lib '../lib'; use_ok qw/SOAP::WSDL/; my $soap = SOAP::WSDL->new(); TODO: { local $TODO="implement tests"; fail "serialize choice element"; }SOAP-WSDL-3.003/t/SOAP/WSDL/04_element.t0000644000175000017500000000326012375112740013652 0ustar use Test::More tests => 9; use strict; use warnings; use lib '../lib'; use lib 't/lib'; use File::Spec; use File::Basename; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing."; } use_ok(qw/SOAP::WSDL/); my $soap; my $xml; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/04_element.wsdl' ), 'Instantiated object' ); #3 SKIP: { skip 'Cannot test warning without Test::Warn', 1 if not (eval "require Test::Warn"); Test::Warn::warning_like( sub { $soap->readable(1) }, qr{\A 'readable' \s has \s no \s effect \s any \s more}xms); } $soap->outputxml(1); ok( $soap->wsdlinit( servicename => 'testService', ), 'parsed WSDL' ); $soap->no_dispatch(1); ok ($xml = $soap->call('test', testElement1 => 'Test' ), 'Serialized (simple) element' ); ok ($xml = $soap->call('testRef', testElementRef => 'Test' ), 'Serialized (simple) element' ); like $xml , qr{Test} , 'element ref serialization result' ; TODO: { local $TODO="implement min/maxOccurs checks"; eval { $xml = $soap->call('test', testAll => [ 'Test 2', 'Test 3' ] ); }; ok( ($@ =~m/illegal\snumber\sof\selements/), "Died on illegal number of elements (too many)" ); eval { $xml = $soap->call('test', testAll => undef ); }; ok($@, 'Died on illegal number of elements (not enough)'); } SOAP-WSDL-3.003/t/SOAP/WSDL/05_simpleType-union.t0000644000175000017500000000233412375112740015504 0ustar use Test::More skip_all => 'Not supported yet'; use strict; use warnings; use File::Spec; use File::Basename; use_ok qw/SOAP::WSDL/; my $xml; my $soap = undef; my $path = File::Spec->rel2abs( dirname __FILE__ ); #2 ok $soap = SOAP::WSDL->new( wsdl => 'file:///' . $path . '/t/acceptance/wsdl/05_simpleType-union.wsdl' ), 'Instantiated object'; #3 ok $soap->wsdlinit(), 'parsed WSDL'; $soap->no_dispatch(1); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); #4 ok $xml = $soap->call('test', testAll => 1 ) , 'Serialized call'; # 6 eval { $xml = $soap->serializer->method( $soap->call('test', testAll => [ 1 , 'union'] ) ) }; ok($@, 'Died on illegal number of elements (not enough)'); eval { $xml = $soap->serializer->method( $soap->call('test', testAll => undef ) ) }; ok($@, 'Died on illegal number of elements (not enough)'); #8 ok ( $xml = $soap->serializer->method( $soap->call('test2', testAll => 1 ) ), 'Serialized (simple) call (list)' ); #9 eval { $xml = $soap->serializer->method( $soap->call('test', testAll => [ 1 , 'union'] ) ) }; ok($@, 'Died on illegal number of elements (not enough)'); SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-simpleContent.t0000644000175000017500000000060112375112740017347 0ustar use Test::More tests => 2; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use Cwd; use File::Basename; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing. $@"; } use_ok qw/SOAP::WSDL/; my $soap = SOAP::WSDL->new(); TODO: { local $TODO="implement support"; fail "serialize simpleContent element"; }SOAP-WSDL-3.003/t/SOAP/WSDL/Expat/0000755000175000017500000000000012507276245012621 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Expat/WSDLParser.t0000644000175000017500000000720112375112740014724 0ustar use strict; use warnings; use Test::More tests => 17; #qw(no_plan); use File::Spec; use File::Basename; my $HAVE_TEST_WARN =eval { require Test::Warn; }; my $path = File::Spec->rel2abs( dirname __FILE__ ); $path =~s{\\}{/}xg; # stupid windows workaround: $path works with /, but not # with \ use_ok qw( SOAP::WSDL::Expat::WSDLParser); my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/WSDLParser.wsdl" ); my $schema = $definitions->first_types()->get_schema()->[1]; my $attr = $schema->get_element()->[0]->first_complexType->first_attribute(); ok $attr->get_name('testAttribute'), 'attribute name'; ok $attr->get_type('xs:string'), 'attribute type'; if ($HAVE_TEST_WARN) { Test::Warn::warning_like( sub { $definitions = $parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser-import.wsdl" ); }, qr{already \s imported}x, 'duplicate import warning') } else { SKIP: { skip 'Cannot test warnings without Test::Warn', 1; }; local $SIG{__WARN__} = sub {}; $definitions = $parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser-import.wsdl" ); } $parser = SOAP::WSDL::Expat::WSDLParser->new(); $definitions = $parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser-import.wsdl" ); ok my $service = $definitions->first_service(); is $service->get_name(), 'Service1', 'wsdl:import service name'; is $definitions->first_binding()->get_name(), 'Service1Soap', 'wsdl:import binding name'; ok my $schema_from_ref = $definitions->first_types()->get_schema(); is @{ $schema_from_ref }, 2, 'got builtin and imported schema'; ok @{ $schema_from_ref->[1]->get_element } > 0; is $schema_from_ref->[1]->get_element->[0]->get_name(), 'sayHello'; is $schema_from_ref->[1]->get_xmlns()->{ foo }, 'urn:Bar1', 'namespace prefix not overridden by import'; { my $warn_parser = SOAP::WSDL::Expat::WSDLParser->new(); my $warning; local $SIG{__WARN__} = sub { $warning = join(q{}, @_ )}; $definitions = $warn_parser->parse_file( "$path/../../../acceptance/wsdl/WSDLParser/import_no_location.wsdl" ); like $warning, qr{cannot \s import \s document \s for \s namespace \s >urn:Test< \s without \slocation}x , 'warn on import without location'; $definitions = $warn_parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser/xsd_import_no_location.wsdl" ); like $warning, qr{cannot \s import \s document \s for \s namespace \s >urn:Test< \s without \slocation}x , 'warn on import without location'; }; eval { my $warn_parser = SOAP::WSDL::Expat::WSDLParser->new(); $definitions = $warn_parser->parse_file( "$path/../../../acceptance/wsdl/WSDLParser/import_xsd_cascade.wsdl" ); }; like $@, qr{\A cannot \s import \s document \s from \s namespace \s >urn:Test< \s without \s base \s uri\. \s Use \s >parse_uri< \s or \s >set_uri< \s to \s set \s one\.}x; # Alarm is just to be sure - may loop infinitely if broken $SIG{ALRM} = sub { die 'looped'}; alarm 1; if ($HAVE_TEST_WARN) { Test::Warn::warning_like( sub { $definitions = $parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser_import_loop.wsdl" ); }, qr{already \s imported}x, 'duplicate import warning'); } else { SKIP: { skip 'Cannot test warnings without Test::Warn', 1; }; local $SIG{__WARN__} = sub {}; $definitions = $parser->parse_uri( "file://$path/../../../acceptance/wsdl/WSDLParser_import_loop.wsdl" ); } alarm 0; pass 'import loop'; SOAP-WSDL-3.003/t/SOAP/WSDL/Expat/MessageParser.t0000644000175000017500000000732312375112740015544 0ustar #!/usr/bin/perl -w use strict; use warnings; use Test::More tests => 6; use lib '../../../../lib'; use lib '../../../../t/lib'; use lib 't/lib'; use lib '../lib'; use lib 'lib'; use_ok(qw/SOAP::WSDL::Expat::MessageParser/); use MyComplexType; use MyElement; use MySimpleType; my $xml = q{ Test Test2 }; my $parser = SOAP::WSDL::Expat::MessageParser->new({ class_resolver => 'FakeResolver' }); test_nil($parser); test_simple_element($parser); $parser->parse( $xml ); is $parser->get_data(), q{} . q{TestTest2} , 'Content comparison'; my $xml_attr = q{ Test }; $parser->parse($xml_attr); is $parser->get_data(), q{Test}, 'Content with attributes'; my $xml_error = q{ Test Bar }; eval { $parser->parse($xml_error) }; like $@, qr{\A Cannot \s resolve \s class \s for \s MyElementAttrs/foo }x, 'XML error'; # data classes reside in t/lib/Typelib/ BEGIN { package FakeResolver; { my %class_list = ( 'MyAtomicComplexTypeElement' => 'MyAtomicComplexTypeElement', 'MyAtomicComplexTypeElement/test' => 'MyTestElement', 'MyAtomicComplexTypeElement/test2' => 'MyTestElement2', 'MyAtomicComplexTypeElement/foo' => '__SKIP__', 'MyElementAttrs' => 'MyElementAttrs', 'MyElementAttrs/test' => 'MyTestElement', 'MyElementAttrs/test2' => 'MyTestElement2', 'MySimpleElement' => 'MySimpleElement', ); sub new { return bless {}, 'FakeResolver' }; sub get_typemap { return \%class_list }; sub get_class { my $name = join('/', @{ $_[1] }); return ($class_list{ $name }) ? $class_list{ $name } : undef; }; }; }; sub test_nil { my $parser = shift(); my $xml_nil_attr = q{ Test }; my $result = $parser->parse($xml_nil_attr); is $result->get_test2->serialize({ name => 'test2'}), ''; } sub test_simple_element { my $parser = shift; my $body = $parser->parse( q{ 3}); is $body->get_value(), 3; }SOAP-WSDL-3.003/t/SOAP/WSDL/Expat/Base.t0000644000175000017500000000062212375112740013650 0ustar use strict; use warnings; use Test::More tests => 5; use_ok qw(SOAP::WSDL::Expat::Base); my $parser = SOAP::WSDL::Expat::Base->new(); eval { $parser->parse('Foobar')}; ok $@; eval { $parser->parsefile('Foobar')}; ok $@; $parser = SOAP::WSDL::Expat::Base->new({ user_agent => 'foo', }); is $parser->get_user_agent(), 'foo'; $parser->set_user_agent('bar'); is $parser->get_user_agent(), 'bar'; SOAP-WSDL-3.003/t/SOAP/WSDL/Server/0000755000175000017500000000000012507276245013006 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Server/CGI.t0000644000175000017500000000672012375112740013572 0ustar package MyTypemap; sub get_typemap { return {} }; package HandlerClass; sub bar { return "Verdammte Axt"; } package main; use Test::More; eval "require IO::Scalar" or plan skip_all => 'IO::Scalar required for testing...'; plan tests => 12; use_ok(SOAP::WSDL::Server); use_ok(SOAP::WSDL::Server::CGI); my $server = SOAP::WSDL::Server::CGI->new({ class_resolver => 'MyTypemap', }); $server->set_action_map_ref({ 'testaction' => 'testmethod', }); { no warnings qw(once); *IO::Scalar::BINMODE = sub {}; } my $output = q{}; my $fh = IO::Scalar->new(\$output); my $stdout = *STDOUT; my $stdin = *STDIN; # don't try to print() anything from here on - it gehts caught in $output, #and does not make it to STDOUT... *STDOUT = $fh; { local %ENV; $server->handle(); like $output, qr{ \A Status: \s 411 \s Length \s Required}x; $output = q{}; $ENV{'CONTENT_LENGTH'} = '0e0'; $server->handle(); like $output, qr{ Error \s deserializing }xsm; $output = q{}; $server->set_action_map_ref({ 'foo' => 'bar', }); $server->set_dispatch_to( 'HandlerClass' ); $server->handle(); like $output, qr{no \s element \s found}xms; $output = q{}; $ENV{REQUEST_METHOD} = 'POST'; $ENV{HTTP_SOAPACTION} = 'test'; $server->handle(); like $output, qr{no \s element \s found}xms; $output = q{}; delete $ENV{HTTP_SOAPACTION}; $ENV{EXPECT} = 'Foo'; $ENV{HTTP_SOAPAction} = 'foo'; $server->handle(); like $output, qr{no \s element \s found}xms; $output = q{}; $ENV{EXPECT} = '100-Continue'; $ENV{HTTP_SOAPAction} = 'foo'; $server->handle(); like $output, qr{100 \s Continue}xms; $output = q{}; delete $ENV{EXPECT}; my $input = 'Foobar'; my $ih = IO::Scalar->new(\$input); $ih->seek(0); *STDIN = $ih; # my $buffer; # read(*STDIN, $buffer, 6); # die $buffer; $ENV{HTTP_SOAPAction} = 'bar'; $ENV{CONTENT_LENGTH} = 6; $server->handle(); like $output, qr{ Error \s deserializing \s message}xms; $output = q{}; $ih->seek(0); $input = q{ }; $ENV{HTTP_SOAPAction} = 'bar'; $ENV{CONTENT_LENGTH} = length $input; $server->handle(); # die $output; like $output, qr{ Not \s found:}xms; $output = q{}; $ih->seek(0); $server->set_dispatch_to( 'HandlerClass' ); $server->set_action_map_ref({ 'bar' => 'bar', }); $input = q{ }; $ENV{HTTP_SOAPAction} = q{"bar"}; $ENV{CONTENT_LENGTH} = length $input; $server->handle(); use Data::Dumper; like $output, qr{ \A Status: \s 200 \s OK}xms; $output = q{}; $ih->seek(0); $server->set_dispatch_to( 'HandlerClass' ); $server->set_action_map_ref({ 'bar' => 'bar', }); $input = q{ }; $ENV{SERVER_SOFTWARE} ='IIS Foobar'; $ENV{HTTP_SOAPAction} = q{"bar"}; $ENV{CONTENT_LENGTH} = length $input; $server->handle(); use Data::Dumper; like $output, qr{ \A HTTP/1.0 \s 200 \s OK}xms; $output = q{}; $ih->seek(0); } # restore handles *STDOUT = $stdout; *STDIN = $stdin; # print $output;SOAP-WSDL-3.003/t/SOAP/WSDL/Server/Simple.t0000644000175000017500000000723112377751023014424 0ustar package MyTypemap; sub get_typemap { return {} } package main; use Test::More; use CGI; plan tests => 8; use_ok(SOAP::WSDL::Server); use_ok(SOAP::WSDL::Server::Simple); my $server = SOAP::WSDL::Server::Simple->new( {class_resolver => 'MyTypemap',} ); $server->set_action_map_ref( {'testaction' => 'testmethod',} ); test_fault_output(); test_deserializer_fault(); test_simple_fault(); test_success(); # # test _output by forcing a fault (passing a empty CGI object) # IO::Scalar required # sub test_fault_output { no warnings qw(once); SKIP: { eval "require IO::Scalar" or skip 'IO::Scalar required for testing...', 1; # set up a IO::Scalar handle as STDOUT local *IO::Scalar::BINMODE = sub { }; my $output = q{}; my $fh = IO::Scalar->new( \$output ); { local *STDOUT = $fh; # don't try to print() anything from here on - it gehts caught in $output, #and does not make it to STDOUT... $server->handle( CGI->new() ); } like $output, qr{no \s element \s found}xms; } } sub test_deserializer_fault { *SOAP::WSDL::Server::Simple::_output = sub { like $_[1]->content(), qr{Error \s deserializing \s message}xms, 'Fault on (wrong) content'; }; local $ENV{REQUEST_METHOD} = 'POST'; local $ENV{HTTP_SOAPACTION} = 'testaction'; $server->handle( CGI->new( { POSTDATA => q{ Kutter Martin Herr } } ) ); } sub test_simple_fault { *SOAP::WSDL::Server::Simple::_output = sub { is $_[1]->code, 500; like $_[1]->content(), qr{Something \s is \s rotten}xms, 'Fault on (wrong) content'; }; local $ENV{REQUEST_METHOD} = 'POST'; local $ENV{HTTP_SOAPAction} = 'testaction'; local *SOAP::WSDL::Server::handle = sub { die 'Something is rotten' }; $server->handle( CGI->new( { POSTDATA => q{ Kutter Martin Herr } } ) ); } sub test_success { *SOAP::WSDL::Server::Simple::_output = sub { is $_[1]->code(), 200; like $_[1]->content(), qr{Everything \s OK}xms, 'Status 200 on OK content'; }; local $ENV{REQUEST_METHOD} = 'POST'; local $ENV{HTTP_SOAPAction} = 'testaction'; local *SOAP::WSDL::Server::handle = sub { 'Everything OK' }; $server->handle( CGI->new( { POSTDATA => q{ Kutter Martin Herr } } ) ); } SOAP-WSDL-3.003/t/SOAP/WSDL/Server/Mod_Perl2.t0000644000175000017500000001500312375112740014745 0ustar use strict; use warnings; use diagnostics; # ugly use lib to let it run from everywhere use lib '../../../../example/lib'; use lib '../example/lib'; use lib 'example/lib'; use lib 'lib'; use lib 't/lib'; use warnings; use Test::More; #qw(no_plan); use MyElements::sayHello; eval { require Test::MockObject } or plan skip_all => 'Test::MockObject required for faking mod_perl'; plan tests => 13; my @ERROR_FROM = (); my $REQUEST = 'Foo', my $RESPONSE; my %DIR_CONFIG_OF = ( dispatch_to => 'Mod_Perl2Test', soap_service => 'MyServer::HelloWorld::HelloWorldSoap', ); # Ouch, testing mod_perl without mod_perl is pain in the arse. # # This is what we have to mock # #use Apache2::RequestIO (); # $r->read() #use Apache2::RequestRec (); # $r->headers_in #use Apache2::RequestUtil(); # $r->dir_config() #use APR::Table (); # $r->headers_in->get() #use Apache2::Log (); # $r->log #use Apache2::Const -compile => qw( # OK # SERVER_ERROR # HTTP_LENGTH_REQUIRED # ); my $mock = Test::MockObject->new(); $mock->fake_module('Apache2::Const' => OK => sub { 1 }, SERVER_ERROR => sub { 500 }, HTTP_LENGTH_REQUIRED => sub { 411 }, import => sub {}, ); $mock->fake_module('Apache2::Headers' => new => sub { my $class = shift; return bless { @_ }, $class }, get => sub { return $_[0]->{ $_[1] } }, ); $mock->fake_module('Apache2::Log' => new => sub { return bless {}, 'Apache2::Log' }, error => sub { shift; push @ERROR_FROM, @_ }, warn => sub { shift; push @ERROR_FROM, @_ }, ); $mock->fake_module('Apache2::RequestIO'); $mock->fake_module('Apache2::RequestRec' => new => sub { return bless {}, 'Apache2::RequestRec' }, log => sub { return Apache2::Log->new() }, dir_config => sub { return $DIR_CONFIG_OF{$_[1]}}, headers_in => sub { return Apache2::Headers->new( 'content-length' => length($REQUEST), 'SOAPAction' => 'urn:HelloWorld#sayHello', ) }, 'read' => sub { $_[1] = $REQUEST; my $length = length($REQUEST); $REQUEST = q{}; return $length; }, method => sub { 'POST' }, uri => sub { 'http://example.org/soap-wsdl/helloWorld/' }, content_type => sub {}, 'print' => sub { shift; $RESPONSE .= join(q{}, @_) }, ); $mock->fake_module('Apache2::RequestUtil'); $mock->fake_module('APR::Table'); use_ok qw(SOAP::WSDL::Server::Mod_Perl2); ok my $obj = SOAP::WSDL::Server::Mod_Perl2->new(), 'instantiate object'; my $r = Apache2::RequestRec->new(); # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{dispatch_to} = undef; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A No \s 'dispatch_to' \s variable \s set \s in \s httpd.conf }x , 'error on bad dispatch_to'; @ERROR_FROM = (); } # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{dispatch_to} = 'main'; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A Failed \s to \s require \s \[main\] }x, 'error on bad dispatch_to'; @ERROR_FROM = (); } # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{soap_service} = undef; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A No \s 'soap_service' \s variable \s set \s in \s httpd.conf }x , 'error on bad dispatch_to'; @ERROR_FROM = (); } # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{soap_service} = 'soap_service'; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A Failed \s to \s require \s \[soap_service\] }x, 'error on bad dispatch_to'; @ERROR_FROM = (); } # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{transport_class} = 'transport_class'; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A Failed \s to \s require \s \[transport_class\] }x, 'error on bad transport_class'; @ERROR_FROM = (); } # block for scoping local { # dirty but useful... local $DIR_CONFIG_OF{transport_class} = 'SOAP::WSDL::Server::Mod_Perl2'; $REQUEST = q{Foobar}; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A Failed \s to \s handle \s request }x, 'error on bad request'; @ERROR_FROM = (); } # just a block - got used to it. { SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{\A No \s content-length \s provided }x, 'error on missing content-length'; @ERROR_FROM = (); } { my $hello = MyElements::sayHello->new({ name => 'Kutter', givenName => 'Martin' }); $REQUEST = ' ' . $hello->serialize_qualified() . ''; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $RESPONSE, qr{Hello \s Martin \sKutter}x, 'SOAP response'; @ERROR_FROM = (); } { my $hello = MyElements::sayHello->new({ name => '__DIE__', }); $REQUEST = ' ' . $hello->serialize_qualified() . ''; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{Failed \s to \s handle \s request: \s FOO}x, 'SOAP response'; } { my $hello = MyElements::sayHello->new({ name => '__DIE__', }); $REQUEST = ' ' . $hello->serialize_qualified() . '' . ''; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{Failed \s to \s handle \s request: \s FOO}x, 'SOAP response'; } # This test breaks the read() method. Be sure to add tests needing it above. { no warnings qw(redefine once); $REQUEST = 'FOOBAR'; *Apache2::RequestRec::read = sub { $_[1] = "BA"; $REQUEST = q{}; return length($REQUEST) }; my $hello = MyElements::sayHello->new({ name => 'Kutter', }); $REQUEST = ' ' . $hello->serialize_qualified() . ''; SOAP::WSDL::Server::Mod_Perl2::handler($r); like $ERROR_FROM[0], qr{Failed \s to \s handle \s request: \s FOO}x, 'SOAP response'; } SOAP-WSDL-3.003/t/SOAP/WSDL/Client/0000755000175000017500000000000012507276245012756 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Client/Base.t0000644000175000017500000001030712375112740014006 0ustar package MyPart; use Class::Std::Fast; package main; use strict; use warnings; use Test::More tests => 21; use_ok qw(SOAP::WSDL::Client::Base); { no warnings qw(redefine once); *SOAP::WSDL::Client::call = sub { is $_[1]->{ operation }, 'sayHello', 'Called method'; return $_[2], $_[3]; }; } my $client = SOAP::WSDL::Client::Base->new(); my @result = $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string SOAP::WSDL::XSD::Typelib::Builtin::string )], }, header => { parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, headerfault => { } }, { value => 'Body' }, { value => 'Header' }); is $result[0]->[0], 'Body'; is $result[1], 'Header'; isa_ok $result[0]->[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; @result = $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, header => { parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, headerfault => { } }, SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Body2' }), SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Header2' }) ); is $result[0], 'Body2'; is $result[1], 'Header2'; isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; # Call with more body parts than parameters. Body parts are empty @result = $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, header => { parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, headerfault => { } }, [], SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Header2' }) ); isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $result[0], q{}; is $result[1], 'Header2'; isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; # Call with more body parts than parameters. Body parts are empty # No header @result = $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, header => { }, headerfault => { } }); isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $result[0], q{}; eval { $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SomeStupidClassYouProbablyDontHaveOnYourSystem )], }, header => { }, headerfault => { } }) }; like $@, qr{ Can't \s locate }xms; isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string'; is $result[0], q{}; eval { $client->call({ operation => 'sayHello', soap_action => 'urn:HelloWorld#sayHello', style => 'document', body => { 'use' => 'literal', namespace => '', encodingStyle => '', parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )], }, header => { parts => [qw( SomeOtherStupidClassYouProbablyDontHaveOnYourSystem )], }, headerfault => { } }) }; # die $@; like $@, qr{ Can't \s locate }xms; SOAP-WSDL-3.003/t/SOAP/WSDL/Client.t0000644000175000017500000000516212375112740013137 0ustar package FaultDeserializer; use strict; use warnings; use SOAP::WSDL::SOAP::Typelib::Fault11; sub new { bless {}, shift } sub deserialize { die SOAP::WSDL::SOAP::Typelib::Fault11->new( {} ); } package main; use strict; use warnings; use Test::More tests => 16; use SOAP::WSDL::Transport::Loopback; use Scalar::Util qw(blessed); use_ok qw(SOAP::WSDL::Client); { no warnings qw(redefine once); *SOAP::WSDL::Factory::Transport::get_transport = sub { my ( $self, $url, %args_of ) = @_; if (%args_of) { is $args_of{foo}, 'bar'; } }; } sub test_client_basics { ok my $client = SOAP::WSDL::Client->new(); ok $client = SOAP::WSDL::Client->new( {proxy => 'http://localhost',} ); is $client->get_content_type(), 'text/xml; charset=utf-8'; is $client->get_endpoint(), 'http://localhost'; $client->set_proxy( 'http://localhost', foo => 'bar', ); #TODO is this behaviour still required? declare as deprecated and remove... $client->set_proxy( ['http://localhost', foo => 'bar',] ); is $client->get_proxy(), $client->get_transport(), 'get_proxy returns same as get_transport'; ok $client->set_soap_version('1.1'); is $client->get_soap_version(), '1.1'; $client->set_deserializer_args( {strict => 0} ); is $client->get_deserializer_args()->{strict}, 0; } sub test_call { my $client = SOAP::WSDL::Client->new(); $client->no_dispatch(1); $client->set_serializer('main'); my $serialize = $client->call( {operation => 'testMethod'}, {foo => 'bar'}, {bar => 'baz'} ); is $serialize->{body}->{foo}, 'bar'; is $serialize->{header}->{bar}, 'baz'; # Old calling style compatibility test - foo => bar is body... $serialize = $client->call( {operation => 'testMethod'}, foo => 'bar' ); is $serialize->{body}->{foo}, 'bar'; # Old calling style compatibility test - foo => bar is body... $serialize = $client->call( 'testMethod', foo => 'bar' ); is $serialize->{body}->{foo}, 'bar'; } sub serialize { my $self = shift; return shift; } sub test_deserializer_fault { my $client = SOAP::WSDL::Client->new(); $client->set_deserializer( FaultDeserializer->new() ); $client->set_transport( SOAP::WSDL::Transport::Loopback->new() ); my $fault = $client->call( {operation => 'testMethod'}, {foo => 'bar'}, {bar => 'baz'} ); ok( (blessed $fault and $fault->isa('SOAP::WSDL::SOAP::Typelib::Fault11')), 'Return fault on throwing during deserialization ' . $@); } test_client_basics(); test_call(); test_deserializer_fault(); SOAP-WSDL-3.003/t/SOAP/WSDL/Serializer/0000755000175000017500000000000012507276245013651 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Serializer/XSD.t0000644000175000017500000000352012375112740014464 0ustar package FOO; use strict; use warnings; use Class::Std::Fast; sub serialize_qualified { 'FOO' }; sub get_xmlns { 'urn:foo' }; { my $name = 'Foo'; sub __set_name { $name = $_[1]}; sub __get_name{ $name }; sub serialize { "<$name/>" }; } package main; use strict; use warnings; use Test::More tests => 10; use_ok qw(SOAP::WSDL::Serializer::XSD); my $serializer = SOAP::WSDL::Serializer::XSD->new(); like $serializer->serialize(), qr{}, 'empty body'; like $serializer->serialize({ body => {} }), qr{}, 'empty body'; like $serializer->serialize({ body => [] }), qr{}, 'empty body'; like $serializer->serialize({ header => {}, body => [] }), qr{}, 'empty header and body'; like $serializer->serialize({ header => {}, body => [] , options => { namespace => { 'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP', 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi', } }}) , qr{xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"} , 'namespace'; like $serializer->serialize({ header => {}, body => [ undef ] }), qr{}, 'empty header and body'; like $serializer->serialize({ header => {}, body => [ undef, FOO->new() ] }), qr{FOO}, 'empty header and body'; like $serializer->serialize({ header => FOO->new(), body => FOO->new()}), qr{FOO}, 'prefixed body element'; like $serializer->serialize({ header => FOO->new(), body => FOO->new() , options => { prefix => 'foo'}}), qr{}, 'prefixed body element'; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/0000755000175000017500000000000012507276245013466 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Template.t0000644000175000017500000000144412375362263015430 0ustar use strict; use warnings; use Test::More tests => 2; use Template; use File::Basename; use File::Spec; use SOAP::WSDL::Expat::WSDLParser; use SOAP::WSDL::Generator::Template::XSD; my $path = dirname __FILE__; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); $parser->parse_file("$path/../../../acceptance/wsdl/006_sax_client.wsdl"); #"$path/../../../../example/wsdl/globalweather.xml"); my $definitions = $parser->get_data(); my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, }); my $output = q{}; $generator->generate_typemap({ NO_POD => 1, output => \$output, }); ok eval $output; print $@ if $@; #print $output; $output = q{}; $generator->generate_interface({ NO_POD => 1, output => \$output, }); ok eval $output; print $@ if $@; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/XSD_unsupported.t0000644000175000017500000000143112375112740016750 0ustar use Test::More tests => 2; use File::Basename qw(dirname); use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_unsupported_test.wsdl" ); my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, silent => 1, }); { # currently, there is no completely unsupported XML schema # idiom (at least none which is detected properly) # TODO update WSDL and add some (there sure are) my $code = ""; $generator->set_output(\$code); eval { $generator->generate_typelib() }; eval $code; } ok ! $@; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Template/0000755000175000017500000000000012507276245015241 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Template/XSD/0000755000175000017500000000000012507276245015677 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Template/XSD/Unqualified.t0000644000175000017500000000260012375112740020320 0ustar use strict; use Test::More tests => 3; use File::Basename qw(dirname); use File::Spec; use File::Path; use diagnostics; my $path; $path = File::Spec->rel2abs( dirname __FILE__ ); my ( $volume, $dir ) = File::Spec->splitpath( $path, 1 ); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; $path = join '/', @dir_from; my $HAVE_TEST_XML = eval { require Test::XML; import Test::XML; 1; }; use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_uri( "file://$path/../../../../../acceptance/wsdl/006_sax_client.wsdl" ); my $generator = SOAP::WSDL::Generator::Template::XSD->new( { definitions => $definitions, OUTPUT_PATH => "$path/testlib", silent => 1, } ); my $code = ""; $generator->generate_typelib(); eval qq{use lib "$path/testlib";}; ok eval("require MyElements::EnqueueMessage;"), "require generated class"; my $obj = MyElements::EnqueueMessage->new( {MMessage => {MSubject => 'test'}} ); my $xml = q{ test }; SKIP: { skip( "Cannot test XML content without Test::XML", 1 ) if not $HAVE_TEST_XML; is_xml( "$obj", $xml, "XML content" ); } rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Template/XSD/Import.t0000644000175000017500000000261712375356066017347 0ustar use strict; use Test::More tests => 3; use File::Basename qw(dirname); use File::Spec; use File::Path; use diagnostics; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; my $HAVE_TEST_WARN =eval { require Test::Warn; }; use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions; if ($HAVE_TEST_WARN) { Test::Warn::warning_like(sub { $definitions = $parser->parse_uri( "file://$url/../../../../../acceptance/wsdl/WSDLParser-import.wsdl" ); } , qr{already \s imported}x ); } else { local $SIG{__WARN__} = sub {}; SKIP: { skip 'Cannot test warning without Test::Warn', 1; } $definitions = $parser->parse_uri( "file://$url/../../../../../acceptance/wsdl/WSDLParser-import.wsdl" ); } my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, type_prefix => 'Foo', element_prefix => 'Foo', typemap_prefix => 'Foo', OUTPUT_PATH => "$path/testlib", silent => 1, }); my $code = ""; $generator->set_output(\$code); $generator->generate_typelib(); { eval $code; ok !$@; print $@ if $@; } rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Visitor/0000755000175000017500000000000012507276245015125 5ustar SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Visitor/Typemap.t0000644000175000017500000001111012375112740016713 0ustar use strict; use warnings; use Test::More tests => 5; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); use SOAP::WSDL::Generator::Template::Plugin::XSD; use SOAP::WSDL::Generator::Iterator::WSDL11; use SOAP::WSDL::Generator::PrefixResolver; use_ok qw(SOAP::WSDL::Generator::Visitor::Typemap); my $visitor; ok $visitor = SOAP::WSDL::Generator::Visitor::Typemap->new({ resolver => SOAP::WSDL::Generator::Template::Plugin::XSD->new({ prefix_resolver=> SOAP::WSDL::Generator::PrefixResolver->new({ prefix => { type => 'TestTypes', element => 'TestElements', typemap => 'TestTypemap', } }), }) }), 'constructor'; use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); $parser->parse_file( $path . '/../../../../acceptance/wsdl/' #. '04_element.wsdl' #. '11_helloworld.wsdl' #. '008_complexType.wsdl' . '006_sax_client.wsdl' ); my $definitions = $parser->get_data(); my $iter = SOAP::WSDL::Generator::Iterator::WSDL11->new({ definitions => $definitions }); $visitor->set_definitions($definitions); $iter->init(); while (my $node = $iter->get_next()) { $node->_accept( $visitor ); }; my $typemap = $visitor->get_typemap(); is $typemap->{'EnqueueMessage/MMessage/MKeepalive'}, 'TestTypes::TKeepalive', 'content'; is $typemap->{'EnqueueMessageResponse'}, 'TestElements::EnqueueMessageResponse', 'content'; is $typemap->{'KeepaliveMessageResponse'}, 'TestElements::KeepaliveMessageResponse', 'content'; use Data::Dumper; print Dumper $typemap; sub wsdl { q{ } } SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/XSD.t0000644000175000017500000002070112375112740014301 0ustar use Test::More tests => 70; use File::Basename qw(dirname); use File::Spec; use File::Path; use diagnostics; my $path = File::Spec->rel2abs( dirname __FILE__ ); use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); # # the next test is a bit odd: on parsing the WSDL, we test whether the # parser can cope with unknown (anyAttribute) attributes. # The default is to issue a warning. # # But if Test::Warn isn't there, we have to skip the test, but parse the # file, too, so in this case we skip a zero-length block, set no warnings # and parse the WSDL... # my $definitions; if (eval "require Test::Warn; 1") { Test::Warn::warning_is( sub { $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_test.wsdl" ); }, 'found unrecognised attribute {http://foo.bar}Action (ignored)' , 'warning on unrecognized attribute'); } else { SKIP: { skip "cannot test warnings without Test::Warn", 1 } no warnings; $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_test.wsdl" ); } my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, type_prefix => 'Foo', element_prefix => 'Foo', typemap_prefix => 'Foo', OUTPUT_PATH => "$path/testlib", silent => 1 }); my $code = ""; $generator->set_output(\$code); $generator->generate_typelib(); { eval $code; ok !$@; print $@ if $@; } $generator->set_type_prefix('MyTypes'); $generator->set_element_prefix('MyElements'); $generator->set_typemap_prefix('MyTypemaps'); $generator->set_interface_prefix('MyInterfaces'); $generator->set_output(undef); $generator->generate(); #$generator->generate_typelib(); #$generator->generate_typemap(); if (eval { require Test::Warn; }) { Test::Warn::warning_like( sub { $generator->generate_interface() }, qr{\A Multiple \s parts \s detected \s in \s message \s testMultiPartWarning}xms); } else { $generator->generate_interface(); SKIP: { skip 'Cannot test warnings without Test::Warn', 1 }; } $generator->generate_server(); eval "use lib '$path/testlib'"; use_ok qw( MyInterfaces::testService::testPort ); my $interface; ok $interface = MyInterfaces::testService::testPort->new(), 'instanciate interface'; $interface->set_no_dispatch(1); my $message; ok $message = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'} , { Test1 => 'Header1', Test2 => 'Header2'}), 'call soap method (no_dispatch)'; use_ok qw(SOAP::WSDL::Expat::MessageParser); use_ok qw(MyTypemaps::testService); $parser = SOAP::WSDL::Expat::MessageParser->new({ class_resolver => 'MyTypemaps::testService' }); ok $parser->parse_string($message), 'parse message with header'; ok $parser->get_header()->get_Test1(), 'Header1';ok $message = $interface->testChoice( { Test1 => 'Test1' } ), 'call soap method (no_dispatch)'; ok $parser->get_header()->get_Test2(), 'Header2'; ok $parser->get_data()->get_Test1(), 'Test1'; ok $parser->get_data()->get_Test2(), 'Test2'; use_ok qw(SOAP::WSDL::Transport::Loopback); $interface->set_no_dispatch(undef); $interface->set_transport(undef); $interface->set_proxy('http://127.0.0.1/Test'); for (1..2) { my ($body, $header) = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'} , { Test1 => 'Header1', Test2 => 'Header2'}); is $header->get_Test1(), 'Header1', 'Header content'; is $header->get_Test2(), 'Header2', 'Header content'; } # complexType choice test ok $message = $interface->testChoice( { Test1 => 'Test1' } ), 'call soap method (no_dispatch)'; ok $message = $interface->testChoice( { Test2 => 'Test2' } ), 'call soap method (no_dispatch)'; TODO: { local $TODO = 'implement content check'; eval { $interface->testChoice( { Test1 => 'Test1', Test2 => 'Test2' } ) }; ok $@, 'fail on both choice options'; } # ok eval { require MyTypes::testComplexTypeRestriction }; my $complexRestriction = MyTypes::testComplexTypeRestriction->new(); $complexRestriction->set_Test1('Test'); is $complexRestriction->get_Test1(), 'Test'; $complexRestriction = MyTypes::testComplexTypeRestriction->new({ Test1 => 'test1', Test2 => 'test2', }); is $complexRestriction->get_Test1(), 'test1'; is $complexRestriction->get_Test2(), 'test2'; ok eval { require MyTypes::testComplexTypeExtension }; $complexExtension = MyTypes::testComplexTypeExtension->new({ Test1 => 'test1', Test2 => 'test2', Test3 => 'test3', }); is $complexExtension->get_Test1(), 'test1'; is $complexExtension->get_Test2(), 'test2'; is $complexExtension->get_Test3(), 'test3'; ok eval { require MyTypes::testComplexNestedExtension }; my $nestedExtension = MyTypes::testComplexNestedExtension->new(); ok $nestedExtension->can('get_Test1'); ok $nestedExtension->can('get_Test2'); ok $nestedExtension->can('get_Test3'); ok $nestedExtension->can('get_Test4'); ok eval { require MyTypes::testComplexTypeElementAtomicSimpleType; }; my $ct_east = MyTypes::testComplexTypeElementAtomicSimpleType->new({ testString => 'Just some test', testAtomicSimpleTypeElement => 42, testAtomicSimpleTypeElement2 => 23, }); is $ct_east->get_testAtomicSimpleTypeElement, 42; is $ct_east->get_testAtomicSimpleTypeElement->get_value(), 42; isa_ok($ct_east->get_testAtomicSimpleTypeElement, 'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement'); is $ct_east->get_testAtomicSimpleTypeElement2, 23; is $ct_east->get_testAtomicSimpleTypeElement2->get_value(), 23; isa_ok($ct_east->get_testAtomicSimpleTypeElement2, 'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement2'); ok eval { require MyElements::testElementCompletelyEmptyComplex; } , 'load MyElements::testElementCompletelyEmptyComplex'; ok my $empty = MyElements::testElementCompletelyEmptyComplex->new(); is $empty->serialize_qualified(), '' , 'serialize empty'; ok eval { require MyTypes::testComplexTypeSimpleRestriction; } , 'load MyTypes::testComplexTypeSimpleRestriction'; ok eval { require MyTypes::testComplexTypeSequenceWithAttribute; } , 'load MyTypes::testComplexTypeSequenceWithAttribute'; use_ok qw(MyElements::testElementComplexTypeSequenceWithAttribute); my $obj = MyElements::testElementComplexTypeSequenceWithAttribute->new({ Test1 => 'foo', Test2 => 'bar', }); $obj->attr({ testAttr => 'foobar' }); is $obj, q{foobar} . q{} , 'seralize complexType sequence with attribute'; use_ok qw(MyTypes::testSimpleContentExtension); ok $obj = MyTypes::testSimpleContentExtension->new({ value => 'foo' }); $obj->attr({ testAttr => 'bar' }); is $obj->serialize({ name => 'baz'}), q{foo}; use_ok qw(MyAttributes::TestAttribute); ok $obj = MyAttributes::TestAttribute->new({ value => 'foo' }); use_ok qw(MyElements::testRef); ok $obj = MyElements::testRef->new({ testElementString => 'foo'}); is q{foo} , $obj->serialize_qualified() , 'serialize element ref'; use_ok qw(MyElements::testAtomicRef); ok $obj = MyElements::testAtomicRef->new({ in => 'foo'}); is q{foo} , $obj->serialize_qualified() , 'serialize element with atomic complexType / all with element ref'; SKIP: { eval { require Test::Pod::Content; } or skip 'Cannot test pod content without Test::Pod::Content', 2; Test::Pod::Content::pod_section_like( 'MyTypes::testComplexTypeSequenceWithAttribute', 'attr', qr{Test \s Attribute \s good \s for \s nothing}x, 'Attribute POD'); Test::Pod::Content::pod_section_like( 'MyInterfaces::testService::testPort', 'testChoice', qr{Returns \s a \s MyElements::testComplexTypeRestriction \s object\.}x, 'Interface POD contains response class name'); } use_ok qw(MyTypes::finalComplexType); { no warnings qw(once); ok *MyTypes::finalComplexType::get_Name, 'complexType inheritance flattened out'; } ok $typemap = MyTypemaps::testService->get_typemap(); ok $typemap->{'testElementNestedExtension/Test1'}; ok $typemap->{'testElementNestedExtension/Test2'}; ok $typemap->{'testElementNestedExtension/Test3'}; ok $typemap->{'testElementNestedExtension/Test4'}; rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/Visitor.t0000644000175000017500000000132412375112740015302 0ustar use Test::More tests => 15;; use SOAP::WSDL::Generator::Visitor; my $visitor = SOAP::WSDL::Generator::Visitor->new(); is undef, $visitor->visit_Definitions(); is undef, $visitor->visit_Binding(); is undef, $visitor->visit_Message(); is undef, $visitor->visit_Operation(); is undef, $visitor->visit_OpMessage(); is undef, $visitor->visit_Part(); is undef, $visitor->visit_Port(); is undef, $visitor->visit_PortType(); is undef, $visitor->visit_Service(); is undef, $visitor->visit_SoapOperation(); is undef, $visitor->visit_Types(); # XML Schema stuff is undef, $visitor->visit_XSD_Schema(); is undef, $visitor->visit_XSD_ComplexType(); is undef, $visitor->visit_XSD_Element(); is undef, $visitor->visit_XSD_SimpleType(); SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/XSD_dot_names.t0000644000175000017500000000662212375112740016340 0ustar use Test::More tests => 15; use File::Basename qw(dirname); use File::Spec; use File::Path; my $path = File::Spec->rel2abs( dirname __FILE__ ); use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_test_dot_names.wsdl" #"$path/../../../acceptance/wsdl/elementAtomicComplexType.xml" ); my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, type_prefix => 'Foo', element_prefix => 'Foo', typemap_prefix => 'Foo', OUTPUT_PATH => "$path/testlib", silent => 1, }); my $code = ""; $generator->set_output(\$code); $generator->generate_typelib(); { eval $code; ok !$@; print $@ if $@; } # print $code; $generator->set_type_prefix('MyTypes'); $generator->set_element_prefix('MyElements'); $generator->set_typemap_prefix('MyTypemaps'); $generator->set_interface_prefix('MyInterfaces'); $generator->set_output(undef); $generator->generate(); #$generator->generate_typelib(); #$generator->generate_typemap(); if (eval { require Test::Warn; }) { Test::Warn::warning_like( sub { $generator->generate_interface() }, qr{\A Multiple \s parts \s detected \s in \s message \s testMultiPartWarning}xms); } else { $generator->generate_interface(); SKIP: { skip 'Cannot test warnings without Test::Warn', 1 }; } $generator->generate_server(); eval "use lib '$path/testlib'"; use_ok qw(MyInterfaces::My::SOAP::testService::testPort); use_ok qw(MyServer::My::SOAP::testService::testPort); use_ok qw(MyTypes::testComplexTypeRestriction); use_ok qw(MyTypes::testComplexTypeAll); # type with dot in name including atomic type use_ok qw(MyTypes::test::ComplexTypeElementAtomicSimpleType); SKIP: { eval { require Test::Pod::Content; } or skip 'Cannot test pod content without Test::Pod::Content', 6; Test::Pod::Content::pod_section_like( 'MyInterfaces::My::SOAP::testService::testPort', 'NAME', qr{^MyInterfaces::My::SOAP::testService::testPort \s - \s}xms, 'Pod NAME section'); Test::Pod::Content::pod_section_like( 'MyInterfaces::My::SOAP::testService::testPort', 'SYNOPSIS', qr{use \s MyInterfaces::My::SOAP::testService::testPort}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MyInterfaces::My::SOAP::testService::testPort', 'SYNOPSIS', qr{\s MyInterfaces::My::SOAP::testService::testPort->new\(}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'NAME', qr{^MyServer::My::SOAP::testService::testPort \s - \s}xms, 'Pod NAME section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'SYNOPSIS', qr{use \s MyServer::My::SOAP::testService::testPort}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'SYNOPSIS', qr{\s MyServer::My::SOAP::testService::testPort->new\(}xms, 'Pod SYNOPSIS section'); } my $obj = MyTypes::testComplexTypeAll->new({ Test_1 => 'Test1', Test_2 => 'Test2', }); like $obj->serialize(), qr{Test1}xm, 'serialize altered name with original name'; rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/XSD_nested_complextype.t0000644000175000017500000000670412377727530020316 0ustar use Test::More tests => 16; use File::Basename qw(dirname); use File::Spec; use File::Path; my $path = File::Spec->rel2abs( dirname __FILE__ ); use SOAP::WSDL::Expat::MessageParser; use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/nested_complextype.wsdl" ); ok my $element = $definitions->get_types()->[0]->find_element("urn:HelloWorld", "sayHello") , 'got element'; ok my $sub_element = $element->get_complexType->[0]->find_element("urn:HelloWorld", "givenName"), , 'atomic type element'; ok $sub_element->get_complexType->[0]->find_element("urn:HelloWorld", "givenName"), 'element in subtype'; my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, type_prefix => 'Bar', element_prefix => 'BarElem', typemap_prefix => 'Bar', OUTPUT_PATH => "$path/testlib", silent => 1, }); my $code = ""; $generator->set_output(\$code); $generator->generate_typelib(); { eval $code; ok !$@, 'eval generated code'; print $@ if $@; } # print $code; my %prefix_of = ( type => 'FooType', element => 'FooElement', typemap => 'FooMap', ); while (my ($name, $value) = each %prefix_of ) { $generator->can("set_$name\_prefix")->($generator, $value); } $generator->set_output(undef); $generator->generate(); #$generator->generate_typelib(); $generator->generate_typemap(); $generator->generate_server(); eval "use lib '$path/testlib'"; use_ok qw(FooElement::sayHello); eval { FooElement::sayHello::_givenName->new({ givenName => 'Foo', middleInitial => 'Bar', }); }; ok !$@, 'instantiate subpackage FooElement::sayHello::_givenName'; eval { FooElement::sayHello::_givenName::XmlAttr->new({ testAttr => 'Bar' }); }; ok !$@, 'instantiate subpackage attribute class FooElement::sayHello::_givenName::XmlAttr'; SKIP: { eval { require Test::Pod::Content; } or skip 'Cannot test pod content without Test::Pod::Content', 1; Test::Pod::Content::pod_section_is( 'FooElement::sayHello', 'NAME', 'FooElement::sayHello', 'Pod NAME section'); } require FooMap::Service1; my $message_parser = SOAP::WSDL::Expat::MessageParser->new({ class_resolver => 'FooMap::Service1', }); my $result = $message_parser->parse_string( xml() ); is $result->get_name(), 'Kutter', 'content'; is $result->get_givenName()->get_givenName, 'Martin', 'nested complexType content'; is $result->get_givenName()->get_givenName, 'Martin', 'nested complexType content'; is $result->get_givenName()->attr()->get_testAttr, 'Bar', 'nested complexType attr'; sub xml { return q{ Kutter Martin A. }; } require FooType::testAbstractGrandChild; ok(FooType::testAbstractGrandChild->can('get_abstractGrandChild'), 'attribute'); ok(FooType::testAbstractGrandChild->can('get_abstractChild'), 'parent attribute'); ok(FooType::testAbstractGrandChild->can('get_abstract'), 'grandparent attribute'); rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/Generator/XSD_custom_resolver.t0000644000175000017500000000771712375112740017630 0ustar package TestResolver; use strict; use warnings; use Class::Std::Fast; use base qw(SOAP::WSDL::Generator::PrefixResolver); sub resolve_prefix { my ($self, $type, $namespace, $node) = @_; my $name = defined($node) ? $node->get_name() : (); if (($type eq 'interface') && $name =~m{\.}x) { return "MySpacialPrufax::"; } if ($type eq 'type') { return 'MySpatialTaipeeProfix::' if $namespace ne 'http://www.w3.org/2001/XMLSchema' } return $self->SUPER::resolve_prefix($type, $namespace, $node); } package main; use Test::More tests => 14; use File::Basename qw(dirname); use File::Spec; use File::Path; my $path = File::Spec->rel2abs( dirname __FILE__ ); use_ok qw(SOAP::WSDL::Generator::Template::XSD); use SOAP::WSDL::Expat::WSDLParser; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); my $definitions = $parser->parse_file( "$path/../../../acceptance/wsdl/generator_test_dot_names.wsdl" #"$path/../../../acceptance/wsdl/elementAtomicComplexType.xml" ); my $generator = SOAP::WSDL::Generator::Template::XSD->new({ definitions => $definitions, type_prefix => 'Foo', element_prefix => 'Foo', typemap_prefix => 'Foo', OUTPUT_PATH => "$path/testlib", prefix_resolver_class => 'TestResolver', silent => 1, }); my $code = ""; $generator->set_output(\$code); $generator->generate_typelib(); { eval $code; ok !$@; print $@ if $@; } # print $code; $generator->set_type_prefix('MySpatialTaipeeProfix'); $generator->set_element_prefix('MyElements'); $generator->set_typemap_prefix('MyTypemaps'); $generator->set_interface_prefix('MyInterfaces'); $generator->set_output(undef); $generator->generate(); #$generator->generate_typelib(); #$generator->generate_typemap(); if (eval { require Test::Warn; }) { Test::Warn::warning_like( sub { $generator->generate_interface() }, qr{\A Multiple \s parts \s detected \s in \s message \s testMultiPartWarning}xms); } else { $generator->generate_interface(); SKIP: { skip 'Cannot test warnings without Test::Warn', 1 }; } $generator->generate_server(); eval "use lib '$path/testlib'"; use_ok qw(MySpacialPrufax::My::SOAP::testService::testPort); use_ok qw(MyServer::My::SOAP::testService::testPort); use_ok qw(MySpatialTaipeeProfix::testComplexTypeRestriction); use_ok qw(MySpatialTaipeeProfix::testComplexTypeAll); SKIP: { eval { require Test::Pod::Content; } or skip 'Cannot test pod content without Test::Pod::Content', 6; Test::Pod::Content::pod_section_like( 'MySpacialPrufax::My::SOAP::testService::testPort', 'NAME', qr{^MySpacialPrufax::My::SOAP::testService::testPort \s - \s}xms, 'Pod NAME section'); Test::Pod::Content::pod_section_like( 'MySpacialPrufax::My::SOAP::testService::testPort', 'SYNOPSIS', qr{use \s MySpacialPrufax::My::SOAP::testService::testPort}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MySpacialPrufax::My::SOAP::testService::testPort', 'SYNOPSIS', qr{\s MySpacialPrufax::My::SOAP::testService::testPort->new\(}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'NAME', qr{^MyServer::My::SOAP::testService::testPort \s - \s}xms, 'Pod NAME section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'SYNOPSIS', qr{use \s MyServer::My::SOAP::testService::testPort}xms, 'Pod SYNOPSIS section'); Test::Pod::Content::pod_section_like( 'MyServer::My::SOAP::testService::testPort', 'SYNOPSIS', qr{\s MyServer::My::SOAP::testService::testPort->new\(}xms, 'Pod SYNOPSIS section'); } my $obj = MySpatialTaipeeProfix::testComplexTypeAll->new({ Test_1 => 'Test1', Test_2 => 'Test2', }); like $obj->serialize(), qr{Test1}xm, 'serialize altered name with original name'; rmtree "$path/testlib"; SOAP-WSDL-3.003/t/SOAP/WSDL/05_simpleType-restriction.t0000644000175000017500000000301012375112740016711 0ustar use Test::More tests => 8; use strict; use warnings; use diagnostics; use File::Spec; use File::Basename; use lib '../lib'; use lib 't/lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $xml; my $soap; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/05_simpleType-restriction.wsdl' ), 'Instantiated object' ); #3 ok( $soap->wsdlinit( servicename => 'testService', ), 'parsed WSDL' ); $soap->no_dispatch(1); $soap->autotype(0); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); #4 ok $xml = $soap->call('test', testAll => [ 1, 2 ] ) , 'Serialize list call'; # print $xml, "\n"; TODO: { local $TODO = "implement minLength/maxLength checks"; eval { $soap->call('test', testAll => [ 1, 2, 3 ] ) }; ok($@, 'Died on illegal number of elements (too many)'); eval { $soap->call('test', testAll => [] ) }; ok($@, 'Died on illegal number of elements (not enough)'); } TODO: { local $TODO = "minValue check not implemented "; eval { $xml = $soap->call('test', testAll => 0 ) }; ok($@, 'Died on illegal value'); } TODO: { local $TODO = "maxValue check not implemented "; eval { $xml = $soap->call('test', testAll => 100 ) }; ok($@, 'Died on illegal value'); } SOAP-WSDL-3.003/t/SOAP/WSDL/Server.t0000644000175000017500000000341612375112740013167 0ustar package MyDeserializer; use Class::Std::Fast; require Test::More; my %class_resolver_of :ATTR(:name :default<()>); sub generate_fault { Test::More::pass("generate fault on $_[1]->{ message }"); return $_[1]->{ message }; } sub deserialize { return ('Body', 'Header'); } package MyDeserializer2; use Class::Std::Fast; sub deserialize { die "Deserialize"; } sub generate_fault { Test::More::like($_[1]->{ message }, qr{\A Error \s deserializing }x, 'Generate fault on deserialize error' ); return $_[1]->{ message }; } package MyHandler; sub test { return 'Test'; } package main; use strict; use warnings; use HTTP::Request; use Test::More qw(no_plan); use_ok qw(SOAP::WSDL::Server); my $server = SOAP::WSDL::Server->new(); $server->set_deserializer('MyDeserializer'); eval { $server->handle(HTTP::Request->new()) }; like $@, qr{\A No \s handler}x, 'No handler fault caught'; $server->set_dispatch_to('MyHandler'); eval { $server->handle(HTTP::Request->new()) }; like $@, qr{\A Not \s found: \sNo \s SOAPAction \s given}x, 'No SOAPAction fault caught'; my $request = HTTP::Request->new(); $request->header('SOAPAction', 'Test'); $server->set_dispatch_to('MyHandler'); eval { $server->handle($request) }; like $@, qr{\A Not \s found: \sNo \s method \s found \s for \s the \s SOAPAction \s 'Test'}x, 'No SOAPAction fault caught'; $server->set_action_map_ref({ Test => 'test2'}); eval { $server->handle($request) }; like $@, qr{\A Not \s implemented:}x, 'Not implemented fault caught'; $server->set_action_map_ref({ Test => 'test'}); ok $server->handle($request); $server->set_deserializer('MyDeserializer2'); eval { $server->handle(HTTP::Request->new()) }; like $@, qr{\A Error \s deserializing}x, 'Error deserializing caught'; sub test { return; } SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-all.t0000644000175000017500000000307712375112740015305 0ustar use Test::More tests => 7; use strict; use warnings; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use File::Basename; use File::Spec; our $SKIP; eval "use Test::SOAPMessage"; if ($@) { $SKIP = "Test::Differences required for testing. "; } my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; # print $url; use_ok(qw/SOAP::WSDL/); print "# SOAP::WSDL Version: $SOAP::WSDL::VERSION\n"; my $xml; my $soap; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/03_complexType-all.wsdl', ), 'Instantiated object' ); #3 ok $soap->wsdlinit( checkoccurs => 1, servicename => 'testService', ), 'parse WSDL'; ok $soap->no_dispatch(1), 'set no dispatch'; # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); ok ($xml = $soap->call('test', testAll => { Test1 => 'Test 1', Test2 => [ 'Test 2', 'Test 3' ] } ), 'Serialized complexType' ); # print $xml; # $soap->wsdl_checkoccurs(1); TODO: { local $TODO = "not implemented yet"; eval { $xml = $soap->call('test', testAll => { Test1 => 'Test 1', Test2 => [ 'Test 2', 'Test 3' ] } ); }; ok( ($@ =~m/illegal\snumber\sof\selements/), "Died on illegal number of elements (too many)" ); eval { $xml = $soap->call('test', testAll => { Test1 => 'Test 1', } ); }; ok($@, 'Died on illegal number of elements (not enough)'); }SOAP-WSDL-3.003/t/SOAP/WSDL/03_complexType-element-ref.t0000644000175000017500000000246312375112740016736 0ustar use Test::More tests => 4; use strict; use warnings; use lib '../lib'; use lib 't/lib'; use lib 'lib'; use File::Basename; use File::Spec use_ok(qw/SOAP::WSDL/); print "# SOAP::WSDL Version: $SOAP::WSDL::VERSION\n"; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; my $xml; my $soap; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/03_complexType-element-ref.wsdl', no_dispatch => 1, ), 'Instantiated object' ); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); ok ($xml = $soap->call('test', testAll => { Test2 => 'Test2', TestElement => 'TestRef' } ), 'Serialized complexType' ); my $HAVE_TEST_XML = eval { require Test::XML; import Test::XML; 1; }; SKIP: { skip "Can't test XML without Test::XML", 1 if not $HAVE_TEST_XML; is_xml( q{ TestRef Test2 }, $xml); }; SOAP-WSDL-3.003/t/SOAP/WSDL/04_element-simpleType.t0000644000175000017500000000224612375112740016006 0ustar use Test::More tests => 6; use strict; use warnings; use lib '../lib'; use lib 't/lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $xml; my $soap = undef; ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/04_element-simpleType.wsdl' ), 'Instantiated object' ); # won't work without - would require SOAP::WSDL::Deserializer::SOM, # which requires SOAP::Lite $soap->outputxml(1); ok( $soap->wsdlinit( servicename => 'testService', ), 'parsed WSDL' ); $soap->no_dispatch(1); ok ( $xml = $soap->call('test', testElement1 => 1 ) , 'Serialized (simpler) element' ); TODO: { local $TODO="implement min/maxOccurs checks"; eval { $soap->call('test', testAll => [ 2, 3 ] ); }; like $@, qr{illegal\snumber\sof\selements}, "Died on illegal number of elements (too many)"; eval { $soap->call('test', testAll => undef ) }; ok $@, 'Died on illegal number of elements (not enough)'; } SOAP-WSDL-3.003/t/SOAP/WSDL/PortType.t0000644000175000017500000000157112375112740013507 0ustar use strict; use warnings; use Test::More tests => 4; use SOAP::WSDL::Operation; use_ok qw(SOAP::WSDL::PortType); my $portType = SOAP::WSDL::PortType->new({ operation => [ SOAP::WSDL::Operation->new({ name => 'foo', targetNamespace => 'bar', }), SOAP::WSDL::Operation->new({ name => 'foo', targetNamespace => 'baz', }), SOAP::WSDL::Operation->new({ name => 'foobar', targetNamespace => 'bar', }), ] }); my $operation = $portType->find_operation('bar', 'foobar'); is $operation->get_name(), 'foobar', 'found operation'; $operation = $portType->find_operation('baz', 'foo'); is $operation->get_name(), 'foo', 'found operation'; $operation = $portType->find_operation('baz', 'foobar'); is $operation, undef, 'find_operation returns undef on unknown operation';SOAP-WSDL-3.003/t/SOAP/WSDL/Base.t0000644000175000017500000000071212375112740012567 0ustar use strict; use warnings; use Test::More tests => 8; use_ok qw(SOAP::WSDL::Base); my $obj = SOAP::WSDL::Base->new(); ok $obj->push_annotation('foo'); ok $obj->push_annotation('foo'); ok $obj->push_annotation('foo'); ok $obj->set_namespace('foo'); ok $obj->push_namespace('foo'); eval { $obj->find_namespace('uri:example','foo') }; like $@, qr{get_targetNamespace}; eval { $obj->find_namespace(['uri:example','foo']) }; like $@, qr{get_targetNamespace};SOAP-WSDL-3.003/t/SOAP/WSDL/Types.t0000644000175000017500000000122512375112740013021 0ustar use strict; use warnings; use Test::More tests => 6; use SOAP::WSDL::XSD::Attribute; use SOAP::WSDL::XSD::Schema; use_ok qw(SOAP::WSDL::Types); my $types = SOAP::WSDL::Types->new(); $types->set_xmlns({ foo => 'bar', }); my $attr = SOAP::WSDL::XSD::Attribute->new({ name => 'test', targetNamespace => 'bar' }); my $schema = SOAP::WSDL::XSD::Schema->new(); $schema->push_attribute( $attr ); $types->push_schema( $schema ); ok my $found_attr = $types->find_attribute('bar', 'test'); is $found_attr, $attr; ok $types->find_attribute([ 'bar', 'test' ]); ok ! $types->find_attribute('foo', 'test'); ok ! $types->find_element('foo', 'test'); SOAP-WSDL-3.003/t/SOAP/WSDL/02_port.t0000644000175000017500000000215112375112740013201 0ustar use Test::More tests => 10; use strict; use warnings; use diagnostics; use Cwd; use lib '../lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $soap; #2 ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl' ), 'Instantiated object' ); ok( ($soap->servicename('testService') ), 'set service' ); ok( ($soap->portname('testPort2') ) ,'set portname'); ok( $soap->wsdlinit(), 'parsed WSDL' ); ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' ); ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit'); ok( $soap = SOAP::WSDL->new( wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl' ), 'Instantiated object' ); ok( $soap->wsdlinit() ); $soap->outputxml(1); eval { $soap->call('test') }; like $@, qr{type \s tns:testSimpleType1 \s , \s urn:simpleType \s not \s found}xms;SOAP-WSDL-3.003/t/SOAP/WSDL_NO_MESSAGE.wsdl0000644000175000017500000000377412375112740014176 0ustar SOAP-WSDL-3.003/t/012_element.t0000644000175000017500000000511212375112740012414 0ustar #!/usr/bin/perl use Test::More qw(no_plan); use strict; use lib 'lib/'; use lib '../lib/'; use lib 't/lib'; use_ok qw(SOAP::WSDL::XSD::Typelib::Element); use_ok qw( MyElement ); # simple type derived from builtin via restriction my $obj = MyElement->new({ value => 'test'}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') , 'inherited class'; is $obj->serialize_qualified(), 'test', 'stringification'; $obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => 'Test2'}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class'; ok $obj->get_test->isa('SOAP::WSDL::XSD::Typelib::Builtin::string') , 'element isa'; is $obj->serialize_qualified, 'Test' . 'Test2' , 'stringification'; $obj = MyElement->new({ value => undef}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') , 'inherited class'; # is $obj, '', 'nillable stringification'; $obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => [ 'Test2', 'Test3' ]}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class'; is $obj, 'Test' . 'Test2' . 'Test3' . '' , 'multi value stringification'; ok $obj = MyComplexTypeElement->new({ MyTestName => 'test' }); is $obj->serialize_qualified(), 'test'; __END__ # simple type derived from builtin via list $obj = MySimpleListType->new({ value => [ 'test', 'test2' ]}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::list') , 'inherited class'; is $obj, 'test test2', 'stringification'; # simple type derived from atomic simple type (restriction) $obj = MyAtomicSimpleType->new({ value => 'test' }); ok $obj->isa('MySimpleType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction') , 'inherited class'; is $obj, 'test', 'stringification'; # simple type derived from atomic simple type (list) $obj = MyAtomicSimpleListType->new({ value => [ 'test', 'test2' ] }); ok $obj->isa('MySimpleListType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction') , 'inherited class'; is $obj, 'test test2', 'stringification'; SOAP-WSDL-3.003/t/008_client_wsdl_complexType.t0000644000175000017500000000204112375112740015666 0ustar #!/usr/bin/perl -w use strict; use warnings; use Test::More qw/no_plan/; # TODO: change to tests => N; use lib '../lib'; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $soap = SOAP::WSDL->new( wsdl => 'file://' . $url .'/acceptance/wsdl/008_complexType.wsdl' )->wsdlinit(); my $wsdl = $soap->get_definitions; my $schema = $wsdl->first_types(); my $type = $schema->find_type('Test' , 'testComplexTypeAll'); my $element = $type->get_element()->[0]; is $element->get_minOccurs() , 0, "minOccurs default for all"; is $element->get_maxOccurs() , 1, "maxOccurs default for all"; $type = $schema->find_type('Test' , 'testComplexTypeSequence'); $element = $type->get_element()->[0]; is $element->get_minOccurs() , 1, "minOccurs default for sequence"; is $element->get_maxOccurs() , 1, "maxOccurs default for sequence"; SOAP-WSDL-3.003/t/098_pod.t0000644000175000017500000000063612377451425011601 0ustar use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; my @dir_from = ('t'); if (!$ENV{HARNESS_ACTIVE}) { # perl Build test or make test run from top-level dir. if ( -d '../t/' ) { @dir_from = ('../lib/'); } } my @files = all_pod_files(@dir_from); plan tests => scalar(@files); foreach my $module (@files){ pod_file_ok( $module ) } SOAP-WSDL-3.003/t/006_client.t0000644000175000017500000000744312375112740012255 0ustar #!/usr/bin/perl -w use strict; use warnings; use diagnostics; use Test::More tests => 18; # qw/no_plan/; # TODO: change to tests => N; use lib '../lib'; use File::Spec; use File::Basename qw(dirname); eval { require Test::XML; import Test::XML }; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; use_ok(qw/SOAP::WSDL/); my $soap; $soap = SOAP::WSDL->new( wsdl => 'file://' . $url .'/acceptance/wsdl/006_sax_client.wsdl', outputxml => 1, # required, if not set ::SOM serializer will be loaded )->wsdlinit(); ok $soap->on_action('FOO'); $soap->servicename('MessageGateway'); ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" ); ok $soap->get_client(); ok $soap->get_client()->get_proxy(); SKIP: { skip_without_test_xml(); is_xml( $soap->call( 'EnqueueMessage' , EnqueueMessage => { 'MMessage' => { 'MRecipientURI' => 'mailto:test@example.com' , 'MMessageContent' => 'TestContent for Message' , } } ) , q{ mailto:test@example.com TestContent for Message } , "content comparison with optional elements"); } sub skip_without_test_xml { my $number = shift || 1; skip("Test::XML not available", $number) if (not $Test::XML::VERSION); } # test whether call sets proxy $soap->call( 'EnqueueMessage' , EnqueueMessage => { 'MMessage' => { 'MRecipientURI' => 'mailto:test@example.com' , 'MMessageContent' => 'TestContent for Message' , } } ); ok $soap->get_client()->get_proxy(); ok $soap->get_client()->get_transport(); # serializer & deserializer must be set after call() ok $soap->get_client()->get_serializer(); # ok $soap->get_client()->get_deserializer(); # no deserializer with outputxml # set_soap_version invalidates serializer and deserializer ok $soap->get_client()->set_soap_version('1.1'); ok ! $soap->get_client()->get_serializer(), 'serializer not loaded yet'; $soap->call( 'EnqueueMessage' , EnqueueMessage => { 'MMessage' => { 'MRecipientURI' => 'mailto:test@example.com' , 'MMessageContent' => 'TestContent for Message' , } } ); # serializer & deserializer come back after call() ok $soap->get_client()->get_serializer(); # ok $soap->get_client()->get_deserializer(); # no deserializer with outputxml SKIP: { eval "require SOAP::Lite" or skip 'cannot test SOAP::Deserializer::SOM without SOAP::Lite', 4; require SOAP::WSDL::Transport::Loopback; $soap->proxy('http://example.org'); $soap->outputxml(0); $soap->no_dispatch(0); ok my $result = $soap->call( 'EnqueueMessage' , EnqueueMessage => { 'MMessage' => { 'MRecipientURI' => 'mailto:test@example.com' , 'MMessageContent' => 'TestContent for Message' , } } ); ok $result->isa('SOAP::SOM'); is $result->result()->{MMessageContent}, 'TestContent for Message'; is $result->result()->{MRecipientURI}, 'mailto:test@example.com'; }; use_ok 'SOAP::WSDL::Client'; my $client = SOAP::WSDL::Client->new(); eval { $client->set_proxy([ 'http://example.org', keep_alive => 1 ]); $client->set_proxy('http://example.org', keep_alive => 1 ); }; if (! $@) { pass 'set_proxy'; } else { fail $@ }; SOAP-WSDL-3.003/t/097_kwalitee.t0000644000175000017500000000062712375112740012613 0ustar #!/usr/bin/perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); if ( not $ENV{RELEASE_TESTING} ) { my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.'; plan( skip_all => $msg ); } chdir '..' if -d ('../t'); eval 'use Test::Kwalitee'; if ( $EVAL_ERROR ) { my $msg = 'Test::Kwalitee not installed; skipping'; plan( skip_all => $msg ); } SOAP-WSDL-3.003/t/test.wsdl0000644000175000017500000001732712375112741012102 0ustar SimpleType Test SimpleType Union test SimpleType Test SimpleType Union test Test-Methode Test-Methode Test-Methode Test-Methode SOAP-WSDL-3.003/t/016_client_object.t0000644000175000017500000000423612375112740013601 0ustar #!/usr/bin/perl use Test::More tests => 10; use strict; use lib 'lib/'; use lib '../lib/'; use lib 't/lib'; use_ok qw(SOAP::WSDL::SOAP::Typelib::Fault11); use_ok qw(SOAP::WSDL::XSD::Typelib::Element); use_ok qw( MyElement ); use_ok qw( SOAP::WSDL::Client ); # simple type derived from builtin via restriction my $obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => 'Test2'}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class'; # print $obj->get_test; ok $obj->get_test->isa('SOAP::WSDL::XSD::Typelib::Builtin::string') , 'element isa'; is $obj, 'Test' . 'Test2' , 'stringification'; my $soap = SOAP::WSDL::Client->new( { class_resolver => 'FakeResolver', } ) ->proxy('http://bla') ->no_dispatch(1); # TODO: use Test::XML for testing and re-integrate # is $soap->call('Test', $obj), q{} # . q{} # . q{Test} # . q{Test2} # . q{} # , 'SOAP Envelope generation with objects'; my $result = $soap->proxy('http://bla') ->no_dispatch(0) ->call('Test', $obj); ok $result->isa('SOAP::WSDL::SOAP::Typelib::Fault11'), 'return fault on impossible call'; ok ! $result, 'fault is false in boolean context'; # $soap->no_dispatch(1); ok ! $soap->call('Test'), 'second call'; package FakeResolver; my %class_list = ( 'Fault' => 'SOAP::WSDL::SOAP::Typelib::Fault11', 'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', 'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyType', ); sub get_class { return $class_list{ $_[1] }; } sub get_typemap { return \%class_list; } SOAP-WSDL-3.003/t/acceptance/0000755000175000017500000000000012507276245012313 5ustar SOAP-WSDL-3.003/t/acceptance/wsdl/0000755000175000017500000000000012507276245013264 5ustar SOAP-WSDL-3.003/t/acceptance/wsdl/05_simpleType-restriction.wsdl0000644000175000017500000000314412375112740021153 0ustar SimpleType: Integer between 1 and 9 (Exclusive constrains) Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/nested_complextype.wsdl0000644000175000017500000001140212375112740020060 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/008_complexType.wsdl0000644000175000017500000000402712375112740017052 0ustar ComplexType Test ComplexType Test Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/02_port.wsdl0000644000175000017500000000712412375112740015440 0ustar SimpleType Test Test-Methode Test-Methode Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser-import.wsdl0000644000175000017500000000154512375112740017412 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/helloWorld_header.wsdl0000644000175000017500000000370712375112740017601 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser-imported.wsdl0000644000175000017500000000313012375112740017713 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/05_simpleType-list.wsdl0000644000175000017500000000424112375112740017560 0ustar SimpleType: List with an integer (length 2-4) SimpleType: List with an integer (length 2) Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser.wsdl0000644000175000017500000000523312375112740016100 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/03_complexType-sequence.wsdl0000644000175000017500000000652712375112740020602 0ustar ComplexType Test Test-Methode Test-Methode Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/006_sax_client.wsdl0000644000175000017500000004022112375112740016664 0ustar Enqueue message request element A type containing all elements of a message to enqueue. The recipient in URI notations. Valid URI schemas are: mailto:, sms:, phone:. Not all URI schemas need to be implemented at the current implementation stage. E-Mail sender address. Ignored for all but mailto: recipient URIs. Message Content. Message Subject. Ignored for all but mailto: URIs URI to send a delivery report to. May be of one of the following schemes: mailto:, http:, https:. Reports to mailto: URIs are sent as plaintext, reports to http(s) URIs are sent as SOAP requests following the MessageGatewayClient service definition. Container for keepalive information. May be missing. Type containing keeplive information. Keepalive timeout. The keepalive timeout spezifies how long the sending of a message will be delayed waiting for keepalive updates. If a keepalive update is received during this period, the timeout will be reset. If not, the message will be sent after the timeout has expired. Policy to comply to in case of system errors. Valid values are "suppress" and "report". If the policy is set to "suppress", keepalive messages will not be sent to their recipients in case of partial system failure, even if the keepalive has expired. This may result in "false negatives", i.e. messages may not be sent, even though their keepalive has expired. If the value is "report", keepalive messages will be sent from any cluster node. This may result in "false positive" alerts. Type containing a message ID. Type containing all elements of a keppalive update / remove request. xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" The ID for the message to update / remove The action to perform. Valid values are: "remove", "update". On "remove", the message with the ID specified will be removed from the queue, thus it will never be sent, even if it's timeout expires. On "update" the keepalive timeout of the corresponding message will be reset. Keepalive message request element Response element for a keepalive request Enqueue message response element A complex type containing one element: The message to enqueue. Element containing a message to enqueue. A complex type containing one element: The keepalive message to process. Element containing a keepalive message to process. inputparameters for EnqueueMessag outputparameters for EnqueueMessag input parameters for KeepaliveMessag output parameters for KeepaliveMessag generic port type for all methods required for sending messages over the mosaic message gatewa This method is used to enqueue a normal (immediate send) or a delayed message with keepalive functionality. This method is used to update or remove a keepalive message. Generic binding for all (SOAP) port Web Service for sending messages over the message gateway HTTP(S) port for the message gateway HTTP(S) port for the message gateway HTTP(S) port for the message gateway SOAP-WSDL-3.003/t/acceptance/wsdl/generator_unsupported_test.wsdl0000644000175000017500000000336112375112740021647 0ustar Test-Method SOAP-WSDL-3.003/t/acceptance/wsdl/04_element.wsdl0000644000175000017500000000440012375112740016101 0ustar Test-Methode Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/generator_test.wsdl0000644000175000017500000005534612375112740017211 0ustar SimpleType: List with an integer SimpleType: List with an integer (length 2) SimpleType: Integer between 1 and 9 (Exclusive constrains) SimpleType: Integer between 1 and 9 (Exclusive constrains) ComplexType Test ComplexType Test ComplexType Test complexType extension test complexType extension test ComplexType choice test ComplexType Test ComplexType Test Test Attribute good for nothing ComplexType test SimpleType: Integer between 1 and 9 (Inclusive constraints) 1 9 SimpleType: Integer between 1 and 9 (Inclusive constraints) test method Header test method choice/restriction test method multipart warning test method empty complex type test method restriction complex type test method SOAP-WSDL-3.003/t/acceptance/wsdl/03_complexType-element-ref.wsdl0000644000175000017500000000336212375112740021167 0ustar ComplexType Test Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser_import_loop.wsdl0000644000175000017500000000345212375112740020524 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/elementAtomicComplexType.xml0000644000175000017500000000072712375112740020764 0ustar SimpleType: Integer between 1 and 9 (Inclusive constraints) SOAP-WSDL-3.003/t/acceptance/wsdl/email_account.wsdl0000644000175000017500000001241712375112740016757 0ustar Ein (evtl. unvollständiger) Account-Datensatz. Alle Felder des Datensatzes können, müssen aber nicht gefüllt sein. Eine Liste von Account-Datensätzen. Die Liste kann leer sein. Methode zum Anzeigen eines Account-Datensatzes. Erwartet als Input einen (potentiell unvollständigen) Account-Datensatz und liefert den (vollständigen) Datensatz zurück. Methode zum Anlegen eines Account-Datensatzes. Erwartet als Input einen (potentiell unvollständigen) Account-Datensatz und liefert den (vollständigen) Datensatz zurück. Methode zum Ändern eines Account-Datensatzes. Erwartet als Input einen (potentiell unvollständigen) Account-Datensatz und liefert den (vollständigen) Datensatz zurück. Methode zum Löschen eines Account-Datensatzes. Erwartet als Input einen (potentiell unvollständigen) Account-Datensatz und liefert den (vollständigen) Datensatz zurück. Methode zum Suchen eines oder mehrerer Account-Datensätze. Erwartet als Input einen (potentiell unvollständigen) Account-Datensatz und liefert eine Liste an (vollständigen) passenden Datensätzen zurück. Die Liste kann leer sein.
SOAP-WSDL-3.003/t/acceptance/wsdl/04_element-simpleType.wsdl0000644000175000017500000000331012375112740020231 0ustar SimpleType: Integer between 1 and 9 (Inclusive constraints) 1 9 Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/0000755000175000017500000000000012507276245015212 5ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/import_cascade.xsd0000644000175000017500000000031712375112740020700 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/import_no_location.wsdl0000644000175000017500000000104012375112740021766 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/imported.xsd0000644000175000017500000000020612375112740017543 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/xsd_import_no_location.wsdl0000644000175000017500000000107712375112740022656 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/WSDLParser/import_xsd_cascade.wsdl0000644000175000017500000000114212375112740021726 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/03_complexType-all.wsdl0000644000175000017500000000406212375112740017532 0ustar ComplexType Test ComplexType Test Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/import.xsd0000644000175000017500000000200112375112740015277 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/10_helloworld.asmx.xml0000644000175000017500000000410512375112740017420 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/05_simpleType-union.wsdl0000644000175000017500000000671212375112740017742 0ustar SimpleType: List with an integer and a string SimpleType: List with an integer and a string Test-Methode Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/generator_test_dot_names.wsdl0000644000175000017500000003132212375112740021226 0ustar SimpleType: List with an integer (length 2) SimpleType: List with an integer (length 2) SimpleType: Integer between 1 and 9 (Exclusive constrains) SimpleType: Integer between 1 and 9 (Exclusive constrains) ComplexType Test ComplexType Test complexType extension test ComplexType Test ComplexType Test ComplexType Test SimpleType: Integer between 1 and 9 (Inclusive constraints) 1 9 SimpleType: Integer between 1 and 9 (Inclusive constraints) Test-Methode Test-Methode Test-Methode Test-Methode SOAP-WSDL-3.003/t/acceptance/wsdl/import_loop.xsd0000644000175000017500000000166612375112740016350 0ustar SOAP-WSDL-3.003/t/acceptance/wsdl/message_gateway.wsdl0000644000175000017500000003136112375112740017320 0ustar Enqueue message request element A type containing all elements of a message to enqueue. The recipient in URI notations. Valid URI schemas are: mailto:, sms:, phone:. Not all URI schemas need to be implemented at the current implementation stage. E-Mail sender address. Ignored for all but mailto: recipient URIs. Message Content. Message Subject. Ignored for all but mailto: URIs URI to send a delivery report to. May be of one of the following schemes: mailto:, http:, https:. Reports to mailto: URIs are sent as plain text, reports to http(s) URIs are sent as SOAP requests following the MessageGatewayClient service definition. Container for keepalive information. May be missing. Type containing keeplive information. Keepalive timeout. The keepalive timeout spezifies how long the sending of a message will be delayed waiting for keepalive updates. If a keepalive update is received during this period, the timeout will be reset. If not, the message will be sent after the timeout has expired. Policy to comply to in case of system errors. Valid values are "suppress" and "report". If the policy is set to "suppress", keepalive messages will not be sent to their recipients in case of partial system failure, even if the keepalive has expired. This may result in "false negatives", i.e. messages may not be sent, even though their keepalive has expired. If the value is "report", keepalive messages will be sent from any cluster node. This may result in "false positive" alerts. Type containing a message ID. Type containing all elements of a keppalive update / remove request. xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" The ID for the message to update / remove The action to perform. Valid values are: "remove", "update". On "remove", the message with the ID specified will be removed from the queue, thus it will never be sent, even if it's timeout expires. On "update" the keepalive timeout of the corresponding message will be reset. Keepalive message request element Response element for a keepalive request Enqueue message response element A complex type containing one element: The message to enqueue. Element containing a message to enqueue. A complex type containing one element: The keepalive message to process. Element containing a keepalive message to process. inputparameters for EnqueueMessag outputparameters for EnqueueMessag input parameters for KeepaliveMessag output parameters for KeepaliveMessag generic port type for all methods required for sending messages over the mosaic message gatewa This method is used to enqueue a normal (immediate send) or a delayed message with keepalive functionality. This method is used to update or remove a keepalive message. Generic binding for all (SOAP) port Web Service for sending messages over the message gateway HTTP(S) port for the message gateway HTTP(S) port for the message gateway SOAP-WSDL-3.003/t/acceptance/wsdl/11_helloworld.wsdl0000644000175000017500000000514412375112740016627 0ustar SOAP-WSDL-3.003/t/acceptance/results/0000755000175000017500000000000012507276245014014 5ustar SOAP-WSDL-3.003/t/acceptance/results/05_simpleType-union.xml0000644000175000017500000000117112375112740020313 0ustar 1SOAP-WSDL-3.003/t/acceptance/results/04_element.xml0000644000175000017500000000116312375112740016463 0ustar TestSOAP-WSDL-3.003/t/acceptance/results/03_complexType-all.xml0000644000175000017500000000131712375112740020111 0ustar Test 1Test 2SOAP-WSDL-3.003/t/acceptance/results/05_simpleType-list.xml0000644000175000017500000000117312375112740020140 0ustar 1 2SOAP-WSDL-3.003/t/acceptance/results/11_helloworld.xml0000644000175000017500000000057212375112740017206 0ustar testtestSOAP-WSDL-3.003/t/acceptance/results/04_element-simpleType.xml0000644000175000017500000000116312375112740020614 0ustar TestSOAP-WSDL-3.003/t/acceptance/results/05_simpleType-restriction.xml0000644000175000017500000000117112375112740021530 0ustar 1SOAP-WSDL-3.003/t/acceptance/results/03_complexType-sequence.xml0000644000175000017500000000133112375112740021145 0ustar Test 1Test 2SOAP-WSDL-3.003/t/096_characters.t0000644000175000017500000000344412375112740013124 0ustar #!/usr/bin/perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); use File::Find; use IO::File; if ( not $ENV{RELEASE_TESTING} ) { my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.'; plan( skip_all => $msg ); } my @skip = ( qr(\.svn) ); my $dir = 'blib/lib'; if (-d '../t') { $dir = '../lib'; } my @filelist = (); find( \&filelist, $dir); sub filelist { my $name = $_; return if (-d $name); return if $File::Find::name =~m{\.svn}x; push @filelist, $File::Find::name; } plan tests => scalar @filelist; for my $file (sort @filelist) { check_file($file); } sub check_file { my $file = shift; my $fh = IO::File->new($file, O_RDONLY) or die "Cannot open $file"; my $line_nr = 0; my $error_count = 0; while (my $line = $fh->getline() ) { # check for trailing whitespace # allow single whitespace on line to allow # pod source blocks with empty lines # $line_nr++; if ($line =~m{ (:?[^\s]+|\s)\s\r?\n$ }x) { $error_count++; print "# trailing whitespace in $file line $line_nr at end of line\n" } # check for tabs and report their position my @tab_pos_from = (); my $pos = -1; while (1) { $pos = index($line, "\t", $pos + 1); last if $pos <0; push @tab_pos_from, $pos + 1; } if (@tab_pos_from) { print "# tab found in $file line $line_nr cols ${ \join(', ', @tab_pos_from) }\n"; $error_count += scalar(@tab_pos_from); } if ($line=~m{\r}) { print "# CR (\\r) found in $file line $line_nr. Convert to LF only.\n"; $error_count++; } } is $error_count, 0 , "$file characters"; }SOAP-WSDL-3.003/t/095_copying.t0000644000175000017500000000724712375112740012461 0ustar use strict; use warnings; use Test::More; use File::Find; if ( not $ENV{RELEASE_TESTING} ) { my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.'; plan( skip_all => $msg ); } require Test::Pod::Content; import Test::Pod::Content; my $dir = 'blib/lib'; if (-d '../t') { $dir = '../lib'; } my @filelist = (); find( \&filelist, $dir); sub filelist { my $name = $_; return if (-d $name); return if $File::Find::name =~m{\.svn}x; return if $File::Find::name !~m{\.pm$}x; # skip builtin XSD types - they contain no pod return if $File::Find::name =~m{SOAP/WSDL/XSD/Typelib/Builtin/.+}xms; # skip data classes - they contain no pod return if $File::Find::name =~m{SOAP/WSDL/Base\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Binding\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Message\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Operation\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/OpMessage\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Part\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Port\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/PortType\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/SOAP/Address\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/SOAP/Body\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/SOAP/Header\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/SOAP/HeaderFault\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/SOAP/Operation\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Service\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/TypeLookup\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/Types\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Builtin\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/ComplexType\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/SimpleType\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Element\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Schema\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Attribute\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Typelib/Attribute\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Typelib/AttributeSet\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Group\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/TotalDigits\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Annotation\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/AttributeGroup\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Enumeration\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/FractionDigits\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Length\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MaxExclusive\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MaxInclusive\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MaxLength\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MinLength\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MinInclusive\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/MinExclusive\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/Pattern\.pm$}xms; return if $File::Find::name =~m{SOAP/WSDL/XSD/WhiteSpace\.pm$}xms; push @filelist, $File::Find::name; } plan tests => scalar @filelist; for my $file (sort @filelist) { pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{ This \s file \s is \s part \s of \s SOAP-WSDL\. \s You \s may \s distribute/modify \s it \s under \s the \s same \s terms \s as \s perl \s itself }xms, "$file License notice"); } SOAP-WSDL-3.003/t/099_pod_coverage.t0000644000175000017500000000423112375112740013440 0ustar use Test::More; if ( not $ENV{RELEASE_TESTING} ) { my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.'; plan( skip_all => $msg ); } eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD" if $@; my @dirs = ( 'lib' ); if (-d '../t/') { # we are inside t/ @dirs = ('../lib'); } else { # we are outside t/ # add ./lib to include path if blib/lib is not there (e.g. we're not # run from Build test or the like) push @INC, './lib' if not grep { $_ eq 'blib/lib' } @INC; } # Don't test Builtin XSD types - they're undocumented on purpose # Don't test WSDL datatypes - they're undocumented on purpose. @files = grep { $_ !~m{ (SOAP::WSDL::XSD::Typelib::Builtin::.+ |SOAP::WSDL::OpMessage |SOAP::WSDL::Types |SOAP::WSDL::PortType |SOAP::WSDL::Port |SOAP::WSDL::Service |SOAP::WSDL::Binding |SOAP::WSDL::Message |SOAP::WSDL::TypeLookup |SOAP::WSDL::Base |SOAP::WSDL::Part |SOAP::WSDL::Operation |SOAP::WSDL::SOAP::[^:]+ |SOAP::WSDL::XSD::Annotation |SOAP::WSDL::XSD::Attribute |SOAP::WSDL::XSD::AttributeGroup |SOAP::WSDL::XSD::SimpleType |SOAP::WSDL::XSD::Element |SOAP::WSDL::XSD::ComplexType |SOAP::WSDL::XSD::Builtin |SOAP::WSDL::XSD::Schema |SOAP::WSDL::XSD::Group |SOAP::WSDL::XSD::MaxLength |SOAP::WSDL::XSD::MinLength |SOAP::WSDL::XSD::MaxInclusive |SOAP::WSDL::XSD::MinInclusive |SOAP::WSDL::XSD::MinExclusive |SOAP::WSDL::XSD::MaxExclusive |SOAP::WSDL::XSD::Enumeration |SOAP::WSDL::XSD::Length |SOAP::WSDL::XSD::FractionDigits |SOAP::WSDL::XSD::Pattern |SOAP::WSDL::XSD::SimpleType |SOAP::WSDL::XSD::TotalDigits |SOAP::WSDL::XSD::WhiteSpace |SOAP::WSDL::XSD::Typelib::Attribute |SOAP::WSDL::XSD::Typelib::AttributeSet ) \z }xms; } all_modules( @dirs ); plan tests => scalar @files; foreach (@files) { pod_coverage_ok( $_ , { private => [ qr/^_/, qr/^BUILD$/, qr/^START$/, qr/^STORABLE/, qr/^AUTOMETHOD$/, qr/^DEMOLISH$/ ] }); }SOAP-WSDL-3.003/t/002_parse_wsdl.t0000644000175000017500000002720512375112740013134 0ustar #!/usr/bin/perl -w use strict; use warnings; use Test::More tests => 23; use Storable; use lib '../lib'; eval { require Test::XML; import Test::XML; }; use_ok(qw/SOAP::WSDL::Expat::WSDLParser/); my $filter; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); $parser->parse_string( xml() ); my $wsdl; ok( $wsdl = $parser->get_data() , "get object tree"); ok Storable::thaw(Storable::freeze($wsdl)); my $types = $wsdl->first_types(); is $types->get_parent(), $wsdl , 'types parent'; my $serializer_options = { readable => 1, autotype => 1, namespace => { 'tns' => 'urn:myNamespace', 'xsd' => "http://www.w3.org/2001/XMLSchema" }, typelib => $wsdl->first_types(), indent => "\t", }; my $xml; my $type = $types->find_type( 'urn:myNamespace', 'testSimpleType1' ); ok($xml = $type->serialize( 'test', 1 , $serializer_options ), "serialize simple Type" ); # print $xml; SKIP: { skip_without_test_xml(); is_xml( $xml, '1', "content compare" ); }; $type = $types->find_type( 'urn:myNamespace', 'testSimpleList' ); ok($xml = $type->serialize( 'testList', [ 1, 2, 3 ] , $serializer_options ), "serialize simple list type" ); SKIP: { skip_without_test_xml(); is_xml( $xml, '1 2 3', "content compare" ); }; $type = $types->find_element( 'urn:myNamespace', 'TestElement' ); ok($xml = $type->serialize( undef, 1 , $serializer_options ), "serialize simple element"); SKIP: { skip_without_test_xml(); is_xml( $xml, '1', "content compare" ); }; ok( $xml = $types->find_type( 'urn:myNamespace', 'length3')->serialize( 'TestComplex', { size => -13, unit => 'BLA' } , $serializer_options ), "serialize complex type"); SKIP: { skip_without_test_xml(); is_xml( $xml, q{ -13 BLA }, "content compare" ); }; ok($xml = $types->find_element( 'urn:myNamespace', 'TestElementComplexType') ->serialize( undef, { size => -13, unit => 'BLA' } , $serializer_options ), "serialize element with complex type" ); SKIP: { skip_without_test_xml(); is_xml( $xml, q{ -13 BLA }, "content compare" ); }; ok($xml = $types->find_type( 'urn:myNamespace', 'complex')->serialize( 'complexComplex', { 'length' => { size => -13, unit => 'BLA' }, 'int' => 1 }, $serializer_options ), "serialize complex type with complex content" ); SKIP: { skip_without_test_xml(); is_xml( $xml, q{ -13 BLA 1 }, "content compare" ); } ok($xml = $wsdl->find_message('urn:myNamespace', 'testRequest') ->get_part()->[0]->serialize( undef, { test => { length => { size => -13, unit => 'BLA' } , int => 3 } }, $serializer_options ), "serialize part" ); SKIP: { skip_without_test_xml(); is_xml( $xml, q{ -13 BLA 3 }, "content compare") }; my $opt = { typelib => $types, readable => 1, autotype => 0, namespace => { 'urn:myNamespace' => 'tns', 'http://www.w3.org/2001/XMLSchema' => 'xsd', 'http://schemas.xmlsoap.org/wsdl/' => 'wsdl', }, indent => "", wsdl => $wsdl, }; # ok $wsdl->explain($opt) =~ m/#optional/m; eval { $wsdl->expand('hallo:welt')}; like $@, qr{unbound}, 'Die on attempt to resolve unbound prefix'; my $complex = $types->find_type( 'urn:myNamespace', 'complex'); ok $complex->find_element('', 'length'), 'Find unqualified element in complexType'; ok ! $complex->find_element('urn:myNamespace', 'FOO'), 'Find element in complexType'; eval { $complex->foo() }; like $@, qr{ foo }xms; eval { SOAP::WSDL::ComplexType->foo() }; like $@, qr{ foo }xms; sub skip_without_test_xml { skip("Test::XML not available", 1) if (not $Test::XML::VERSION); } sub xml { return q{ SimpleType Test SimpleType Union test Test-Methode Test-Methode Test-Methode Test-Methode }; } SOAP-WSDL-3.003/t/009_data_classes.t0000644000175000017500000000611612375112740013424 0ustar #!/usr/bin/perl -w use strict; use warnings; use Test::More tests => 5; use lib 't/lib'; use lib '../lib'; use lib 'lib'; use SOAP::WSDL::Expat::MessageParser; use Cwd; use SOAP::WSDL; use SOAP::WSDL::XSD::Typelib::Builtin; use File::Basename; use File::Spec; my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = join '/', @dir_from; my $parser; ok $parser = SOAP::WSDL::Expat::MessageParser->new({ class_resolver => FakeResolver->new(), }), "Object creation"; ok $parser->class_resolver()->isa('FakeResolver'); ok $parser->class_resolver('FakeResolver'); # TODO factor out into bool test $parser->parse( xml() ); if($parser->get_data()->get_MMessage()->get_MDeliveryReportRecipientURI()) { pass "bool context overloading"; } else { fail "bool context overloading" } # TODO factor out into different test my $soap = SOAP::WSDL->new( wsdl => 'file://' . $url .'/acceptance/wsdl/006_sax_client.wsdl', )->wsdlinit(); $soap->servicename('MessageGateway'); ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" ); sub xml { q{ mailto:test@example.com TestContent for Message martin.kutter@example.com mailto:test@example.com }; } # data classes reside in t/lib/Typelib/ BEGIN { package FakeResolver; { my %class_list = ( 'EnqueueMessage' => 'Typelib::TEnqueueMessage', 'EnqueueMessage/MMessage' => 'Typelib::TMessage', 'EnqueueMessage/MMessage/MRecipientURI' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', 'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'EnqueueMessage/MMessage/MSenderAddress' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'EnqueueMessage/MMessage/MDeliveryReportRecipientURI' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', ); sub new { return bless {}, 'FakeResolver' }; sub get_typemap { return \%class_list }; sub get_class { my $name = join('/', @{ $_[1] }); return ($class_list{ $name }) ? $class_list{ $name } : warn "no class found for $name"; }; }; }; SOAP-WSDL-3.003/t/CodeFirst/0000755000175000017500000000000012507276245012107 5ustar SOAP-WSDL-3.003/t/CodeFirst/element.pm0000755000175000017500000000177012375112740014076 0ustar package element; use strict; use warnings; our $VERSION = 0.1; use base qw(SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType); sub get_xmlns { 'http://www.w3.org/XMLSchema2001' } sub __get_attr_class { 'element::_ATTR' } __PACKAGE__->__set_name('element'); __PACKAGE__->_factory(); package element::_ATTR; use strict; use warnings; our $VERSION = 0.1; use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); my %name_of :ATTR(:name :default<()>); my %type_of :ATTR(:name :default<()>); my %ref_of :ATTR(:name :default<()>); __PACKAGE__->_factory( [ 'name' , 'type', 'ref' ], { 'name' => \%name_of, 'ref' => \%ref_of, 'type' => \%type_of, }, { 'name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'ref' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', }, { name => 'name', type => 'type', 'ref' => 'ref' } ); 1; 1;SOAP-WSDL-3.003/t/CodeFirst/sequence.pm0000755000175000017500000000073512375112740014255 0ustar package sequence; use strict; use warnings; our $VERSION = 0.1; use base qw(SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType); sub get_xmlns { 'http://www.w3.org/XMLSchema2001' } __PACKAGE__->__set_name('sequence'); my %element_of :ATTR(:name :default<()>); __PACKAGE__->_factory( ['element'], { element => \%element_of, }, { element => 'element', }, { element => 'element', } ); 1;SOAP-WSDL-3.003/t/CodeFirst/test.pl0000755000175000017500000000351312375112740013420 0ustar package testCodeFirst; use strict; use warnings; our $VERSION = 0.1; use lib '../lib'; use base q{CodeFirst}; sub test :WebMethod( name => "sayHello", action => "uri:helloWorld/sayHello", request_body => "CodeFirst::HelloRequest", response_body => "CodeFirst::HelloResponse" ) { # return either [ \%body, \%header ] # or \%body # or [ Body->new(), Header->new ] # or even [ Body->new(), [ Header1->new(), Header2->new() ]] # or any combination of that return [{ }, { }]; } =pod ... would translate to =cut =pod sub test2 :WebMethod( action => "test2", request_header => "bar", reqest_body => "bam", response_header => "bam", response_body => "baz" ) { } =cut package main; use Data::Dumper; my $test = testCodeFirst->new(); # print Dumper $test->_action_map; # print Dumper $test->get_transport()->get_action_map_ref(); #print $test->get_wsdl("http://localhost/foo")->toString(); use CodeFirst::Serializer; use CodeFirst::Deserializer; use CodeFirst::HelloResponse; use CodeFirst::HelloRequest; my $serializer = CodeFirst::Serializer->new(); #print $serializer->serialize("sayHelloResponse", "uri:MooseX.SOAP.CodeFirst", CodeFirst::HelloResponse->new( # Result => "Test" #))->toString; # my $xml = $serializer->serialize("sayHello", "uri:MooseX.SOAP.testCodeFirst", CodeFirst::HelloRequest->new( Name => 'Flint', GivenName => 'Erol', ))->toString; #print "\n\n"; print $xml, "\n"; print $test->get_wsdl()->toString(), "\n"; my $deserializer = CodeFirst::Deserializer->new(); $deserializer->schema( $test->schema ); print Dumper $deserializer->deserialize($xml, 'CodeFirst::HelloRequest'); 1;SOAP-WSDL-3.003/t/CodeFirst/ComplexType.pm0000755000175000017500000000247212375112740014716 0ustar package ComplexType; use strict; use warnings; use lib '.'; our $VERSION = 0.1; use base qw(SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType); sub get_xmlns { 'http://www.w3.org/XMLSchema2001' } sub __get_attr_class { 'ComplexType::_ATTR' } __PACKAGE__->__set_name('ComplexType'); my %sequence_of :ATTR(:name :default<()>); __PACKAGE__->_factory( [ 'sequence' ], { sequence => \%sequence_of, }, { sequence => 'sequence', }, { sequence => 'sequence', }, ); package ComplexType::_ATTR; use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet); my %name_of :ATTR(:name :default<()>); __PACKAGE__->_factory( [ 'name' ], { name => \%name_of }, { name => 'SOAP::WSDL::XSD::Typelib::Builtin::string', }, { name => 'name', } ); 1; use sequence; use element; my $foo = element->new({ xmlattr => { name => 'foo', type => 'string' } }); my $bar = element->new({ xmlattr => { name => 'bar', type => 'string', }, }); my $type = ComplexType->new({ xmlattr => { name => 'Test' }, sequence => { element => [ $foo, $bar ], } }); print $type->serialize_qualified(), "\n"; use Data::Dumper; print Dumper $type->as_hash_ref(); SOAP-WSDL-3.003/t/013_complexType.t0000644000175000017500000000301012375356216013300 0ustar #!/usr/bin/perl use Test::More qw(no_plan); use strict; use lib 'lib/'; use lib '../lib/'; use lib 't/lib'; use_ok qw(SOAP::WSDL::XSD::Typelib::ComplexType); use_ok qw( MyComplexType ); # simple type derived from builtin via restriction my $obj = MyComplexType->new({ MyTestName => 'test' }); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class'; is $obj, 'test', 'stringification'; $obj = MyComplexType->new({ MyTestName => [ 'test', 'test2' ] }); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class'; is $obj, 'testtest2', 'stringification'; # try on the fly factory @MyComplexType2::ISA = ('SOAP::WSDL::XSD::Typelib::ComplexType'); { use Class::Std::Fast::Storable; my %MyTestName_of; MyComplexType2->_factory( [ qw(MyTestName) ], # order { MyTestName => \%MyTestName_of }, # attribute lookup map { MyTestName => 'MyElement' } # class name lookup map ); } $obj = MyComplexType2->new({ MyTestName => [ 'test', 'test2' ] }); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType') , 'inherited class (on the fly-factory object)'; is $obj, 'testtest2', 'stringification (on the fly-factory object)'; # TODO factor out into complexType test eval { $obj->get_ZUMSL }; like $@, qr{Valid\smethods}xm, 'error message (invalid method)'; __END__ SOAP-WSDL-3.003/t/011_simpleType.t0000644000175000017500000000243712375112740013124 0ustar #!/usr/bin/perl use Test::More qw(no_plan); use strict; use lib 'lib/'; use lib 't/lib/'; use lib '../lib/'; use_ok qw(MySimpleType); # simple type derived from builtin via restriction my $obj = MySimpleType->new({ value => 'test'}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') , 'inherited class'; is $obj, 'test', 'stringification'; # simple type derived from builtin via list $obj = MySimpleListType->new({ value => [ 'test', 'test2' ]}); ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::list') , 'inherited class'; is $obj->serialize(), 'test test2', 'stringification'; # simple type derived from atomic simple type (restriction) $obj = MyAtomicSimpleType->new({ value => 'test' }); ok $obj->isa('MySimpleType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction') , 'inherited class'; is $obj, 'test', 'stringification'; # simple type derived from atomic simple type (list) $obj = MyAtomicSimpleListType->new({ value => [ 'test', 'test2' ] }); ok $obj->isa('MySimpleListType') , 'inherited class'; ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction') , 'inherited class'; is $obj->serialize(), 'test test2', 'stringification'; SOAP-WSDL-3.003/t/contributed.wsdl0000644000175000017500000002667412375112740013451 0ustar SOAP-WSDL-3.003/t/094_cpan_meta.t0000644000175000017500000000046312375112740012730 0ustar use Test::More; if (not $ENV{RELEASE_TESTING} ) { my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.'; plan( skip_all => $msg ); } eval { require Test::CPAN::Meta } or plan skip_all => "Test::CPAN::Meta required for testing META.yml"; Test::CPAN::Meta::meta_yaml_ok();SOAP-WSDL-3.003/t/lib/0000755000175000017500000000000012507276245010773 5ustar SOAP-WSDL-3.003/t/lib/Test/0000755000175000017500000000000012507276245011712 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/0000755000175000017500000000000012507276245012454 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/0000755000175000017500000000000012507276245013225 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Expat/0000755000175000017500000000000012507276245014306 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Expat/WSDLParser.pm0000644000175000017500000000500612375112740016563 0ustar #!perl package Test::SOAP::WSDL::Expat::WSDLParser; use strict; use warnings; use Test::More; use Test::SOAP::WSDL::Tester; use base qw(Test::SOAP::WSDL::Tester); # It's a modulinho - it runs when executed... if (! caller() ) { __PACKAGE__->runtests(); } sub parse_t_uri { my $self = shift; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); return $parser->parse_uri($self->t_url() . '/'. shift); } sub parse_wsdl_schema :Test(1) { my $self = shift; ok my $wsdl = $self->parse_t_uri( "../imported/schema/wsdl11/wsdl.xsd"); } sub parse_soap_binding :Test(1) { my $self = shift; ok my $wsdl = $self->parse_t_uri( "../imported/schema/wsdl11/soap_binding.xsd"); } sub parse_http_binding :Test(1) { my $self = shift; ok my $wsdl = $self->parse_t_uri( "../imported/schema/wsdl11/http_binding.xsd"); } sub parse_wsdl :Test(3) { my $self = shift; ok my $wsdl = $self->parse_t_uri( "acceptance/wsdl/WSDLParser.wsdl"); my $schema = $wsdl->first_types()->get_schema()->[1]; my $attr = $schema->get_element()->[0]->first_complexType->first_attribute(); ok $attr->get_name('testAttribute'); ok $attr->get_type('xs:string'); } sub parse_wsdl_with_import :Test(8) { my $self = shift; ok my $wsdl = $self->parse_t_uri( "acceptance/wsdl/WSDLParser-import.wsdl"); # Content checks is $wsdl->get_service()->[0]->get_name(), 'Service1', 'found service name'; is $wsdl->get_portType->[0]->get_name(), 'Service1Soap', 'found portType name'; is $wsdl->get_types()->[0] ->get_schema()->[1] ->get_element()->[0]->get_name(), 'sayHello', 'found element name'; ok my $schema_from_ref = $wsdl->get_types() ->[0]->get_schema(), 'found schema'; is @{ $schema_from_ref }, 2, 'got builtin and imported schema'; ok @{ $schema_from_ref->[1]->get_element } > 0, 'found mi element in second schema'; is $schema_from_ref->[1] ->get_element->[0]->get_name(), 'sayHello', 'found element name'; } sub parse_wsdl_with_import_loop :Test(1) { my $self = shift; SKIP: { skip 'cannot test without Test::Warn', 1 if not $self->has_test_warn(); my $wsdl; Test::Warn::warning_like { $wsdl = $self->parse_t_uri( "acceptance/wsdl/WSDLParser_import_loop.wsdl") } qr{file:///home/martin/workspace/SOAP-WSDL/t/acceptance/wsdl/import_loop.xsd \s already \s imported. \s Ignoring \s it}x, 'warn about duplicate import'; } } 1;SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Tester.pm0000644000175000017500000000214412375112741015023 0ustar package Test::SOAP::WSDL::Tester; use strict; use warnings; use Test::Class; use base qw(Test::Class); use File::Basename; use File::Spec; use Test::More; use Scalar::Util qw(blessed); our $HAS_TEST_WARN; BEGIN { $HAS_TEST_WARN = eval { require Test::Warn; import Test::Warn; 1 }; } sub has_test_warn { return $HAS_TEST_WARN; } # object accessors sub set_object { $_[0]->{ object } = $_[1] } sub get_object { return shift->{ object } }; # class accessors sub set_class { $_[0]->{ class } = $_[1] } sub get_class { return shift->{ class } }; sub startup :Test(startup => 1) { my $self = shift; my $class = ref $self; if ($class eq __PACKAGE__) { ok __PACKAGE__; return; }; $class =~s{^Test::}{}; $self->set_class( $class ); use_ok $class; } sub t_url { my $path = File::Spec->rel2abs( dirname __FILE__ ); my ($volume, $dir) = File::Spec->splitpath($path, 1); my @dir_from = File::Spec->splitdir($dir); unshift @dir_from, $volume if $volume; my $url = 'file://' . join '/', @dir_from[0..$#dir_from - 4]; # die $url; return $url; } 1;SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Generator/0000755000175000017500000000000012507276245015153 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Generator/Visitor/0000755000175000017500000000000012507276245016612 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Generator/Visitor/Typemap.pm0000644000175000017500000000060612375112741020562 0ustar #!perl package Test::SOAP::WSDL::Generator::Visitor::Typemap; use strict; use warnings; use Test::More; use base qw(Test::SOAP::WSDL::Tester); # It's a modulinho - it runs when executed... if (! caller() ) { __PACKAGE__->runtests(); } sub a_constructor : Test( 1 ) { my $self = shift; ok my $obj = $self->get_class->new() ; $self->set_object( $self->get_class->new() ); } SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Generator/Iterator/0000755000175000017500000000000012507276245016744 5ustar SOAP-WSDL-3.003/t/lib/Test/SOAP/WSDL/Generator/Iterator/WSDL11.pm0000644000175000017500000000212112375112741020202 0ustar #!perl package Test::SOAP::WSDL::Generator::Iterator::WSDL11; use strict; use warnings; use Test::More; use SOAP::WSDL::Expat::WSDLParser; use base qw(Test::SOAP::WSDL::Tester); # It's a modulinho - it runs when executed... if (! caller() ) { __PACKAGE__->runtests(); } sub parse_t_uri { my $self = shift; my $parser = SOAP::WSDL::Expat::WSDLParser->new(); return $parser->parse_uri($self->t_url() . '/'. shift); } sub iterate :Test() { my $self = shift; my $iter = SOAP::WSDL::Generator::Iterator::WSDL11->new(); $iter->set_definitions($self->parse_t_uri( "acceptance/wsdl/WSDLParser.wsdl")); $iter->init(); while (my $node = $iter->get_next()) { print $node, "\n"; } } sub iterate_init :Test() { my $self = shift; my $iter = SOAP::WSDL::Generator::Iterator::WSDL11->new(); $iter->set_definitions($self->parse_t_uri( "acceptance/wsdl/WSDLParser.wsdl")); $iter->init(); for my $service (@{ $iter->get_definitions()->get_service() }) { while (my $node = $iter->get_next()) { print $node, "\n"; } } } SOAP-WSDL-3.003/t/lib/MyComplexType.pm0000644000175000017500000000100512375112740014074 0ustar #!/usr/bin/perl package MyComplexType; use strict; use Class::Std::Fast::Storable constructor => 'none'; use lib '../../lib'; use base ('SOAP::WSDL::XSD::Typelib::ComplexType'); Class::Std::initialize(); my %MyTestName_of :ATTR(:get); __PACKAGE__->_factory( [ qw(MyTestName) ], # order { MyTestName => \%MyTestName_of }, # attribute lookup map { MyTestName => 'SOAP::WSDL::XSD::Typelib::Builtin::string' } # class name lookup map ); sub get_xmlns { 'urn:Test' }; 1; SOAP-WSDL-3.003/t/lib/Typelib/0000755000175000017500000000000012507276245012403 5ustar SOAP-WSDL-3.003/t/lib/Typelib/TMessage.pm0000644000175000017500000000171712375112741014450 0ustar package Typelib::TMessage; use strict; use base qw(Typelib::Base); use Class::Std::Fast constructor => 'basic'; my %MRecipientURI_of :ATTR(:name :default<()>); my %MMessageContent_of :ATTR(:name :default<()>); my %MSenderAddress_of :ATTR(:name :default<()>); my %MSubject_of :ATTR(:name :default<()>); my %MDeliveryReportRecipientURI_of :ATTR(:name :default<()>); my %MKeepalive_of :ATTR(:name :default<()>); my %attributes_of :ATTR(); %attributes_of = ( MRecipientURI => \%MRecipientURI_of, MMessageContent => \%MMessageContent_of, MSenderAddress => \%MSenderAddress_of, MSubject => \%MSubject_of, MDeliveryReportRecipientURI => \%MDeliveryReportRecipientURI_of, MKeepalive => \%MKeepalive_of, ); # make a add_BLA method for every attribute __PACKAGE__->mk_add_mutators( \%attributes_of ); Class::Std::Fast::initialize(); 1;SOAP-WSDL-3.003/t/lib/Typelib/Base.pm0000644000175000017500000000157012375112741013607 0ustar package Typelib::Base; use Class::Std::Fast::Storable; sub mk_add_mutators { my $class = shift; my $attributes = shift; for my $method ( keys %{$ attributes }) { *{ "$class\::add_$method" } = sub { my ($self, $value) = @_; my $ident = ${ $self }; # we're the first value return $attributes->{ $method }->{ $ident } = $value if not defined $attributes->{ $method }->{ $ident }; # we're the second value return $attributes->{ $method }->{ $ident } = [ $attributes->{ $method }->{ $ident }, $value ] if not ref $attributes->{ $method }->{ $ident } eq 'ARRAY'; # we're third or later push @{ $attributes->{ $method }->{ $ident } }, $value; return $attributes->{ $method }->{ $ident }; } } } 1;SOAP-WSDL-3.003/t/lib/Typelib/TEnqueueMessage.pm0000644000175000017500000000046612375112741016000 0ustar package Typelib::TEnqueueMessage; use strict; use base qw(Typelib::Base); my %MMessage_of :ATTR(:name :default<()>); my %attributes_of :ATTR(); %attributes_of = ( MMessage => \%MMessage_of, ); # make a add_BLA method for every attribute __PACKAGE__->mk_add_mutators( \%attributes_of ); 1; SOAP-WSDL-3.003/t/lib/CodeFirst.pm0000755000175000017500000002125112375112740013207 0ustar package CodeFirst; use Moose; use Carp; use Scalar::Util qw(blessed); use XML::LibXML; use parent qw(Attribute::Handlers); our $VERSION = 0.1; my %ACTION_MAP_OF; my %ACTION_DATA_OF; my %SCHEMA_DATA_OF; has 'schema' => is => 'rw'; has 'typeMap' => is => 'rw', isa => 'CodeFirst::Types', default => sub { CodeFirst::Types->new() }; sub WebMethod : ATTR { my ( $class, $symbol, $referent, $attr, $data, $phase, $filename, $linenum ) = @_; my %parameter_of; eval { %parameter_of = @{$data} }; if ($@) { die "Cannot parse :WebMethod arguments: $@ at " . Carp::shortmess; } $ACTION_MAP_OF{$class}->{$parameter_of{action}} = $symbol; $ACTION_DATA_OF{$class}->{$parameter_of{action}} = { name => $parameter_of{name}, request => { body => $parameter_of{request_body}, header => $parameter_of{request_header}, }, response => { body => $parameter_of{response_body}, header => $parameter_of{response_header}, }}; $SCHEMA_DATA_OF{$class}->{$parameter_of{request_header}} = undef if ( $parameter_of{request_header} ); $SCHEMA_DATA_OF{$class}->{$parameter_of{request_body}} = undef if ( $parameter_of{request_body} ); $SCHEMA_DATA_OF{$class}->{$parameter_of{response_header}} = undef if ( $parameter_of{response_header} ); $SCHEMA_DATA_OF{$class}->{$parameter_of{response_body}} = undef if ( $parameter_of{response_body} ); #use Data::Dumper; #print Dumper \%ACTION_DATA_OF; #return Class::Std::Fast::MODIFY_CODE_ATTRIBUTES( $class, $code, # @attribute_from ); return; # @attribute_from; } sub get_wsdl { my $self = shift; my $class = ref $self; my $address = shift; my $className = $class; $className =~ s{::}{.}xg; my XML::LibXML::Document $doc = XML::LibXML::Document->new(); my $root = XML::LibXML::Element->new("definitions"); $root->setNamespace( 'http://schemas.xmlsoap.org/wsdl/', undef, 1 ); $root->setNamespace( 'http://www.w3.org/2001/XMLSchema', 'xs', 0 ); $root->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 0 ); $root->setNamespace( 'uri:MooseX.SOAP.' . $className, 'tns', 0 ); $root->setAttribute( 'targetNamespace', 'uri:MooseX.SOAP.' . $className ); $doc->setDocumentElement($root); my $type = XML::LibXML::Element->new('types'); $root->appendChild($type); my $schema = $self->create_schema($className); $type->appendChild($schema); my $portType = XML::LibXML::Element->new('portType'); $portType->setAttribute( 'name', $className . 'SOAP11' ); my $binding = XML::LibXML::Element->new('binding'); $binding->setAttribute( 'name', $className . 'SOAP11Binding' ); $binding->setAttribute( 'type', 'tns:' . $className . 'SOAP11' ); # my $soapBinding = XML::LibXML::Element->new('binding'); $soapBinding->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 1 ); $soapBinding->setAttribute( 'transport', 'http://schemas.xmlsoap.org/soap/http' ); $soapBinding->setAttribute( 'style', 'document' ); $binding->appendChild($soapBinding); for my $method ( keys %{$ACTION_DATA_OF{$class}} ) { my $methodName = $ACTION_DATA_OF{$class}->{$method}->{name}; my $inElement = XML::LibXML::Element->new('element'); $inElement->setAttribute( 'name', $methodName ); $schema->appendChild($inElement); my $outElement = XML::LibXML::Element->new('element'); $outElement->setAttribute( 'name', $methodName . 'Response' ); $schema->appendChild($outElement); my $inMessage = XML::LibXML::Element->new('message'); $inMessage->setAttribute( 'name', $methodName . 'SoapIn' ); $root->appendChild($inMessage); my $inMessageBodyPart = XML::LibXML::Element->new('part'); $inMessageBodyPart->setAttribute( 'name', 'input' ); $inMessageBodyPart->setAttribute( 'element', 'tns:' . $methodName ); $inMessage->appendChild($inMessageBodyPart); my $outMessage = XML::LibXML::Element->new('message'); $outMessage->setAttribute( 'name', $methodName . 'SoapOut' ); $root->appendChild($outMessage); my $outMessageBodyPart = XML::LibXML::Element->new('part'); $outMessageBodyPart->setAttribute( 'name', 'output' ); $outMessageBodyPart->setAttribute( 'element', 'tns:' . $methodName . 'Response' ); $outMessage->appendChild($outMessageBodyPart); my $portOperation = XML::LibXML::Element->new('operation'); $portOperation->setAttribute( 'name', $methodName ); $portType->appendChild($portOperation); my $inputMessage = XML::LibXML::Element->new('input'); $inputMessage->setAttribute( 'message', 'tns:' . $methodName . 'SoapIn' ); $portOperation->appendChild($inputMessage); my $outputMessage = XML::LibXML::Element->new('output'); $outputMessage->setAttribute( 'message', 'tns:' . $methodName . 'SoapOut' ); $portOperation->appendChild($outputMessage); my $bindingOperation = XML::LibXML::Element->new('operation'); $bindingOperation->setAttribute( 'name', $methodName ); $binding->appendChild($bindingOperation); my $soapOperation = XML::LibXML::Element->new('operation'); $soapOperation->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 1 ); $soapOperation->setAttribute( 'soapAction', $method ); $soapOperation->setAttribute( 'style', 'document' ); $bindingOperation->appendChild($soapOperation); my $bindingInput = XML::LibXML::Element->new('input'); $bindingOperation->appendChild($bindingInput); my $soapInputBody = XML::LibXML::Element->new('body'); $soapInputBody->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 1 ); $soapInputBody->setAttribute( 'use', 'literal' ); $bindingInput->appendChild($soapInputBody); my $bindingOutput = XML::LibXML::Element->new('output'); $bindingOperation->appendChild($bindingOutput); my $soapOutputBody = XML::LibXML::Element->new('body'); $soapOutputBody->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 1 ); $soapOutputBody->setAttribute( 'use', 'literal' ); $bindingOutput->appendChild($soapOutputBody); } $root->appendChild($portType); $root->appendChild($binding); my $service = XML::LibXML::Element->new('service'); $service->setAttribute( 'name', $className ); $root->appendChild($service); my $port = XML::LibXML::Element->new('port'); $port->setAttribute( 'name', $className . 'PortSOAP' ); $port->setAttribute( 'binding', 'tns:' . $className . 'SOAP11Binding' ); my $soapAddress = XML::LibXML::Element->new('address'); $soapAddress->setNamespace( 'http://schemas.xmlsoap.org/wsdl/soap/', 'soap', 1 ); $soapAddress->setAttribute( 'location', $address ); $port->appendChild($soapAddress); $service->appendChild($port); $self->schema($schema); return $doc; } sub create_schema { my ( $self, $className ) = @_; my $class = ref $self; my $schema = XML::LibXML::Element->new('schema'); $schema->setAttribute( 'targetNamespace', 'uri:MooseX.SOAP.' . $className ); $schema->setNamespace( 'http://www.w3.org/2001/XMLSchema', undef, 1 ); $schema->setNamespace( 'http://www.w3.org/2001/XMLSchema', 'xs', 0 ); $schema->setNamespace( 'uri:MooseX.SOAP.' . $className, 'tns', 0 ); for my $type ( keys %{$SCHEMA_DATA_OF{$class}} ) { eval "require $type"; $schema->appendChild( $self->create_xsd_type($type) ); } return $schema; } sub create_xsd_type { my $self = shift; my $type = shift; my $name = $type; $name =~ s{::}{\.}xg; my $node = XML::LibXML::Element->new('complexType'); $node->setNamespace( 'http://www.w3.org/2001/XMLSchema', undef, 1 ); $node->setAttribute( 'name', $name ); my $sequence = XML::LibXML::Element->new('sequence'); $node->appendChild($sequence); my $typeMap = $self->typeMap->types(); for my $attribute ( reverse $type->meta()->get_all_attributes() ) { my $attributeNode = XML::LibXML::Element->new('element'); $attributeNode->setAttribute( 'name', $attribute->name ); $attributeNode->setAttribute( 'type', $typeMap->{$attribute->type_constraint} ); $sequence->appendChild($attributeNode); } return $node; } 1; SOAP-WSDL-3.003/t/lib/MySimpleElement.pm0000644000175000017500000000034112375112740014370 0ustar package MySimpleElement; use strict; use warnings; use base qw(SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Builtin::integer); sub get_xmlns { 'urn:Test' } __PACKAGE__->__set_name('MySimpleElement'); 1;SOAP-WSDL-3.003/t/lib/MySimpleType.pm0000644000175000017500000000275312375112740013731 0ustar #!/usr/bin/perl package MySimpleType; use Class::Std::Fast::Storable constructor => 'none'; use SOAP::WSDL::XSD::Typelib::Builtin; use SOAP::WSDL::XSD::Typelib::SimpleType; # restriction base implemented via inheritance # derive by restriction # restriction base use base qw( SOAP::WSDL::XSD::Typelib::SimpleType::restriction SOAP::WSDL::XSD::Typelib::Builtin::string ); # example simpleType derived by list. # XSD would be: # # # package MySimpleListType; use Class::Std::Fast::Storable constructor => 'none'; # restriction base implemented via inheritance use SOAP::WSDL::XSD::Typelib::Builtin; # derive by list # list itemType use base qw( SOAP::WSDL::XSD::Typelib::SimpleType SOAP::WSDL::XSD::Typelib::Builtin::list SOAP::WSDL::XSD::Typelib::Builtin::string ); package MyAtomicSimpleType; use Class::Std::Fast::Storable constructor => 'none'; # restriction base implemented via inheritance use SOAP::WSDL::XSD::Typelib::Builtin; # derive by restriction # restriction with atomic simpleType use base qw( SOAP::WSDL::XSD::Typelib::SimpleType::restriction MySimpleType ); package MyAtomicSimpleListType; use Class::Std::Fast::Storable constructor => 'none'; # restriction base implemented via inheritance use SOAP::WSDL::XSD::Typelib::Builtin; # derive by restriction # restriction with atomic simpleType use base qw( SOAP::WSDL::XSD::Typelib::SimpleType::restriction MySimpleListType ); 1; SOAP-WSDL-3.003/t/lib/MyElement.pm0000644000175000017500000000637512375112740013233 0ustar #!/usr/bin/perl package MyElement; use strict; use SOAP::WSDL::XSD::Typelib::Element; use SOAP::WSDL::XSD::Typelib::Builtin; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'SOAP::WSDL::XSD::Typelib::Builtin::string', ); __PACKAGE__->__set_name('MyElementName'); sub get_xmlns { 'urn:Test' }; package MyComplexTypeElement; use strict; use SOAP::WSDL::XSD::Typelib::Element; use MyComplexType; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'MyComplexType', ); __PACKAGE__->__set_name('MyComplexTypeElement'); sub get_xmlns { 'urn:Test' }; package MyTestElement; use strict; use SOAP::WSDL::XSD::Typelib::Element; use SOAP::WSDL::XSD::Typelib::Builtin::string; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'SOAP::WSDL::XSD::Typelib::Builtin::string', ); __PACKAGE__->__set_name('MyTestElement'); sub get_xmlns { 'urn:Test' }; package MyTestElement2; use strict; use SOAP::WSDL::XSD::Typelib::Element; use SOAP::WSDL::XSD::Typelib::Builtin; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'SOAP::WSDL::XSD::Typelib::Builtin::string', ); __PACKAGE__->__set_name('MyTestElement2'); __PACKAGE__->__set_nillable(1); sub get_xmlns { 'urn:Test' }; package MyAtomicComplexTypeElement; use strict; use SOAP::WSDL::XSD::Typelib::Element; use SOAP::WSDL::XSD::Typelib::ComplexType; use SOAP::WSDL::XSD::Typelib::Builtin; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'SOAP::WSDL::XSD::Typelib::ComplexType', ); my %test_of :ATTR(:get); my %test2_of :ATTR(:get); sub get_xmlns { 'urn:Test' }; __PACKAGE__->_factory( [ qw(test test2) ], { test => \%test_of, test2 => \%test2_of, }, { # this is the 'MyTestElement', test2 => 'MyTestElement2', }, ); __PACKAGE__->__set_name('MyAtomicComplexTypeElement'); package MyTestAttr; use base qw(SOAP::WSDL::XSD::Typelib::Attribute SOAP::WSDL::XSD::Typelib::Builtin::string ); package MyElementAttrs; use strict; use SOAP::WSDL::XSD::Typelib::Element; use SOAP::WSDL::XSD::Typelib::ComplexType; use SOAP::WSDL::XSD::Typelib::Builtin; use base ( 'SOAP::WSDL::XSD::Typelib::Element', 'SOAP::WSDL::XSD::Typelib::ComplexType', ); { my %test_of :ATTR(:get); my %test2_of :ATTR(:get); sub get_xmlns { 'urn:Test' }; __PACKAGE__->_factory( [ qw(test test2) ], { test => \%test_of, test2 => \%test2_of, }, { # this is the 'MyTestElement', test2 => 'MyTestElement2', }, ); } __PACKAGE__->__set_name('MyElementAttrs'); sub __get_attr_class { 'MyElementAttrs::_ATTR' }; package MyElementAttrs::_ATTR; use strict; use SOAP::WSDL::XSD::Typelib::ComplexType; use SOAP::WSDL::XSD::Typelib::Builtin; use base qw( SOAP::WSDL::XSD::Typelib::AttributeSet ); { my %test_of :ATTR(:get); my %test2_of :ATTR(:get); sub get_xmlns { 'urn:Test' }; __PACKAGE__->_factory( [ qw(test test2) ], { test => \%test_of, test2 => \%test2_of, }, { # this is the 'MyTestAttr', test2 => 'MyTestAttr', }, ); } 1; SOAP-WSDL-3.003/t/lib/Mod_Perl2Test.pm0000644000175000017500000000053712375112740013751 0ustar package Mod_Perl2Test; use strict; use warnings; use Class::Std::Fast; sub sayHello { my ($self, $body, $header) = @_; my $name = $body->get_name(); my $givenName = $body->get_givenName(); die "FOO" if ($name eq '__DIE__'); return MyElements::sayHelloResponse->new({ sayHelloResult => "Hello $givenName $name" })} 1;SOAP-WSDL-3.003/Changes0000644000175000017500000012151712507272671011263 0ustar Release notes for SOAP::WSDL 3.003 ------- o. change the base module for SOAP::WSDL::SOAP::HeaderFault to SOAP::WSDL::SOAP::Header instead of inexisting module SOAP::WSDL::Header Release notes for SOAP::WSDL 3.002 o. Declare dependency on Class::Load -- thanks ANDYK o. link to GitHub from META files -- thanks szabgab Release notes for SOAP::WSDL 3.00.00_1 ------- o. fix a hash randomization bug that was causing random failures in t/SOAP/WSDL/05_simpleType-list.t o. 2624a9 for #86142, adding the XML declaration to the output, broke another part of the system, so work around that. I accidentally stopped doing "recursive" tests (tests in subdirs) at some point and missed some of this fun breakage. o. dam@cpan.org's fix for using not using ->usa('UNIVERSAL') to test if something loaded apparently works in a situation where mine doesn't, that was causing tests to fail; use that version instead. Release notes for SOAP::WSDL 3.00.00_1 ------- Scott Walters has assumed co-maint of this module and is ashamed to release 3.00.00_1. Numerous fixes have been made to get tests to pass again on newer perls. Please see the git log at http://github.com/scrottie/SOAP-WSDL for additional detail. o. applied patch from ticket #86142: Missing XML declaration in request https://rt.cpan.org/Public/Bug/Display.html?id=86142 tests still pass, so, good enough, right? o. Huh. Between 5.12 and 5.16 somewhere, the behavior of ClassName->isa('UNIVERSAL') changed. It used to be that that would return true if and only if that namespace existed. Now it always returns true for any random non-existant made up name. Changed this to do ->can() on a known existing method modules with this API have (serialize) instead after floundering around for a bit. exists ${"main::"}{$type.'::'} worked a little bit but made it barf for some reason I didn't investigate. This is the problem apparently behind the previous "haunted house level shit" fixes and reversions. This thing does automatically load these modules on the fly. Would be nice if the unit tests had some comments in them. o. There were two calls to get_port() right next to each other, in the very same ? :, and one of them had a ->[0] tacked on the end and the other one didn't. Well guess what... the one without was returning an arrayref, which caused these failures in the unit tests: Can't call method "get_binding" on unblessed reference at /home/scott/projects/SOAP-WSDL/blib/lib/SOAP/WSDL.pm line 186. o. protip: reverse %hash with '#default' => 'urn:myNamespace', 'tns' => 'urn:myNamespace' results in misery. random hash ordering made a pile of tests in t/003_wsdl_based_serializer.t randomly pass and fail in unison. o. "vectors" (totally not the same thing as a vector in other languages or on a Cray 1) have been deprecated and removed. pretend like they never existed. o. fix two instances of the "Can't modify non-lvalue subroutine call at lib/SOAP/WSDL.pm line 167." error. it looks like the author wrote return $a ? $b : $c = $d Intending it to mean: return $a ? $b : ($c = $d); ... but perl parses it as: return ( $a ? $b : $c) = $d; ... and perl 5.16 is more astute about lvalue errors like that. Release notes for SOAP::WSDL 2.00.10 ------- I'm proud to present a new release of SOAP::WSDL. SOAP::WSDL is a toolkit for creating WSDL-based SOAP client interfaces in perl. Features: * WSDL based SOAP client o SOAP1.1 support o Supports document/literal message style/encoding * Code generator for generating WSDL-based interface classes o Generated code includes usage documentation for the web service interface * Easy-to use API o Automatically encodes perl data structures as message data o Automatically sets HTTP headers right o Datatypes provide hints on method names on calls to non-existant methods * Efficient documentation o SOAP::WSDL::Manual guides you at getting your work done, not at the module's internals * Examples in Perl and Java * Thorough test suite o SOAP::WSDL is heavily regression tested, with a test coverage of over 95% (excluding documentation - you wouldn't want to read through it all). * SOAP::Lite like look and feel o Where possible, SOAP::WSDL mimics SOAP::Lite's API to allow easy migration * XML schema based class library for creating data objects * High-performance SOAP Message parser * Plugin support. SOAP::WSDL can be extended through plugins in various aspects. The following plugins are supported: o Transport plugins via SOAP::WSDL::Factory::Transport o Serializer plugins via SOAP::WSDL::Factory::Serializer o Deserializer plugins via SOAP::WSDL::Factory::Deserializer The following changes have been made: 2.00.10 - May 15 2009 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/). * #44546: XML Schema types with names cuase errors when including anonymous types SOAP::WSDL now handles element names with "." correctly * #45037 ComplexTypes' elements in different namespaces not serialized correctly SOAP::WSDL now serializes elements in different namespaces correctly * #43769 Fault11 serialization issue when passed Element for detail The detail fault element is now automatically wrapped into an appropriate detail object and serialized correctly. Note that passing a list as details content is not supported yet. * #43674 Fault not caught/propagated in SOAP::WSDL::Client::call Deserializer faults in SOAP::WSDL::Client now propagate correctly to the caller. The following uncategorized improvements have been made: * improved Java example: Commented test class * improved documentation: Added Cookbook entry for HTTP Negotiate Authentication (Kerberos). 2.00.09 - Feb 22 2009 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/). * [ 2631555 ] Template used without version * [ 2631220 ] Faults generated with soap:Server actor 2.00.08 - Feb 22 2009 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/). * [2628386] SOAP::WSDL::Generator::Visitor::Typelib still used in tests * #41453: Content-Type 'charset=...' not set in HTTP header Already fixed in 2.00.07 2.00.07 - Feb 21 2009 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 2621474 ] Add Non-Perl examples / test client / Servers The distribution now includes a Java / Apache CXF example. * [ 2585274 ] Create a HTTP::Server::Simple based SOAP Server SOAP::WSDL now ships with a server class to use with HTTP::Server::Simple for testing purposes. See SOAP::WSDL::Server::Simple for details. * [ 1911232 ] Allow skipping unknown XML elements See SOAP::WSDL::Manual::Cookbook on how to use this feature * [ 2505421 ] include XML attributes in as_hash_ref ComplexTypes now include XML attributes in as_hash_ref's result under the special key "xmlattr". As a side effect, as_hash ref now works for ComplexType objects with a simpleContent content model, too (though the results may be misleading: Their value is included under the hash key "value", the only other possible hash key is "xmlattr"). * [ 1960062 ] Use POSIX::strftime for date conversion Not really a feature, but a little speedup. The Feature request is obsoleted by resorting to good old sprintf for date formatting. Speeds up set_value in date and dateTime Objects by around 30% for non- XML-formatted strings. As a side effect, dateTime now does not allow setting 0 as date. 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/). * [ 2621471 ] SOAP::WSDL::Server sends fault with invalid namespace prefix Faults now use the correct prefix. * [ 2560208 ] elementFormDefault always "qualified" SOAP::WSDL now respects the elementFormDefault attribute in embedded XML Schemas. * #42049: [PATCH] SOAP::WSDL uses default User-Agent SOAP::WSDL now announces itself as "SOAP::WSDL $VERSION" instead of "libwww/perl $VERSION" in HTTP requests. Note however, that this only applies for wsdl2perl, SOAP::WSDL and SOAP::WSDL::Transport::HTTP. SOAP::Transport HTTP (from the SOAP-Lite distribution) is not affected. * [ 2533903 ] Imported schema overwrites existing XML namespace/prefix map Importing a schema which defined the same XML namespace prefix as the importing schema, but with a different URI resulted in having the URI of the associated with the prefix from the imported schema set in the importing schema. * #42388 [PATCH] Disabling 'die' in Typemaps Duplicate of [1911232] Allow skipping unknown XML elements - see added features. * #42179 Problem deserializing SOAP messages that contain only a simpleType Now the top-level element may consist of a simpleType only, too. The following uncategorized improvements have been made: * Fixed a =back error in element POD generation * Improved test suite * Improved documentation * Improved TEST_COVERAGE to report coverage correctly 2.00.06 - Dec 03 2008 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/). * #40658 wsdl2perl - prefix option The prefix option is now changed to behave more practical * #40802 wsdl2perl problems with special url The "fixed" attribute caused an error. * #40650 Deserialization on inherited types The inherited complexType variety (sequence/all/choice...) did not get propagated to derived complexTypes. Thus, derived complexTypes which did not add elements lost all inherited elements. * #40108 Test failure on Cygwin Fixes a test failure on Cygwin due to a malformed file:// URL * #40021 charset: utf-8 Removed duplicate charset in HTTP requests issued by SOAP::WSDL::Transport::HTTP. Replaced the utf8 by utf-8 in HTTP requests * #39715 Error with complexType extension base without child elements A rather subtle error caused by a wrong init value (undef) for the list of child elements in a complexType sequence. * [ 2005693 ] causes error * [ 2023797 ] type extensions not handled correctly ComplexType objects now test their elements with ->isa, not with ref * [ 2021755 ] Generating nested complexType extensions throws errors 2.00.05 - Jul 13 2008 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/). * [ 2014482 ] Big-O memory hole when parsing WSDL SOAP::WSDL still leaks memory when using SOAP::Lite's transport backend This is to be fixed in 0.710.08 in SOAP::Lite * #36865 wsdl2perl.pl fails on Expat error Resolved by dropping a note for Solaris in README * [ 2005693 ] causes error The >fixed< attribute is now recognized (but has no effect yet) The following uncategorized improvements have been made: * added missing Class::Std::Storable::Fast import flags to SOAP::WSDL::XSD::Typelib::Builtin::IDREFS * some code cleanup 2.00.04 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/). * [ 1972059 ] Can't set timeout via SOAP::WSDL * [ 1961409 ] Error with unqualified references in imported schema * #35873: SOAP::WSDL -- Can't locate object method "set_Action" via package "SOAP::WSDL::OpMessage" * [ 1969427 ] Mod_Perl.t broken when mod_perl is unavailable * #35610 Test fails when Test::Without::Module is installed The following uncategorized improvements have been made: * Changed the environment variable for author tests to "RELEASE_TESTING", as defined by the Oslo QA Hackathon 2008 (see http://perl-qa.hexten.net/wiki/index.php/Oslo_QA_Hackathon_2008_:Achievements) * Enhanced documentation * Fixed a wrong error message * Cleaned up test suite (removed duplicate tests) 2.00.03 - May 18 2008 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/). * [ 1966575 ] 2.00.02 produced bad code with complexType extensions 2.00.02 - May 16 2008 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1941134 ] Server for mod_perl2. Thanks to Noah Robin for contributing. (I actually forgot to include it in 2.00.01) 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/). * [ 1963613 ] ComplexTypes die on ->can('FOOBAR'); * [ 1943667 ] Error parsing complexType/extension * [ 1960650 ] multi-level inheritance of complexTypes fails * [ 1960319 ] ComplexType as_hash_ref returns objects on maximum depth * [ 1943673 ] Relative schemaLocation="" URLs not resolved in * [ 1953598 ] Cannot set server and attribute prefixes with wsdl2perl * [ 1941080 ] 017_generator.t (test 2) fails with Template-Toolkit 2.15 * [ 1949209 ] spelling/grammar in Mod_Perl2.pm * [ 1950670 ] on_action removed in SOAP::WSDL >= 2.00 * #35346 element ref="" not handled properly The following uncategorized improvements have been made: 2.00.01 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1941134 ] Server for mod_perl2. Thanks to Noah Robin for contributing. 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/). * [ 1944368 ] SOAP/WSDL/XSD/Typelib/SimpleType.pm spelling * [ 1944367 ] SOAP/WSDL/XSD/Typelib/ComplexType.pm spelling * [ 1944364 ] SOAP/WSDL/XSD/Typelib/Builtin.pm spelling * [ 1944362 ] SOAP/WSDL/SOAP/Typelib/Fault11.pm spelling * [ 1944361 ] SOAP/WSDL/Generator/Visitor.pm spelling * [ 1944360 ] SOAP/WSDL/Generator/Iterator/WSDL11.pm spelling * [ 1944359 ] SOAP::WSDL::Factory::Transport spelling * [ 1944355 ] SOAP::WSDL::Deserializer::XSD.pm spelling Thanks to "nobody" for correcting these errors. * [ 1942576 ] SOAP/WSDL/Deserializer/SOM.pm spelling. * [ 1942568 ] SOAP/WSDL/Client.pm minor spelling/grammar/style cleanup. * [ 1942562 ] WSDL.pm spelling corrections. Thanks to Noah Robin for providing patches for these errors. * #34642 booleans in WSDL attributes don't get converted to perl's representation (for now - not all attributes covered yet) * #34714: MessageParser misses character data in elements just below SOAP-ENV:Body * #34688: wsdl2perl.pl croaks when WSDL operation uses a header The following uncategorized improvements have been made: * Storable freeze/thaw speedup in conjunction with upcoming version of Class::Std::Fast * improved server doc generation * improved xsi:nil handling * serializing an attribute from http://www.w3.org/XML/1998/namespace now serializes it with xml: prefix. This should probably be moved into the generator, to avoid testing every attribute 2.00_33 - Mar 30 2008 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1925336 ] Create a Prefix Resolver Plugin Interface for Code Generator * [ 1898591 ] object stringify returns undef * [ 1906753 ] Hypens in MyTypes/* cause runtime syntax errors Hypens and dots in variable and method names are now replaced by _ 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/). * #33616: Bugs in the META.yml file * [ 1892895 ] Test failures on RHEL4 * [ 1844956 ] t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS fails test on OS X * #33376: HTTP Authentication (not implemented or not documented) The following uncategorized improvements have been made: * Some minor performance improvements have been made * The XSD generator now asserts the soap:operation style is "document" * and now import namespace declarations, too * The XSD generator now uses the relevant 's targetNamespace for finding operation messages, not the element's targetNamespace * Attribute handling has been improved so it could possibly work. Attributes from different namespaces are probably still broken. * Attribute ref handling has been added (though probably broken on ref cascades). * elements are now parsed, but have no effect yet. * elements are now parsed, but have no effect yet. 2.00_32 - Feb 14 2008 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): 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/). * [ 1893147 ] Segfault on 2.0.0_31 The following uncategorized improvements have been made: * changed SOAP::WSDL::XSD::ComplexType's set_/get_flavor methods to set_/get_variety to reflect the XML standard more closely. get_flavor is retained for compatibility reasons. * added initial support for complexType/simpleContent definitions. Right now, only restriction derivations are supported. * fixed an error in the generator_test.wsdl 2.00_31 - Feb 11 2007 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1883843 ] Support wsdl:import * [ 1883863 ] Support xsd:import 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/). The following uncategorized improvements have been made: * The WSDL Parser now warns about unsupported WSDL / XML schema elements * Fixed path handling in t/006_client.t * Removed useless ms regex flag in SOAP::WSDL::Factory::Transport * The test suite has been improved 2.00_30 - unreleased The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1875288 ] Support XML attributes (partial) 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/). * [ 1876435 ] Test on perl-5.10 fails * #32611 empty complexType structure classes are missing 'use Class::Std::Fast::Storable' The following uncategorized improvements have been made: * ComplexType objects now accept { foo => undef } in constructor and handle it as non-present child element foo. * Updated test suite * Updated SOAP::WSDL::Client::Base to correctly handle SOAP calls with no parameters (empty parts) * Test on perl-5.10 fails when SOAP::Lite is not installed 2.00_29 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/). * #32188: minor bug found and fixed in WSDL generation * [ 1871175 ] Can't delete attributes from ComplexType objects The following uncategorized improvements have been made: * Updated SOAP::WSDL::Manual::XSD * Removed pod directives from templates to avoid confusing CPAN's pod viewer * Initial (incomplete) XML attribute support * Updated test suite 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 tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1850793 ] Add a to_hash_ref method * [ 1844427 ] Support multiple parts in body 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/). * [ 1850795 ] attributes referencing types in default namespace throw * [ 1844458 ] Add warning when generating Interface with multiple parts * [ 1843841 ] Grammar/typos in Manual.pod * [ 1843799 ] ./Build test fails due to testcount mismatch not IO::Scalar * [ 1845077 ] Top level simpleType elements don't serialize correctly The following uncategorized improvements have been made: * Fixed serializing complexType elements with no elements to empty element * Enhanced test suite * Documentation improvements 2.00_26 The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): 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/). * [ 1843195 ] t/013_complexType.t still requires Class::Std::Storable * [ 1843590 ] Tests broken on Cygwin The following uncategorized improvements have been made: * Added examples * Added Content-length header to CGI output 2.00_25 --- WARNING: INCOMPATIBLE CHANGE: SOAP::WSDL now uses Class::Std::Fast. Read the MIGRATING guide for upgrading from previous versions. You probably need to re-generate all your interfaces. WARNING: INCOMPATIBLE CHANGE: SOAP::WSDL::XSD::Typelib::anySimpleType based objects no longer serialize to their XML value on stringification. This means that strings are no longer XML-escaped when the simpleType containing the string is printed or used like this: my $value = "$simpleType"; Note that ComplexType objects still serialize to their XML on stringification. This Change is due to the demands of applications embedding SOAP::WSDL::XSD::Typelib objects in templates - it would mean a nasty ->get_value for every (simple) value. The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1837347 ] Use Class::Std::Fast Class::Std::Fast allows optimizations which almost double SOAP::WSDL's performance and reduce code size. Class::Std::Fast also opens the door for even faster XS implementations. * [ 1842436 ] Add SOAP Server 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/). * [ 1842418 ] Message parser eats up whitespaces between entities * [ 1839820 ] encoding parameter of Content-Type header set incorrectly * [ 1839851 ] token in UPPERCASE in default typemap * [ 1839690 ] Can't use two prefixes for namespace in WSDL * [ 1839833 ] incorrect encoding/decoding of double-quote The following uncategorized improvements have been made: * Errors in typemap generation have been fixed * XML parser speedups * The test suite has been improved 2.00_24 --- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1832998 ] Make interface methods complain when called as class method * [ 1826833 ] listify all XSD type objects when called as @{} 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/). * #30685: Error in MessageParser when using __SKIP__ in typemap * [ 1831398 ] Badd class names for atomic typed elements * [ 1828240 ] POD Defects * [ 1792348 ] 006_client.t requires SOAP::Lite (again) The following uncategorized improvements have been made: * The test suite has been improved * Documentation has been improved 2.00_23 --- 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): * [ 1826382 ] nillable elements not serialized as xsi:nil * [ 1826337 ] Second element in complexType gets eaten up * [ 1792348 ] 006_client.t requires SOAP::Lite (again) The following uncategorized improvements have been made: * Test for complexType containing element with atomic simpleType added 2.00_22 ---- 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): * [ 1817697 ] Dots in service/port names lead to broken interfaces * [ 1817699 ] Templates not found on all OS The following uncategorized improvements have been made: * Code cleanup. The XSD library has been cleaned up a bit. Should result in a minor speedup in serializing and deserializing XML messages, 2.00_21 - not released ---- 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): * [ 1810058 ] .tt's pod indexed on CPAN (again) * [ 1809284 ] Rename SOAP::WSDL::Deserializer::SOAP11 to ::XSD The following uncategorized improvements have been made: * Requires at least perl 5.8.0. This is due to a bug in perls before - see http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/929746 2.00_20 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1815646 ] Only include last part of port name in interface * [ 1815648 ] Methods with empty body cannot be called as ->method() * [ 1815651 ] Empty complexType definitions not supported 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): * [ 1815643 ] ComplexTypes cannot be freezed/thawed The following uncategorized improvements have been made: * WSDL definitions are decoded into utf8 * fixed tests to use correct path on windows 2.00_19 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1810395 ] Implement complexType complexContent extension 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): * [ 1813144 ] Typemap not used in interface class * [ 1810058 ] .tt's pod indexed on CPAN The following uncategorized improvements have been made: * Documentation improvements 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 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): 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): * [ 1772617 ] SOAP Header not working Added header support. Currently, SOAP headers are only supported with the SOM or the XSD (SOAP11) serializer. * [ 1805238 ] Tests in t/SOAP/WSDL don't work when run from t/ * [ 1805241 ] explain() broken in SOAP::WSDL explain has been removed from SOAP::WSDL The following uncategorized improvements have been made: * Added limited support for complexType complexContent content model with restriction variety. SOAP::WSDL now supports this XML Schema definition variant, although no constraints are imposed on derived types yet. Derived types do not serialize with a xsi:type attribute (and the xsi:type attribute is not recognized by the XML parser), so you cannot use derived types as a substitute for theri parent, yet. * Added support for complexType choice variety complexType definitions using the choice variety are now supported, even though the content is not checked (if you pass in invalid data, invalid XML will be generated). * Added Loopback Transport backend. SOAP::WSDL::Tranport::Loopback just returns the request as respons, but allows testing the whole chain from user interface to transport backend. * Fixed SOAP::WSDL::Factory::Transport prefer user-registered transport backend * Fixed set_soap_version method in SOAP::WSDL::Client. Re-setting the SOAP version now invalidates (resets) serializer and deserializer, but not the transport backend. * Fixed SOAP::WSDL::XSD::Typelib::Builtin::boolean to return false when false and true when true. * SOAP::WSDL::XSD::Typelib::Builtin::normalizedString now replaces all occurences of tab, newline and carriage return by whitespce on set_value. * Code cleanup o Lots of orphan methods now replaced by the SOAP::WSDL::Generator hierarchy have been removed. o Unused (and unusable) readable option checking has been removed in SOAP::WSDL::Serializer::SOAP11. o Unused XML Schema facet attributes have been removed from XSD Builtin classes o Methods common to all expat parser classes have been factored out into a common base class. * XML serialization speedup for SOAP::WSDL::XSD::* objects * Tests added to improve test coverage. * A few documentation errors have been fixed * Misspelled default Typemap and Interface prefixes have been corrected 2.00_16 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1761532 ] Support embedded atomic types SOAP::WSDL now supports a greater variety of XML Schema type definitions. Note that XML Schema support is still incomplete, though. * [ 1797943 ] Create Perl Hash Deserializer There's a new deserializer which outputs perl hashes as data structures. Much like XML::Simple, but faster. No XML Attribute support, though. * [ 1797678 ] Move Code generator from WSDL::Definitions to separate class * [ 1803330 ] Create one interface per port SOAP::WSDL now creates one interface per port, not one per service. 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): * [ 1804441 ] parts from binding not regarded in SOAP::WSDL SOAP::WSDL (interpreter mode) now respects the body parts specified in the binding. * [ 1803763 ] nonNegativeInteger misspelled in Schema::Builtin * [ 1793965 ] _expand() does not work on non-root-node ns declarations * [ 1792348 ] 006_client.t requires SOAP::Lite in 2.00_15 SOAP::WSDL no longer attempts to load SOAP::WSDL::Deserializer::SOM when no_dispatch is set. 006_client.t now sets outputxml(1), to be really sure. The following uncategorized improvements have been made: * Code generator only generates interface for the first port in a service The code generator now generates interfaces for all ports. Note: The naming scheme has changed. It is now InterfacePrefix::Service::Port * XML Parser speedup The XML parser has received a little speedup. * A number of errors in parsing / traversing WSDL documents have been corrected. * Documentation has been improved * A number of (incorrect, but passing) tests have been fixed. * Code cleanup: The SOAP::WSDL::SAX* modules are no longer included, as they are not supported any more. They can still be found in SOAP::WSDL's subversion repository in the attic directory, though. 2.00_15 ---- 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): * [ 1792321 ] 2.00_14 requires SOAP::Lite for passing tests 2.00_14 ---- 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): * [ 1792235 ] SOAP::WSDL::Transport::Test missing from 2.00_13 The package has been re-added * [ 1792221 ] class_resolver not set from ::Client in 2.00_13 Changed to set class_resolver correctly. The following uncategorized improvements have been made: * The ::SOM deserializer has been simplified to be just a subclass of SOAP::Deserializer from SOAP::Lite * Factories now emit more useful error messages when no class is registered for the protocol/soap_version requested * Documentation has been improved - refined ::Factory:: modules' documentation * Several tests have been added * XSD classes have been improved for testability 2.00_13 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [ 1790619 ] Test transport backend A test transport backend has been implemented (SOAP::WSDL::Transport::Test). It returns the contents from a file and discards the response. The filename is determined from the soap_action field. * [ 1785196 ] Replace outputsom(1) by deserializer plugin outputsom(1) in SOAP::WSDL is now implemented via using the deserializer plugin SOAP::WSDL::Deserializer::SOM. * [1785195] Support deserializer plugins Deserializer plugin API added via SOAP::WSDL::Factory::Deserializer. 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): * [1789581] Support ComplexType mixed WSDL parser now supports using the mixed="true" attribute in complexType definitions. Mixed content in messages is only supported via SOAP::SOM yet. * [1787975] 016_client_object.t fails due to testing XML as string Removed string test. * [1787959] Test wsdl seems to be broken Corrected typo. * [1787955] ::XSD::Typelib::date is broken SOAP::WSDL::XSD::Typelib::Builtin::date now converts time-zoned dates properly, and adds the local time zone if none is given. * [1785646] SOAPAction header not set from soap:operation soapAction SOAP::WSDL now sets the SOAPAction header correctly. The following uncategorized improvements have been made: * Documentation improvements 2.00_12 ---- 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): * [1787146] SOAP::WSDL still uses XML::LibXML The superficious usage of XML::LibXML has been removed. XML::LibXML with sax filter has been replaced by SOAP::WSDL::Expat::WSDLParser. * [1787054] Test suite requires XML::LibXML in 2.00_11 The test suite no longer requires XML::LibXML to pass. * [1785678] SOAP envelope not checked for namespace The SOAP envelope is now checked for the correct namespace. * [1786644] SOAP::WSDL::Manual - doc error Documentation improvements The following uncategorized improvements have been made * The SOAPAction header is now alway quoted (R1109 in WS-I BP 1.0). 2.00_11 ---- The following features were added (the numbers in square brackets are the tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): * [1767963] Transport plugins via SOAP::WSDL::Factory::Transport. SOAP::WSDL uses SOAP::Lite's tranport modules as default, with a lightweight HTTP(S) transport plugin as fallback. Custom transport modules can be registered via SOAP::WSDL::Factory::Transport. * [ 1772730 ] Serializer plugins via SOAP::WSDL::Factory::Serializer The default serializer for SOAP1.1 is SOAP::WSDL::Serializer::SOAP11. Custom serializers classes can be registered via SOAP::WSDL::Factory::Serializer or set via SOAP::WSDL's set_serializer method. 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): * [ 1764854 ] Port WSDL parser to expat and remove XML::LibXML dependency SOAP::WSDL now requires only XML::Parser to be installed. XML::LibXML is not required any more, though XML::LibXML based modules still exist. The following uncategorized improvements have been made * The number of dependencies has been reduced. SOAP::WSDL no longer requires the following modules to be installed: - XML::SAX::Base - XML::SAX::ParserFactory - Pod::Simple::Text - XML::LibXML * The missing prerequisite Template has been added. * Documentation has been improved: - WS-I Compliance document added. 2.00_10 ---- * Changed Makefile.PL to use Module::Build (passthrough mode) * fixed element ref="" handling 2.00_09 ---- * SOAP::WSDL::XSD::Typelib::Builtin::boolean objects now return their numerical value in bool context, not "true" or "false" (always true...) * date/time test are now timezone-sensitive * examples added 2.00_08 --- * SOAP::WSDL::XSD::Typelib::ComplexType objects now check the class of their child objects. This provides early feedback to developers. * SOAP message parser can skip unwanted parts of the message to improve parsing speed - see SOAP::WSDL::Expat::MessageParser for details. * HTTP Content-Type is configurable * SOAP::WSDL::XSD::Typelib::ComplexType based objects accept any combination of hash refs, list refs and objects as parameter to set_value() and new(). * SOAP::WSDL::XSD::Typelib::Builtin::dateTime and ::date convert date strings into XML date strings * SOAP::WSDL::Definitions::create now - converts '.' in service names to '::' (.NET class separator to perl class separator) - outputs Typemaps and Interface classes in UTF8 to allow proper inclusion of UTF8 documentation from WSDL * SOAP::WSDL::Definitions::create() includes doc in generated interface classes * WSDLHandler now handles tags * fixed explain in SimpleType, ComplexType and Element 2.00_07 and below --- * Implemented a Code generator for creating SOAP interfaces based on WSDL definitions * Implemented a high-speed stream based SOAP message parser SOAP message parser returns a objects based on XML schema based class library * Implemented a XML schema based class library * Implemented a stream based WSDL parser. Parses WSDL into objects. Objects can serialize data, and explain how to use the service(s) they make up (output documentation). SOAP-WSDL-3.003/test_html.pl0000644000175000017500000000122312375112741012311 0ustar # perl usage: use lib 't/lib'; use TAP::Harness; use TAP::Formatter::HTML; my $fmt = TAP::Formatter::HTML->new({ verbosity => -2, }); use File::Find::Rule; my @tests = sort { $a cmp $b } File::Find::Rule->file() ->name( '*.t' ) ->in( 't/' ); local $ENV{TEST_VERBOSE} = 1; my $harness = TAP::Harness->new( { formatter => $fmt , merge => 1, # verbosity => 1, lib => [ 't/lib', 'lib' ], switches => ($ARGV[0] eq '--cover') ? [ '-MDevel::Cover=-ignore,.,-select,^lib/.+,-coverage,statement,subroutine,condition,branch' ] : [], }); $harness->runtests( @tests ); SOAP-WSDL-3.003/TODO0000644000175000017500000000057712375112740010453 0ustar TODO list for SOAP::WSDL 2.1 release -------- * Support namespaces in SOAP message payload [ 1809057 ] * Support the xsi:type attribute on derived types on the wire [ 1809059 ] * SOAP1.2 support [ 1803331 ] 2.2 release -------- * XML schema support ("minimal conformant") [ 1764845 ] * Support SOAP attachments 3.0 release -------- We're not thinking that far ahead right now. SOAP-WSDL-3.003/MIGRATING0000644000175000017500000000500712375112740011220 0ustar MIGRATING --------- MIGRATING FROM PRE-2.00_33 -------------------------- The handling of stringification of SOAP::WSDL::XSD simpleType objects with undef values changed in 2.00_33. While 2.00_32 and before returned undef on stringification of a undef value, >=2.00_33 now returns an empty string. This is due to common usage in templates or the like, where undef is likely to produce a warning, and the unreliable behavior of $obj eq undef which behaves differently in different versions of perl. MIGRATING FROM PRE-2.00_29 -------------------------- SOAP::WSDL 2.00_29 added experimental XML attribute support. The attribute support changed the code of the generated classes, which may now require the class SOAP::WSDL::XSD::Typelib::Attribute introduced in the same pre-release. While interfaces generated with pre-releases back to 2.00_25 work without change, this does not hold true vice versa: Interfaces generated with 2.00_29 and above won't work with older pre-releases. You'll have to update SOAP::WSDL on all your machines. MIGRATING FROM PRE-2.00_24 -------------------------- This section describes how to migrate from 2.00_24 and before versions to 2.00_25. Migrating from 2.00_xx ---------------------- Background SOAP::WSDL 2.00_xx has used Class::Std as base for its inside out objects up to 2.00_24. For performance reasons, now Class::Std::Fast is used. As Class::Std::Fast is a drop-in replacement for Class::Std, there should be no need to change anything in your (handwritten) code. Generated interfaces SOAP::WSDL's internal structure has changed, and this change needs to be reflected in all generated classes. This means you have to re-generate your interfaces (in case you use generated interfaces) Typemaps SOAP::WSDL now tries to load all typemap classes at once from 2.00_25 on. If you use __SKIP__ in your typemaps, you'll have to comment out all paths deeper than the path marked with __SKIP__ - if you don't, SOAP::WSDL will try to load all correspondent classes. Migrating from 1.xx ------------------- Background SOAP::WSDL uses a custom WSDL parser and serializer. It does not rely on XPath for on the fly WSDL processing, nor does it use SOAP::Data objects for encoding any more. You should be able to use your existing code under most circumstances. SOAP::WSDL is the compatibility module for old interfaces. Overloading Message overloading (as introduced in 1.23) is not supported any more. Message overloading is prohibited by the WS-I basic profile, therefore SOAP::WSDL does not implement it any more.SOAP-WSDL-3.003/LICENSE0000644000175000017500000001504612375112740010765 0ustar SOAP::WSDL is dual licensed under the same terms as Perl itself. This means at your choice, either the Perl Artistic License, or the GNU GPL version 1 or - at your choice - any higher version. The GNU GPL can be obtained from http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt Newer versions can be found at http://www.gnu.org/licenses/gpl.html The Artistic License can be obtained from http://dev.perl.org/licenses/artistic.html and is included below. ARTISTIC LICENSE ================ The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End SOAP-WSDL-3.003/HACKING0000644000175000017500000001142512375112740010744 0ustar HACKING ======= Development of SOAP::WSDL takes place on sourceforge.net. There's a svn repository available at https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl Engagement in the further development of this module is highly encouraged - many people have already contributed, and many more probably will. I'm sometimes a bit slow in answering e-mails or merging in changes - so if you feel your changes are urgent, please set up a sourceforge account and ask me for commit permissions on the repository - I will happily accept you as co-author. TODO shows the current roadmap. SOAP-WSDL CODING GUIDELINES =========================== DESIGN PRINCIPLES ----------------- SOAP-WSDL is designed for the following principles: 1. SPEED A SOAP toolkit is useless, if it's not fast enough. Therefore SOAP::WSDL aims at always being fast enough. Please benchmark any contributions - if they slow down SOAP-WSDL (especially the XML parsing part), you should have good reasons. 2. USABILITY SOAP-WSDL is designed user-friendly. It tells the user whether it's capable of handling some WSDL or not, it gives friendly error messages, and if a user happens to call a non-existant method on XSD objects, they croak with a list of available methods to ease development. 3. EXTENSIBILITY If you plan an extension, look if the extension itself should be extensible, and which extension points to use. Creating new extension points is highly appreciated. 4. MAINTAINABILITY SOAP::Lite unfortunately shows where a toolkit can go without focus on maintainability. SOAP::WSDL tries to be highly maintainable and easy to understand. CODING STYLE ------------ The principles above dictate a clear, but not too lengthy coding style. SOAP::WSDL's coding style in principle follows Perl Best Practices by Damian Conway, but allows deviances for speed reasons The following guidelines apply: - Testing * SOAP::WSDL has a test coverage of >95% and aims at 100%. Please write a test first. * Use author tests for testing guidelines. Disable author tests for users - it's time consuming and of no use to have users run author tests. - Indentation and formatting * indent with spaces. * indent 4 characters per level * use \n (LF) for newlines, not CRLF * use blank lines to separate paragraphs * Coding style is similar to K&R (opening brace on last line, closing brace on new line. No cuddled else) * No trailing spaces allowed (except to indicate a blank line in a POD source block) - Flow control * postfix if is allowed for single statements only. Preferably for flow control only. * postfix for, while, until are not allowed. * unless is not allowed at all. Use if not. * goto is only allowed for jumping into subs. Nothing else. * redo, next, last etc. are preferred over goto. - Strictness and Warnings * always use strict and warnings. Switch off for the smallest block possible, but switch of if there's a reason (don't let tools like perlcritic fool you: no strict qw(refs); is often required. - Naming * variable names are lower case with _ separating words, except when a XML Schema, SOAP, or WSDL name is name-giving (don't force portType to become port_type) * hashes should be named FOO_of, lists FOO_from, references FOO_ref. * package names are CamelCase, except when a XML, SOAP or WSDL name is name-giving (don't force 'int' to become 'Int'. However, simpleType becomes SimpleType). - Subroutines * Subroutines shouldn't be more than around 50 lines long * @_ should be unpacked. Deviances are allowed for speed reasons. If you're not unpacking @_ in a sub of say, 5 lines or more, please comment what you're doing. * Always return. Always return. A single "return" allows perl to execute the subroutine in question in void context, which saves it from putting it's result in a temporary variable. Always return. - POD and comments * Comment extensively. Comments are the maintainer (and core developer's) documentation - aid them where possible (your're probably doing yourself a favor by adding extensive comments). * Comment either in blocks or as hanging side comments (especially when commenting @_ access). Example: sub baz { # @_ not unpacked for speed reasons. Read: # my ($self, $something, %args_of) = @_; $_[0]->bar($_[1]); # read as $self->bar($something); $_[0]->foo($_[2..$#]); # read as $self->foo(%args_of); return; } * POD is located at end of file, preferably after __END__ * Complete POD coverage is essential. However, if the package in question is used internally only, it's better to omit the POD completely - too many PODs to look at confuse the average CPAN user. July - November 2007, Martin KutterSOAP-WSDL-3.003/TEST_COVERAGE0000644000175000017500000000163012375112740011727 0ustar # Unfortunately, Build testcover reports test coverage wrong. # # To get a complete coverage report, just run this file as a shell script # on a linux box (or execute the equivalent commands on another OS): # # Note that this shell script requires Devel::CoverX::Covered - if you # don't have it, comment out the line noted below # perl Build.PL && perl Build && \ perl -MTAP::Harness -MFile::Find::Rule -e ' local $ENV{TEST_VERBOSE} = 1; TAP::Harness->new({ merge => 1, lib => [ q{t/lib}, q{blib/lib} ], switches => [ q{-MDevel::Cover=-ignore,.,-select,^blib/lib/.+,-coverage,statement,-coverage,subroutine,-coverage,condition,-coverage,branch} ], })->runtests( sort { $a cmp $b } File::Find::Rule->file()->name( q{*.t} )->in( q{t/} ) ); ' # Devel::CoverX::Covered # covered runs cover # cover -coverage="statement" -coverage=condition -coverage=subroutine -coverage="branch" SOAP-WSDL-3.003/bin/0000755000175000017500000000000012507276245010532 5ustar SOAP-WSDL-3.003/bin/wsdl2perl.pl0000644000175000017500000002012512375112740012775 0ustar #!/usr/bin/perl -w use strict; use warnings; use Pod::Usage; use Getopt::Long; use LWP::UserAgent; use SOAP::WSDL::Expat::WSDLParser; use SOAP::WSDL::Factory::Generator; use Term::ReadKey; my %opt = ( url => '', prefix => 'My', attribute_prefix => undef, type_prefix => undef, element_prefix => undef, typemap_prefix => undef, interface_prefix => undef, server_prefix => undef, base_path => 'lib/', proxy => undef, generator => 'XSD', server => 0, namespace => 0, ); { # a block just to scope "no warnings" no warnings qw(redefine); *LWP::UserAgent::get_basic_credentials = sub { my ($user, $password); # remove user from option if called, to force prompting for a user # name the next time print "URL requires authorization.\n"; if (not $user = delete $opt{user}) { print 'User name:'; ReadMode 1; $user = ReadLine(); ReadMode 0; chomp $user; }; if (not $password = delete $opt{password}) { print 'Password:'; ReadMode 2; $password = ReadLine; ReadMode 0; chomp $password; }; return ($user, $password); }; } GetOptions(\%opt, qw( prefix|p=s attribute_prefix|a=s type_prefix|t=s element_prefix|e=s typemap_prefix|m=s interface_prefix|i=s server_prefix|sp=s base_path|b=s typemap_include|mi=s help|h proxy|x=s keep_alive user=s password=s generator=s server|s namespaces|n ) ); my $url = $ARGV[0]; pod2usage( -exit => 1 , verbose => 2 ) if ($opt{help}); pod2usage( -exit => 1 , verbose => 1 ) if not ($url); local $ENV{HTTP_PROXY} = $opt{proxy} if $opt{proxy}; local $ENV{HTTPS_PROXY} = $opt{proxy} if $opt{proxy}; my $lwp = LWP::UserAgent->new( $opt{keep_alive} ? ( keep_alive => 1 ) : () ); $lwp->env_proxy(); # get proxy from environment. Works for both http & https. $lwp->agent(qq[SOAP::WSDL $SOAP::WSDL::Expat::WSDLParser::VERSION]); my $parser = SOAP::WSDL::Expat::WSDLParser->new({ user_agent => $lwp, }); # resolve the default prefix options map { my $opt_key = $_; if ( $opt_key =~ / (\w+) _prefix $/xms # relevant option && !$opt{ $opt_key } # that hasn't already been explicitly set ) { my $prefix_type = $1; $opt{ $opt_key } = $opt{prefix} . # My ucfirst( $prefix_type ) . # Typemap ( $prefix_type eq 'server' ? '' : 's' ); # s } } keys %opt; my $definitions = $parser->parse_uri( $url ); my %typemap = (); if ($opt{typemap_include}) { die "$opt{typemap_include} not found " if not -f $opt{typemap_include}; %typemap = do $opt{typemap_include}; } my $generator = SOAP::WSDL::Factory::Generator->get_generator({ type => $opt{'generator'} }); if (%typemap) { if ($generator->can('set_typemap')) { $generator->set_typemap( \%typemap ); } else { warn "Typemap snippet given, but generator does not support it\n"; } }; $generator->set_attribute_prefix( $opt{ attribute_prefix }) if $generator->can('set_attribute_prefix'); $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_server_prefix($opt{ server_prefix }) if $generator->can('set_server_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... $generator->generate(); $generator->generate_interface() if ! $opt{server}; $generator->generate_server() if $opt{server}; __END__ =pod =head1 NAME wsdl2perl.pl - create perl bindings for SOAP webservices. =head1 SYNOPSIS wsdl2perl.pl -t TYPE_PREFIX -e ELEMENT_PREFIX -m TYPEMAP_PREFIX \ -i INTERFACE_PREFIX -b BASE_DIR URL =head1 OPTIONS NAME SHORT DESCRITPION ---------------------------------------------------------------------------- prefix p Prefix for all generated classes. If you set "-p=Foo", you will get "FooAttributes", "FooTypes", "FooElements" and so on. attribute_prefix a Prefix for XML attribute classes. Default: MyAttributes type_prefix t Prefix for type classes. Default: MyTypes element_prefix e Prefix for element classes. Default: MyElements typemap_prefix m Prefix for typemap classes. Default: MyTypemaps interface_prefix i Prefix for interface classes. Default: MyInterfaces server_prefix sp Prefix for server classes. Default: MyServer base_path b Path to create classes in. Default: . typemap_include mi File to include in typemap. Must eval() to a valid perl hash (not a hash ref !). proxy x HTTP(S) proxy to use (if any). wsdl2perl will also use the proxy settings specified via the HTTP_PROXY and HTTPS_PROXY environment variables. keep_alive Use http keep_alive. user Username for HTTP authentication password Password. wsdl2perl will prompt if not given. generator g Generator to use. Default: XSD server s Generate a server interface (currently only CGI supported) help h Show help content =head1 DESCRIPTION Generates a interface class for a SOAP web service described by a WSDL definition. The following classes are created: =over =item * A interface class for every SOAP port in service Interface classes are what you will mainly deal with: They provide a method for accessing every web service method. If you chose to generate Server interfaces, a class for every SOAP port in every Web service. You'll have to implement a method for each of the implemented methods. You may implement these methods in the CGI script / handler, or in any class to dispatch calls to. =item * A typemap for every service Typemaps are used internally by SOAP::WSDL for parsing the SOAP message into object trees. If the WSDL definition is incomplete, you may need to add some lines to your typemap. Especially definitions for faults are sometimes left out. Additional typemap content may be included by passing a file name as typemap_include (mi) option. =item * A type class for every element, complexType or simpleType definition You may need to write additional type classes if your WSDL is incomplete. For writing your own lib classes, see L, L and L. =back =head1 TROUBLESHOOTING =head2 Accessing HTTPS URLs You need Crypt::SSLeay installed for accessing HTTPS URLs. =head2 Accessing protected documents Use the -u option for specifying the user name. You will be prompted for a password. Alternatively, you may specify a passowrd with --password on the command line. =head2 Accessing documents protected by NTLM authentication Set the --keep_alive option. Note that accessing documents protected by NTLM authentication is currently untested, because I have no access to a system using NTLM authentication. If you try it, I would be glad if you could just drop me a note about success or failure. =head1 LICENSE Copyright 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 =cut SOAP-WSDL-3.003/benchmark/0000755000175000017500000000000012507276245011714 5ustar SOAP-WSDL-3.003/benchmark/person_single.pl0000644000175000017500000002625112375112740015116 0ustar use lib '../lib'; use lib '../example/lib'; use lib '../../SOAP-WSDL_XS/blib/lib'; use lib '../../SOAP-WSDL_XS/blib/arch'; use strict; use Benchmark; use Storable; use SOAP::WSDL::Deserializer::XSD_XS; use SOAP::WSDL::Factory::Deserializer; # # register for SOAP 1.1 SOAP::WSDL::Factory::Deserializer->register('1.1' => 'SOAP::WSDL::Deserializer::XSD_XS' ); SOAP::WSDL::Factory::Transport->register('http' => 'Transport'); use MyInterfaces::TestService::TestPort; my @data = (); my $soap = MyInterfaces::TestService::TestPort->new(); # Load all classes - XML::Compile has created everything before, too timethis 150, sub { $soap->ListPerson({}) }; timethis 300, sub { push @data, $soap->ListPerson({}) }; @data = (); timethis 300, sub { push @data, $soap->ListPerson({}) }; # for (1..50) { push @data, $soap->ListPerson({}) }; #print $soap->ListPerson({}); my $result = $soap->ListPerson({}); timethis 30 , sub { my $frozen = Storable::freeze( $result ); my $thawed = Storable::thaw($frozen); }; # print $thawed; package Transport; use Class::Std::Fast; sub send_receive { return <<'EOT'; 1Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract31Salutation0Name0Martin1970-01-01Street 000000City0Country0++499131123456++49150123456Somestreet 2312345SomeCityGermany++499131123456++49150123456100000SomeContract0100001SomeContract1100002SomeContract2100003SomeContract3}; EOT } SOAP-WSDL-3.003/benchmark/XSD/0000755000175000017500000000000012507276245012352 5ustar SOAP-WSDL-3.003/benchmark/XSD/01_anyType.t0000644000175000017500000000041412375112740014457 0ustar use strict; use warnings; use Benchmark; use lib '../../lib'; use SOAP::WSDL::XSD::Typelib::Builtin::anyType; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new(); timethese 10000, { 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anyType->new() }, }; SOAP-WSDL-3.003/benchmark/XSD/strftime.pl0000644000175000017500000000176012375112740014540 0ustar use Benchmark qw(cmpthese timethis timethese); use POSIX (); use Date::Format (); my @time_from = localtime; #use lib '../../lib'; use SOAP::WSDL::XSD::Typelib::Builtin::dateTime; my $date = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new(); timethese 10000, { 'sprintf' => sub { $date->set_value('Dec 24 2004 CET'); } }; __END__ print "Comparing POSIX::strftime and Date::Format::strftime '%Y-%m-%dT%H:%M:%S%z'\n\n"; print 'POSIX: ', POSIX::strftime('%Y-%m-%dT%H:%M:%S%z', @time_from), "\n"; print 'Date::Format: ', Date::Format::strftime('%Y-%m-%dT%H:%M:%S%z', @time_from), "\n"; cmpthese 100000, { POSIX => sub { POSIX::strftime('%Y-%m-%dT%H:%M:%S%z', @time_from) }, 'Date::Format' => sub { Date::Format::strftime('%Y-%m-%dT%H:%M:%S%z', @time_from) }, }; __END__ results with perl-5.8.8 on Ubuntu 8.04 on a Thinkpad T42 (1.7GHz Dothan): Rate Date::Format POSIX Date::Format 10684/s -- -93% POSIX 153846/s 1340% -- SOAP-WSDL-3.003/benchmark/XSD/03_string.t0000644000175000017500000000416512375112740014345 0ustar use strict; use warnings; use Benchmark; use lib '../../lib'; use lib '../../../Class-Std-Fast/lib'; use SOAP::WSDL::XSD::Typelib::Builtin::string; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new(); timethese 20000, { 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::string->new() }, 'new + params' => sub { SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Teststring', }) }, }; $obj->set_value('Foobar'); timethese 20000, { serialize => sub { $obj->serialize() } }; my $data; timethese 1000000, { 'set_FOO' => sub { $obj->set_value('Test') }, 'get_FOO' => sub { $data = $obj->get_value() }, }; __END__ Benchmark: timing 20000 iterations of new, new + params... new: 1 wallclock secs ( 0.41 usr + 0.00 sys = 0.41 CPU) @ 48780.49/s (n=20000) new + params: 1 wallclock secs ( 0.53 usr + 0.01 sys = 0.54 CPU) @ 37037.04/s (n=20000) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 2 wallclock secs ( 1.43 usr + 0.01 sys = 1.44 CPU) @ 694444.44/s (n=1000000) set_FOO: 0 wallclock secs ( 1.43 usr + 0.01 sys = 1.44 CPU) @ 694444.44/s (n=1000000) ::Fast --- Benchmark: timing 20000 iterations of new, new + params... new: 0 wallclock secs ( 0.44 usr + 0.01 sys = 0.45 CPU) @ 44444.44/s (n=20000) new + params: 1 wallclock secs ( 0.55 usr + 0.00 sys = 0.55 CPU) @ 36363.64/s (n=20000) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 0 wallclock secs ( 0.81 usr + 0.00 sys = 0.81 CPU) @ 1234567.90/s (n=1000000) set_FOO: 2 wallclock secs ( 0.87 usr + 0.01 sys = 0.88 CPU) @ 1136363.64/s (n=1000000) ::Fast with inlined ID Benchmark: timing 20000 iterations of new, new + params... new: 0 wallclock secs ( 0.41 usr + 0.00 sys = 0.41 CPU) @ 48780.49/s (n=20000) new + params: 1 wallclock secs ( 0.52 usr + 0.00 sys = 0.52 CPU) @ 38461.54/s (n=20000) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 2 wallclock secs ( 0.80 usr + 0.00 sys = 0.80 CPU) @ 1250000.00/s (n=1000000) set_FOO: 2 wallclock secs ( 0.89 usr + -0.01 sys = 0.88 CPU) @ 1136363.64/s (n=1000000)SOAP-WSDL-3.003/benchmark/XSD/02_anySimpleType.t0000644000175000017500000000526412375112740015642 0ustar use strict; use warnings; use Benchmark; use lib '../../lib'; use lib '../../../Class-Std-Fast/lib'; use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new(); timethese 10000, { 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new() }, 'new + params' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => 'Teststring', }) }, 'set_FOO' => sub { $obj->set_value('Test') }, }; my $data; timethese 1000000, { 'set_FOO' => sub { $obj->set_value('Test') }, 'get_FOO' => sub { $data = $obj->get_value() }, }; __END__ Benchmark: timing 10000 iterations of new, new + params, set_FOO... new: 0 wallclock secs ( 0.83 usr + 0.00 sys = 0.83 CPU) @ 12048.19/s (n=10000) new + params: 1 wallclock secs ( 0.58 usr + 0.00 sys = 0.58 CPU) @ 17241.38/s (n=10000) set_FOO: 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU) @ 1000000.00/s (n=10000) (warning: too few iterations for a reliable count) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 1 wallclock secs ( 1.79 usr + 0.01 sys = 1.80 CPU) @ 555555.56/s (n=1000000) set_FOO: 2 wallclock secs ( 1.44 usr + 0.03 sys = 1.47 CPU) @ 680272.11/s (n=1000000) ## Fast: Benchmark: timing 10000 iterations of new, new + params, set_FOO... new: 1 wallclock secs ( 0.67 usr + 0.01 sys = 0.68 CPU) @ 14705.88/s (n=10000) new + params: 1 wallclock secs ( 0.54 usr + 0.00 sys = 0.54 CPU) @ 18518.52/s (n=10000) set_FOO: 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU) @ 1000000.00/s (n=10000) (warning: too few iterations for a reliable count) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 2 wallclock secs ( 1.11 usr + 0.00 sys = 1.11 CPU) @ 900900.90/s (n=1000000) set_FOO: 2 wallclock secs ( 0.80 usr + 0.00 sys = 0.80 CPU) @ 1250000.00/s (n=1000000) ## Fast qw(2); Benchmark: timing 10000 iterations of new, new + params, set_FOO... new: 1 wallclock secs ( 0.17 usr + 0.00 sys = 0.17 CPU) @ 58823.53/s (n=10000) (warning: too few iterations for a reliable count) new + params: 0 wallclock secs ( 0.19 usr + 0.00 sys = 0.19 CPU) @ 52631.58/s (n=10000) (warning: too few iterations for a reliable count) set_FOO: 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU) @ 1000000.00/s (n=10000) (warning: too few iterations for a reliable count) Benchmark: timing 1000000 iterations of get_FOO, set_FOO... get_FOO: 1 wallclock secs ( 1.12 usr + 0.00 sys = 1.12 CPU) @ 892857.14/s (n=1000000) set_FOO: 0 wallclock secs ( 0.80 usr + 0.01 sys = 0.81 CPU) @ 1234567.90/s (n=1000000) SOAP-WSDL-3.003/benchmark/hello.pl0000644000175000017500000000461412375112740013351 0ustar #!/usr/bin/perl -w use strict; use warnings; use diagnostics; use lib '../example/lib'; use lib '../../SOAP-Lite-0.71/lib'; use lib '/home/martin/workspace/SOAP-WSDL_XS/blib/lib'; use lib '/home/martin/workspace/SOAP-WSDL_XS/blib/arch'; use Data::Dumper; use SOAP::Lite; use XML::Compile::SOAP11; use XML::Compile::WSDL11; use XML::Compile::Transport::SOAPHTTP; use MyInterfaces::HelloWorld::HelloWorldSoap; #use SOAP::WSDL::Deserializer::XSD_XS; use Benchmark qw(cmpthese timethese); use SOAP::WSDL::Transport::HTTP; use SOAP::WSDL::Factory::Transport; SOAP::WSDL::Factory::Transport->register('http', 'SOAP::WSDL::Transport::HTTP'); my $proxy = 'http://localhost:81/soap-wsdl-test/helloworld.pl'; #my $proxy = 'http://localhost:81/soap-wsdl-test/helloworld'; my $lite = SOAP::Lite->new( proxy => $proxy ); $lite->on_action( sub { "urn:HelloWorld#sayHello" }); $lite->autotype(0); my $soap = MyInterfaces::HelloWorld::HelloWorldSoap->new({ proxy => $proxy, }); my $soap_xs = MyInterfaces::HelloWorld::HelloWorldSoap->new({ proxy => $proxy, }); #$soap_xs->set_deserializer( SOAP::WSDL::Deserializer::XSD_XS->new() ); my @result = ();; sub wsdl_bench { push @result, $soap->sayHello({ name => $ARGV[1] || '"Your name"', givenName => $ARGV[0] || '"Your given name"', }); } sub wsdl_xs_bench { push @result, $soap_xs->sayHello({ name => $ARGV[1] || '"Your name"', givenName => $ARGV[0] || '"Your given name"', }); } my $wsdl = XML::Compile::WSDL11->new('../example/wsdl/11_helloworld.wsdl'); my $call = $wsdl->compileClient('sayHello', sloppy_integers => 1, check_values => 0, check_values => 0, validation => 0, ); sub compile_bench { push @result, $call->( name => $ARGV[1] || '"Your name"', givenName => $ARGV[0] || '"Your given name"', ); } sub lite_bench { push @result, $lite->call( SOAP::Data->name("sayHello") ->attr({ xmlns => 'urn:HelloWorld' }), SOAP::Data->name('name')->value( $ARGV[1] || '"Your name"'), SOAP::Data->name('givenName')->value( $ARGV[0] || '"Your given name"'), ); } # give all a chance to perform first-run initializations compile_bench(); lite_bench(); wsdl_bench(); #wsdl_xs_bench(); timethese 150, { 'SOAP::WSDL' => \&wsdl_bench, # 'SOAP::WSDL_XS' => \&wsdl_xs_bench, 'XML::Compile' => \&compile_bench, 'SOAP::Lite' => \&lite_bench, }; SOAP-WSDL-3.003/benchmark/person_profile.pl0000644000175000017500000000111512375112740015265 0ustar use lib '../lib'; use lib '../example/lib'; use lib '../../SOAP-WSDL_XS/blib/lib'; use lib '../../SOAP-WSDL_XS/blib/arch'; use strict; # use Benchmark; use SOAP::WSDL::Deserializer::XSD_XS; use SOAP::WSDL::Factory::Deserializer; # # register for SOAP 1.1 SOAP::WSDL::Factory::Deserializer->register('1.1' => 'SOAP::WSDL::Deserializer::XSD_XS' ); use MyInterfaces::TestService::TestPort; my $soap = MyInterfaces::TestService::TestPort->new(); # Load all classes - XML::Compile has created everything before, too if (@ARGV) { print $soap->ListPerson({}) } else { $soap->ListPerson({}) } SOAP-WSDL-3.003/benchmark/01_expat.t0000644000175000017500000001367012375112740013521 0ustar #!/usr/bin/perl -w use strict; use warnings; use lib '../lib'; use lib '../../Class-Std-Fast/lib'; use lib '/home/martin/workspace/SOAP-WSDL_XS/blib/lib'; use lib '/home/martin/workspace/SOAP-WSDL_XS/blib/arch'; use lib '../t/lib'; # use SOAP::WSDL::SAX::MessageHandler; use Benchmark qw(cmpthese timethese); use SOAP::WSDL::Expat::MessageParser; use SOAP::WSDL::Expat::Message2Hash; use SOAP::WSDL::Expat::MessageParser_XS; use SOAP::Lite; use XML::Simple; use XML::LibXML; use MyComplexType; use MyElement; use MySimpleType; my $xml = q{ Test2 Test3 Test4 Test5 Test6 Test7 Test8 Test9 Test10 Test11 Test12 Test13 Test55 Test14 Test15 Test16 Test17 Test18 Test19 Test20 Test21 Test22 Test23 Test24 Test25 Test565 Test27 Test28 Test29 Test30 Test31 Test32 Test33 Test34 Test35 Test36 Test37 Test38 Test55 }; my $parser = SOAP::WSDL::Expat::MessageParser->new({ class_resolver => 'FakeResolver' }); my $hash_parser = SOAP::WSDL::Expat::Message2Hash->new(); $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; print "xml length: ${ \length $xml } bytes\n"; my $libxml = XML::LibXML->new(); $libxml->keep_blanks(0); my @data; my $deserializer = SOAP::Deserializer->new(); my $parser_xs = SOAP::WSDL::Expat::MessageParser_XS->new({ class_resolver => 'FakeResolver' }); sub libxml_test { my $dom = $libxml->parse_string( $xml ); push @data, dom2hash( $dom->firstChild ); }; sub dom2hash { for ($_[0]->childNodes) { if (exists $_[1]->{ $_->nodeName }) { if (ref $_[1]->{ $_->nodeName } eq 'ARRAY') { if ($_->nodeName eq '#text') { push @{ $_[1] } ,$_->textContent; } else { push @{ $_[1]->{ $_->nodeName } }, dom2hash( $_, {} ); } } else { if ($_->nodeName eq '#text') { $_[1] = [ $_[1], $_->textContent() ]; } else { $_[1]->{ $_->nodeName } = [ $_[1]->{ $_->nodeName } , dom2hash( $_, {} ) ]; } } } else { if ($_->nodeName eq '#text') { $_[1] = $_->textContent(); } else { $_[1]->{ $_->nodeName } = dom2hash( $_, {} ); } } } return $_[1]; } cmpthese 5000, { 'SOAP::WSDL (Hash)' => sub { push @data, $hash_parser->parse( $xml ) }, 'SOAP::WSDL (XSD)' => sub { push @data, $parser->parse( $xml ) }, 'SOAP::WSDL_XS (XSD)' => sub { push @data, $parser_xs->parse_string( $xml ) }, 'XML::Simple (Hash)' => sub { push @data, XMLin $xml }, 'XML::LibXML (DOM)' => sub { push @data, $libxml->parse_string( $xml ) }, 'XML::LibXML (Hash)' => \&libxml_test, 'SOAP::Lite' => sub { push @data, $deserializer->deserialize( $xml ) }, }; # data classes reside in t/lib/Typelib/ BEGIN { package FakeResolver; { my %class_list = ( 'MyAtomicComplexTypeElement' => 'MyAtomicComplexTypeElement', 'MyAtomicComplexTypeElement/test' => 'MyAtomicComplexTypeElement', 'MyAtomicComplexTypeElement/test/test2' => 'MyTestElement2', ); sub get_typemap { return \%class_list; }; sub get_map { return \%class_list }; sub new { return bless {}, 'FakeResolver' }; sub get_class { my $name = join('/', @{ $_[1] }); return ($class_list{ $name }) ? $class_list{ $name } : warn "no class found for $name"; }; }; }; __END__ Output on my machine: xml length: 641 bytes Rate SOAP::Lite XML::Simple (Hash) SOAP::WSDL (XSD) XML::LibXML (Hash) SOAP::WSDL (Hash) SOAP::WSDL_XS (XSD) XML::LibXML (DOM) SOAP::Lite 446/s -- -54% -72% -73% -80% -95% -96% XML::Simple (Hash) 963/s 116% -- -39% -41% -57% -89% -91% SOAP::WSDL (XSD) 1587/s 256% 65% -- -3% -29% -81% -86% XML::LibXML (Hash) 1629/s 265% 69% 3% -- -27% -81% -85% SOAP::WSDL (Hash) 2222/s 398% 131% 40% 36% -- -74% -80% SOAP::WSDL_XS (XSD) 8475/s 1798% 780% 434% 420% 281% -- -24% XML::LibXML (DOM) 11111/s 2389% 1053% 600% 582% 400% 31% -- SOAP-WSDL-3.003/benchmark/person.xml0000644000175000017500000003075512375112740013746 0ustar 1 Salutation0 Name0 Martin 1970-01-01 Street 0 00000 City0 Country0 ++499131123456 ++49150123456 Somestreet 23 12345 SomeCity Germany ++499131123456 ++49150123456 100000 SomeContract0 100001 SomeContract1 100002 SomeContract2 100003 SomeContract3 2 Salutation2 Name2 Martin2 1970-01-02 Street 2 00002 City2 Country2 ++4900000002 ++491700000002 Somestreet 2 222222 SomeCity2 Germany ++4920000002 ++4920000002 100002 SomeContract2 100021 SomeContract21 100022 SomeContract22 1000023 SomeContract23 3 Salutation3 Name3 Martin3 1970-01-03 Street 3 00003 City3 Country3 ++4900000003 ++491700000003 Somestreet 3 333333 SomeCity3 Germany ++4930000003 ++4930000003 100003 SomeContract3 100031 SomeContract31 100033 SomeContract33 1000033 SomeContract33 4 Salutation4 Name4 Martin4 1970-01-04 Street 4 00004 City4 Country4 ++4900000004 ++491700000004 Somestreet 4 444444 SomeCity4 Germany ++4940000004 ++4940000004 100004 SomeContract4 100041 SomeContract41 100044 SomeContract44 1000044 SomeContract44 5 Salutation5 Name5 Martin5 1970-01-05 Street 5 00005 City5 Country5 ++4900000005 ++491700000005 Somestreet 5 555555 SomeCity5 Germany ++4950000005 ++4950000005 100005 SomeContract5 100051 SomeContract51 100055 SomeContract55 1000053 SomeContract53 6 Salutation6 Name6 Martin6 1970-01-06 Street 6 00006 City6 Country6 ++4900000006 ++491700000006 Somestreet 6 666666 SomeCity6 Germany ++4960000006 ++4960000006 100006 SomeContract6 100061 SomeContract61 100066 SomeContract66 1000063 SomeContract63 7 Salutation7 Name7 Martin7 1970-01-07 Street 7 00007 City7 Country7 ++4900000007 ++491700000007 Somestreet 7 777777 SomeCity7 Germany ++4970000007 ++4970000007 100007 SomeContract7 100071 SomeContract71 100077 SomeContract77 1000073 SomeContract73 8 Salutation8 Name8 Martin8 1970-01-08 Street 8 00008 City8 Country8 ++4900000008 ++491700000008 Somestreet 8 888888 SomeCity8 Germany ++4980000008 ++4980000008 100008 SomeContract8 100081 SomeContract81 100088 SomeContract88 1000083 SomeContract83 9 Salutation9 Name9 Martin9 1970-01-09 Street 9 00009 City9 Country9 ++4900000009 ++491700000009 Somestreet 9 999999 SomeCity9 Germany ++4990000009 ++4990000009 100009 SomeContract9 100091 SomeContract91 100099 SomeContract99 1000093 SomeContract93 10 Salutation10 Name10 Martin10 1970-01-010 Street 10 000010 City10 Country10 ++49000000010 ++4917000000010 Somestreet 10 101010101010 SomeCity10 Germany ++491000000010 ++491000000010 1000010 SomeContract10 1000101 SomeContract101 10001010 SomeContract1010 10000103 SomeContract103 SOAP-WSDL-3.003/benchmark/MEMORY_FOOTPRINT0000644000175000017500000000633512375112740014312 0ustar Memory footprints for example/ scripts comparing SOAP::WSDL, SOAP::Lite and XML::Compile::SOAP Results with perl-5.8.8 on Ubuntu 8.04 (x86): PID %CPU %MEM VSZ RSS COMMAND 10183 12.0 1.1 14292 11492 perl -I../lib hello.pl 10554 7.2 0.9 12636 9828 perl hello_lite.pl 10224 17.5 1.6 20780 17012 perl hello_compile.pl 10287 25.0 1.1 14680 11776 perl -I../lib person.pl 10313 24.0 1.6 21068 17312 perl person_compile.pl Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.15.7, archname=i486-linux-gnu-thread-multi uname='linux palmer 2.6.15.7 #1 smp thu sep 7 19:42:20 utc 2006 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.8 -Dsitearch=/usr/local/lib/perl/5.8.8 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.8 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.2.3 20071123 (prerelease) (Ubuntu 4.2.2-3ubuntu4)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.6.1.so, so=so, useshrplib=true, libperl=libperl.so.5.8.8 gnulibc_version='2.6.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Nov 27 2007 10:44:36 @INC: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . SOAP-WSDL-3.003/benchmark/README0000644000175000017500000000560212375112740012567 0ustar The benchmark directory includes a bunch of benchmarks. The most notable ones are listed below. Comparison benchmarks for SOAP::Lite, SOAP::WSDL, SOAP::WSDL_XS, and XML::Compile::WSDP need all of these installed for the benchmark to work (building and adding to the lib path suffices). All comparison benchmarks only account for the client part of the respective modules - the server part is not benchmarked. SOAP::WSDL_XS can be obtained from the project's subversion repository at https://soap-wsdl.svn.sourceforge.net/svnroot/SOAP-WSDL/SOAP-WSDL_XS/trunk Some benchmarks expect to find the SOAP servers "cgi-bin/person.pl" and "cgi-bin/hello.pl" from the examples directory at http://localhost:81/soap-wsdl-test/person.pl and http://localhost:81/soap-wsdl-test/hello.pl If the web services are not set up properly, you're benchmarking error creation times. To set up a SOAP server using apache, add the following to your apache config: # usually in main config Listen 127.0.0.1:81 # maybe in a # container # ScriptAlias /soap-wsdl-test/ /PATH_TO/SOAP-WSDL/example/cgi-bin/ AllowOverride None Order allow,deny Allow from all Using mod_perl is highly recommended to cut down benchmarking time. COMPARISON BENCHMARKS ===================== 01_expat.t ---------- Benchmarks XML parsing speed between XML::Simple with XML::Parser as backend, SOAP::Lite, SOAP::WSDL outputting objects, SOAP::WSDL outputting hash refs, XML::LibXML with a simple DOM walker outputting hash refs, XML::LibXML outputting the DOM and SOAP::WSDL_XS. No web server required. This benchmark sheds light on how much performance is - in theory - reachable by each approach: The XML::LibXML (Hash) benchmark converts the DOM into a nested hash using a recursive function. This is - basically - how XML::Compile works. XML::Simple uses XML::Parser's streaming API. SOAP::WSDL uses XML::Parser::Expat, XML::Parser's low-level backend, to create objects or - in the (Hash) variant - nested hashes similar to those created by XML::Simple. SOAP::WSDL_XS uses a libexpat-based XS parser to create perl objects, and XML::LibXML (DOM) creates a C level libxml2 DOM accessible from perl. person.pl: ---------- Sends a empty requests and receives a response of ca. 10kB. Modeled after a common enterprise setup: "Give me a list of person data sets". For this benchmark, XML parsing speed is important. XML generation speed is only weighted in the last two runs, and weights around 1/10 of parsing speed. hello.pl: --------- Sends a request containing name and given name and politely replies "Hello ". An example for very short requests and responses. For this example, handling and generating small requests/responses, and transport speed is important. As the XML transmitted is relatively small, the transport layer's overhead is important. SOAP-WSDL-3.003/benchmark/person.pl0000644000175000017500000001403312375112740013550 0ustar use lib '../lib'; use lib '../example/lib'; use lib '../../Class-Std-Fast/lib'; use lib '../../SOAP-Lite-0.71/lib'; use lib '../../SOAP-WSDL_XS/blib/lib'; use lib '../../SOAP-WSDL_XS/blib/arch'; use strict; use Benchmark qw(cmpthese); use XML::Compile::SOAP11; use XML::Compile::Transport::SOAPHTTP(); use XML::Compile::Util; use XML::Compile::WSDL11; use XML::Simple; use SOAP::Lite; use MyInterfaces::TestService::TestPort; #use SOAP::WSDL::Deserializer::XSD_XS; use SOAP::WSDL::Factory::Deserializer; # # register SOAP::WSDL's transport as default for SOAP::WSDL and SOAP::WSDL_XS # - they use SOAP::Lite's SOAP::Transport::* if available # use SOAP::WSDL::Transport::HTTP; use SOAP::WSDL::Factory::Transport; SOAP::WSDL::Factory::Transport->register('http', 'SOAP::WSDL::Transport::HTTP'); $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; my $person = { PersonID => { # MyTypes::PersonID ID => 1, # int }, Salutation => 'Salutation0', # string Name => 'Name0', # string GivenName => 'Martin', # string DateOfBirth => '1970-01-01', # date HomeAddress => { # MyTypes::Address Street => 'Street 0', # string ZIP => '00000', # string City => 'City0', # string Country => 'Country0', # string PhoneNumber => '++499131123456', # PhoneNumber MobilePhoneNumber => '++49150123456', # PhoneNumber }, WorkAddress => { # MyTypes::Address Street => 'Somestreet 23', # string ZIP => '12345', # string City => 'SomeCity', # string Country => 'Germany', # string PhoneNumber => '++499131123456', # PhoneNumber MobilePhoneNumber => '++49150123456', # PhoneNumber }, Contracts => { # MyTypes::ArrayOfContract Contract => [ { # MyTypes::Contract ContractID => 100000, # long ContractName => 'SomeContract0', # string }, { # MyTypes::Contract ContractID => 100001, # long ContractName => 'SomeContract1', # string }, { # MyTypes::Contract ContractID => 100002, # long ContractName => 'SomeContract2', # string }, { # MyTypes::Contract ContractID => 100003, # long ContractName => 'SomeContract3', # string }, ], }, } ; # # compile XML::Compile client with the options suggested by Mark Overmeer # for maximum speedup # my $compile = XML::Compile::WSDL11->new('../example/wsdl/Person.wsdl', sloppy_integers => 1, check_values => 0, validation => 0, ignore_facets => 1, ); # # Call all variants once to allow their first-time tasks to be done # my $call = $compile->compileClient('ListPerson'); $call->({ in => undef}); # Initialize SOAP::WSDL interface my $soap = MyInterfaces::TestService::TestPort->new(); # Load all classes - XML::Compile has created everything before, too $soap->ListPerson({}); my $lite = SOAP::Lite->new()->default_ns('http://www.example.org/benchmark/') ->proxy('http://localhost:81/soap-wsdl-test/person.pl'); $lite->on_action( sub { 'http://www.example.org/benchmark/ListPerson' } ); $lite->ListPerson(); my $lite_xml = SOAP::Lite->new()->default_ns('http://www.example.org/benchmark/') ->proxy('http://localhost:81/soap-wsdl-test/person.pl'); $lite_xml->on_action( sub { 'http://www.example.org/benchmark/ListPerson' } ); $lite_xml->outputxml(1); $lite_xml->ListPerson(); # # register for SOAP 1.1 #SOAP::WSDL::Factory::Deserializer->register('1.1' => 'SOAP::WSDL::Deserializer::XSD_XS' ); #my $wsdl_xs = MyInterfaces::TestService::TestPort->new(); my $count = 70; my @data = (); my $n = 0; print "Benchmark conducted with SOAP::Lite - $SOAP::Lite::VERSION SOAP::WSDL - $SOAP::WSDL::Client::VERSION SOAP::WSDL_XS - $SOAP::WSDL::Deserializer::XSD_XS::VERSION; XML::Compile::SOAP - $XML::Compile::SOAP::VERSION XML::Simple - $XML::Simple::VERSION XML::Simple uses XML::Parser as backend and SOAP::Lite with outputxml(1) set as SOAP client. XML::Parser - $XML::Parser::VERSION XML::Simple is not benchmarked in run 3ff, as it is expected do deliver the same result. Benchmark $n: Store result in private variable and destroy it "; $n++; cmpthese $count, { 'SOAP::Lite' => sub { my $som = $lite->call('ListPerson') }, 'SOAP::WSDL' => sub { my $result = $soap->ListPerson({}) }, # 'SOAP::WSDL_XS' => sub { my $result = $wsdl_xs->ListPerson({}) }, 'XML::Compile' => sub { my $result = $call->() }, 'XML::Simple' => sub { my $result = XMLin( $lite_xml->call('ListPerson')) }, }; print "\nBenchmark $n: Push result on list\n"; $n++; cmpthese $count, { 'SOAP::Lite' => sub { push @data, $lite->call('ListPerson') }, 'SOAP::WSDL' => sub { push @data, $soap->ListPerson({}) }, # 'SOAP::WSDL_XS' => sub { push @data, $wsdl_xs->ListPerson({}) }, 'XML::Compile' => sub { push @data, $call->() }, 'XML::Simple' => sub { push @data, XMLin( $lite_xml->call('ListPerson')) }, }; @data = (); print "\nBenchmark $n: Play it, please play it again, Sam\n"; $n++; cmpthese $count, { 'SOAP::WSDL' => sub { push @data, $soap->ListPerson({}) }, # 'SOAP::WSDL_XS' => sub { push @data, $wsdl_xs->ListPerson({}) }, # 'XML::Compile' => sub { push @data, $call->() }, # 'SOAP::Lite' => sub { push @data, $lite->call('ListPerson') }, }; print "\nBenchmark $n: ca. 1kB request - result destroyed immediately\n"; $n++; cmpthese $count, { 'SOAP::WSDL' => sub { my $result = $soap->ListPerson({ in => $person }) }, # 'SOAP::WSDL_XS' => sub { my $result = $wsdl_xs->ListPerson({ in => $person }) }, 'XML::Compile' => sub { my $result = $call->({ in => $person }) }, }; print "\nBenchmark $n: ca. 1kB request - push result on list\n"; $n++; cmpthese $count, { 'SOAP::WSDL' => sub { push @data, $soap->ListPerson({ in => $person }) }, # 'SOAP::WSDL_XS' => sub { push @data, $wsdl_xs->ListPerson({ in => $person }) }, 'XML::Compile' => sub { push @data, $call->({ in => $person }) }, }; SOAP-WSDL-3.003/META.json0000644000175000017500000000325012507276245011403 0ustar { "abstract" : "SOAP with WSDL support", "author" : [ "Scott Walters " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.88, CPAN::Meta::Converter version 2.133380", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "SOAP-WSDL", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Class::Load" : "0.2", "Class::Std::Fast" : "0.000005", "Cwd" : "0", "Data::Dumper" : "0", "Date::Format" : "0", "Date::Parse" : "0", "File::Basename" : "0", "File::Path" : "0", "File::Spec" : "0", "Getopt::Long" : "0", "LWP::UserAgent" : "0", "List::Util" : "0", "Module::Build" : "0", "Storable" : "0", "Template" : "2.18", "Term::ReadKey" : "0", "Test::More" : "0", "URI" : "0", "XML::Parser::Expat" : "0", "perl" : "5.008" } } }, "release_status" : "stable", "resources" : { "repository" : { "type" : "git", "url" : "https://github.com/scrottie/SOAP-WSDL.git", "web" : "https://github.com/scrottie/SOAP-WSDL" } }, "version" : 3.003 } SOAP-WSDL-3.003/MANIFEST0000644000175000017500000004411412507276245011117 0ustar benchmark/01_expat.t benchmark/hello.pl benchmark/MEMORY_FOOTPRINT benchmark/person.pl benchmark/person.xml benchmark/person_profile.pl benchmark/person_single.pl benchmark/README benchmark/XSD/01_anyType.t benchmark/XSD/02_anySimpleType.t benchmark/XSD/03_string.t benchmark/XSD/strftime.pl bin/wsdl2perl.pl Build.PL Changes example/cgi-bin/helloworld.pl example/cgi-bin/person.pl example/fortune.pl example/genericbarcode.pl example/hello.pl example/hello_compile.pl example/hello_lite.pl example/java/cxf/.classpath example/java/cxf/.settings/org.eclipse.jdt.core.prefs example/java/cxf/.settings/org.maven.ide.eclipse.prefs example/java/cxf/11_helloworld.wsdl example/java/cxf/jax-binding.xml example/java/cxf/pom.xml example/java/cxf/README example/java/cxf/src/main/resources/cxf.xml example/java/cxf/src/test/java/helloworld/HelloWorldTest.java example/java/cxf/src/test/resources/test-context.xml example/lib/MyElements/CountCookies.pm example/lib/MyElements/CountCookiesResponse.pm example/lib/MyElements/GenerateBarCode.pm example/lib/MyElements/GenerateBarCodeResponse.pm example/lib/MyElements/GetCitiesByCountry.pm example/lib/MyElements/GetCitiesByCountryResponse.pm example/lib/MyElements/GetFortuneCookie.pm example/lib/MyElements/GetFortuneCookieResponse.pm example/lib/MyElements/GetSpecificCookie.pm example/lib/MyElements/GetSpecificCookieResponse.pm example/lib/MyElements/GetWeather.pm example/lib/MyElements/GetWeatherResponse.pm example/lib/MyElements/int.pm example/lib/MyElements/ListPerson.pm example/lib/MyElements/ListPersonResponse.pm example/lib/MyElements/readNodeCount.pm example/lib/MyElements/readNodeCountResponse.pm example/lib/MyElements/sayHello.pm example/lib/MyElements/sayHelloResponse.pm example/lib/MyElements/string.pm example/lib/MyInterfaces/BarCode/BarCodeSoap.pm example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie/FullerData_x0020_Fortune_x0020_CookieSoap.pm example/lib/MyInterfaces/GlobalWeather/GlobalWeatherSoap.pm example/lib/MyInterfaces/HelloWorld/HelloWorldSoap.pm example/lib/MyInterfaces/TestService/TestPort.pm example/lib/MyServer/HelloWorld/HelloWorldSoap.pm example/lib/MyServer/TestService/TestPort.pm example/lib/MyTypemaps/BarCode.pm example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm example/lib/MyTypemaps/GlobalWeather.pm example/lib/MyTypemaps/HelloWorld.pm example/lib/MyTypemaps/TestService.pm example/lib/MyTypes/Address.pm example/lib/MyTypes/ArrayOfContract.pm example/lib/MyTypes/ArrayOfPerson.pm example/lib/MyTypes/BarCodeData.pm example/lib/MyTypes/BarcodeOption.pm example/lib/MyTypes/BarcodeType.pm example/lib/MyTypes/CheckSumMethod.pm example/lib/MyTypes/Contract.pm example/lib/MyTypes/ImageFormats.pm example/lib/MyTypes/Person.pm example/lib/MyTypes/PersonID.pm example/lib/MyTypes/PhoneNumber.pm example/lib/MyTypes/ShowTextPosition.pm example/lib/MyTypes/test2.pm example/lib/MyTypes/testExtended.pm example/person.pl example/person_compile.pl example/server/hello_simple.pl example/visitor/visitor.pl example/weather.pl example/weather_wsdl.pl example/wsdl/11_helloworld.wsdl example/wsdl/FortuneCookie.xml example/wsdl/genericbarcode.xml example/wsdl/globalweather.xml example/wsdl/Person.wsdl example/wsdl/person.xml HACKING lib/SOAP/WSDL.pm lib/SOAP/WSDL/Base.pm lib/SOAP/WSDL/Binding.pm lib/SOAP/WSDL/Client.pm lib/SOAP/WSDL/Client/Base.pm lib/SOAP/WSDL/Definitions.pm lib/SOAP/WSDL/Deserializer/Hash.pm lib/SOAP/WSDL/Deserializer/SOM.pm lib/SOAP/WSDL/Deserializer/XSD.pm lib/SOAP/WSDL/Expat/Base.pm lib/SOAP/WSDL/Expat/Message2Hash.pm lib/SOAP/WSDL/Expat/MessageParser.pm lib/SOAP/WSDL/Expat/MessageStreamParser.pm lib/SOAP/WSDL/Expat/WSDLParser.pm lib/SOAP/WSDL/Factory/Deserializer.pm lib/SOAP/WSDL/Factory/Generator.pm lib/SOAP/WSDL/Factory/Serializer.pm lib/SOAP/WSDL/Factory/Transport.pm lib/SOAP/WSDL/Generator/Iterator/WSDL11.pm lib/SOAP/WSDL/Generator/PrefixResolver.pm lib/SOAP/WSDL/Generator/Template.pm lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm lib/SOAP/WSDL/Generator/Template/XSD.pm lib/SOAP/WSDL/Generator/Template/XSD/attribute.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/attributeSet.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/extension.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/attributeSet.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/content_model.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent/extension.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure/simpleContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent/extension.tt lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt lib/SOAP/WSDL/Generator/Template/XSD/element.tt lib/SOAP/WSDL/Generator/Template/XSD/element/POD/contentModel.tt lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/Body.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/Header.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/Operation.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Element.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Message.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/method_info.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Part.tt lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Type.tt lib/SOAP/WSDL/Generator/Template/XSD/POD/annotation.tt lib/SOAP/WSDL/Generator/Template/XSD/Server.tt lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Message.tt lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/method_info.tt lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/Operation.tt lib/SOAP/WSDL/Generator/Template/XSD/Server/POD/OutPart.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/atomicType.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/contentModel.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/list.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/contentModel.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/list.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/structure.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/union.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/restriction.tt lib/SOAP/WSDL/Generator/Template/XSD/simpleType/union.tt lib/SOAP/WSDL/Generator/Template/XSD/Typemap.tt lib/SOAP/WSDL/Generator/Visitor.pm lib/SOAP/WSDL/Generator/Visitor/Typemap.pm lib/SOAP/WSDL/Manual.pod lib/SOAP/WSDL/Manual/CodeFirst.pod lib/SOAP/WSDL/Manual/Cookbook.pod lib/SOAP/WSDL/Manual/Deserializer.pod lib/SOAP/WSDL/Manual/FAQ.pod lib/SOAP/WSDL/Manual/Glossary.pod lib/SOAP/WSDL/Manual/Parser.pod lib/SOAP/WSDL/Manual/Serializer.pod lib/SOAP/WSDL/Manual/WS_I.pod lib/SOAP/WSDL/Manual/XSD.pod lib/SOAP/WSDL/Message.pm lib/SOAP/WSDL/Operation.pm lib/SOAP/WSDL/OpMessage.pm lib/SOAP/WSDL/Part.pm lib/SOAP/WSDL/Port.pm lib/SOAP/WSDL/PortType.pm lib/SOAP/WSDL/Serializer/XSD.pm lib/SOAP/WSDL/Server.pm lib/SOAP/WSDL/Server/CGI.pm lib/SOAP/WSDL/Server/Mod_Perl2.pm lib/SOAP/WSDL/Server/Simple.pm lib/SOAP/WSDL/Service.pm lib/SOAP/WSDL/SOAP/Address.pm lib/SOAP/WSDL/SOAP/Body.pm lib/SOAP/WSDL/SOAP/Header.pm lib/SOAP/WSDL/SOAP/HeaderFault.pm lib/SOAP/WSDL/SOAP/Operation.pm lib/SOAP/WSDL/SOAP/Typelib/Fault.pm lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm lib/SOAP/WSDL/Transport/HTTP.pm lib/SOAP/WSDL/Transport/Loopback.pm lib/SOAP/WSDL/Transport/Test.pm lib/SOAP/WSDL/TypeLookup.pm lib/SOAP/WSDL/Types.pm lib/SOAP/WSDL/XSD/Annotation.pm lib/SOAP/WSDL/XSD/Attribute.pm lib/SOAP/WSDL/XSD/AttributeGroup.pm lib/SOAP/WSDL/XSD/Builtin.pm lib/SOAP/WSDL/XSD/ComplexType.pm lib/SOAP/WSDL/XSD/Element.pm lib/SOAP/WSDL/XSD/Enumeration.pm lib/SOAP/WSDL/XSD/FractionDigits.pm lib/SOAP/WSDL/XSD/Group.pm lib/SOAP/WSDL/XSD/Length.pm lib/SOAP/WSDL/XSD/MaxExclusive.pm lib/SOAP/WSDL/XSD/MaxInclusive.pm lib/SOAP/WSDL/XSD/MaxLength.pm lib/SOAP/WSDL/XSD/MinExclusive.pm lib/SOAP/WSDL/XSD/MinInclusive.pm lib/SOAP/WSDL/XSD/MinLength.pm lib/SOAP/WSDL/XSD/Pattern.pm lib/SOAP/WSDL/XSD/Schema.pm lib/SOAP/WSDL/XSD/Schema/Builtin.pm lib/SOAP/WSDL/XSD/SimpleType.pm lib/SOAP/WSDL/XSD/TotalDigits.pm lib/SOAP/WSDL/XSD/Typelib/Attribute.pm lib/SOAP/WSDL/XSD/Typelib/AttributeSet.pm lib/SOAP/WSDL/XSD/Typelib/Builtin.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/list.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm lib/SOAP/WSDL/XSD/Typelib/Element.pm lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm lib/SOAP/WSDL/XSD/WhiteSpace.pm LICENSE Makefile.PL MANIFEST This list of files META.yml MIGRATING README t/002_parse_wsdl.t t/003_wsdl_based_serializer.t t/006_client.t t/008_client_wsdl_complexType.t t/009_data_classes.t t/011_simpleType.t t/012_element.t t/013_complexType.t t/016_client_object.t t/094_cpan_meta.t t/095_copying.t t/096_characters.t t/097_kwalitee.t t/098_pod.t t/099_pod_coverage.t t/acceptance/results/03_complexType-all.xml t/acceptance/results/03_complexType-sequence.xml t/acceptance/results/04_element-simpleType.xml t/acceptance/results/04_element.xml t/acceptance/results/05_simpleType-list.xml t/acceptance/results/05_simpleType-restriction.xml t/acceptance/results/05_simpleType-union.xml t/acceptance/results/11_helloworld.xml t/acceptance/wsdl/006_sax_client.wsdl t/acceptance/wsdl/008_complexType.wsdl t/acceptance/wsdl/02_port.wsdl t/acceptance/wsdl/03_complexType-all.wsdl t/acceptance/wsdl/03_complexType-element-ref.wsdl t/acceptance/wsdl/03_complexType-sequence.wsdl t/acceptance/wsdl/04_element-simpleType.wsdl t/acceptance/wsdl/04_element.wsdl t/acceptance/wsdl/05_simpleType-list.wsdl t/acceptance/wsdl/05_simpleType-restriction.wsdl t/acceptance/wsdl/05_simpleType-union.wsdl t/acceptance/wsdl/10_helloworld.asmx.xml t/acceptance/wsdl/11_helloworld.wsdl t/acceptance/wsdl/elementAtomicComplexType.xml t/acceptance/wsdl/email_account.wsdl t/acceptance/wsdl/generator_test.wsdl t/acceptance/wsdl/generator_test_dot_names.wsdl t/acceptance/wsdl/generator_unsupported_test.wsdl t/acceptance/wsdl/helloWorld_header.wsdl t/acceptance/wsdl/import.xsd t/acceptance/wsdl/import_loop.xsd t/acceptance/wsdl/message_gateway.wsdl t/acceptance/wsdl/nested_complextype.wsdl t/acceptance/wsdl/WSDLParser-import.wsdl t/acceptance/wsdl/WSDLParser-imported.wsdl t/acceptance/wsdl/WSDLParser.wsdl t/acceptance/wsdl/WSDLParser/import_cascade.xsd t/acceptance/wsdl/WSDLParser/import_no_location.wsdl t/acceptance/wsdl/WSDLParser/import_xsd_cascade.wsdl t/acceptance/wsdl/WSDLParser/imported.xsd t/acceptance/wsdl/WSDLParser/xsd_import_no_location.wsdl t/acceptance/wsdl/WSDLParser_import_loop.wsdl t/CodeFirst/ComplexType.pm t/CodeFirst/element.pm t/CodeFirst/sequence.pm t/CodeFirst/test.pl t/contributed.wsdl t/lib/CodeFirst.pm t/lib/Mod_Perl2Test.pm t/lib/MyComplexType.pm t/lib/MyElement.pm t/lib/MySimpleElement.pm t/lib/MySimpleType.pm t/lib/Test/SOAP/WSDL/Expat/WSDLParser.pm t/lib/Test/SOAP/WSDL/Generator/Iterator/WSDL11.pm t/lib/Test/SOAP/WSDL/Generator/Visitor/Typemap.pm t/lib/Test/SOAP/WSDL/Tester.pm t/lib/Typelib/Base.pm t/lib/Typelib/TEnqueueMessage.pm t/lib/Typelib/TMessage.pm t/SOAP/WSDL.t t/SOAP/WSDL/02_port.t t/SOAP/WSDL/03_complexType-all.t t/SOAP/WSDL/03_complexType-choice.t t/SOAP/WSDL/03_complexType-complexContent.t t/SOAP/WSDL/03_complexType-element-ref.t t/SOAP/WSDL/03_complexType-group.t t/SOAP/WSDL/03_complexType-sequence.t t/SOAP/WSDL/03_complexType-simpleContent.t t/SOAP/WSDL/04_element-complexType.t t/SOAP/WSDL/04_element-simpleType.t t/SOAP/WSDL/04_element.t t/SOAP/WSDL/05_simpleType-list.t t/SOAP/WSDL/05_simpleType-restriction.t t/SOAP/WSDL/05_simpleType-union.t t/SOAP/WSDL/06_keep_alive.t t/SOAP/WSDL/11_helloworld.NET.t t/SOAP/WSDL/12_binding.t t/SOAP/WSDL/Base.t t/SOAP/WSDL/Client.t t/SOAP/WSDL/Client/Base.t t/SOAP/WSDL/Definitions.t t/SOAP/WSDL/Deserializer/Hash.t t/SOAP/WSDL/Deserializer/SOM.t t/SOAP/WSDL/Deserializer/XSD.t t/SOAP/WSDL/Expat/Base.t t/SOAP/WSDL/Expat/MessageParser.t t/SOAP/WSDL/Expat/WSDLParser.t t/SOAP/WSDL/Factory/Deserializer.t t/SOAP/WSDL/Factory/Serializer.t t/SOAP/WSDL/Factory/Transport.t t/SOAP/WSDL/Generator/Template.t t/SOAP/WSDL/Generator/Template/XSD/Import.t t/SOAP/WSDL/Generator/Template/XSD/Unqualified.t t/SOAP/WSDL/Generator/Visitor.t t/SOAP/WSDL/Generator/Visitor/Typemap.t t/SOAP/WSDL/Generator/XSD.t t/SOAP/WSDL/Generator/XSD_custom_resolver.t t/SOAP/WSDL/Generator/XSD_dot_names.t t/SOAP/WSDL/Generator/XSD_nested_complextype.t t/SOAP/WSDL/Generator/XSD_unsupported.t t/SOAP/WSDL/Part.t t/SOAP/WSDL/PortType.t t/SOAP/WSDL/Serializer/XSD.t t/SOAP/WSDL/Server.t t/SOAP/WSDL/Server/CGI.t t/SOAP/WSDL/Server/Mod_Perl2.t t/SOAP/WSDL/Server/Simple.t t/SOAP/WSDL/Transport/01_Test.t t/SOAP/WSDL/Transport/acceptance/test2.xml t/SOAP/WSDL/Transport/acceptance/test3.xml t/SOAP/WSDL/Transport/HTTP.t t/SOAP/WSDL/Typelib/Fault11.t t/SOAP/WSDL/Types.t t/SOAP/WSDL/XSD/Attribute.t t/SOAP/WSDL/XSD/AttributeGroup.t t/SOAP/WSDL/XSD/Builtin.t t/SOAP/WSDL/XSD/ComplexType.t t/SOAP/WSDL/XSD/Element.t t/SOAP/WSDL/XSD/Enumeration.t t/SOAP/WSDL/XSD/Schema.t t/SOAP/WSDL/XSD/SimpleType.t t/SOAP/WSDL/XSD/Typelib/Attribute.t t/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.t t/SOAP/WSDL/XSD/Typelib/Builtin/anyType.t t/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.t t/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.t t/SOAP/WSDL/XSD/Typelib/Builtin/boolean.t t/SOAP/WSDL/XSD/Typelib/Builtin/byte.t t/SOAP/WSDL/XSD/Typelib/Builtin/date.t t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t t/SOAP/WSDL/XSD/Typelib/Builtin/decimal.t t/SOAP/WSDL/XSD/Typelib/Builtin/double.t t/SOAP/WSDL/XSD/Typelib/Builtin/duration.t t/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.t t/SOAP/WSDL/XSD/Typelib/Builtin/float.t t/SOAP/WSDL/XSD/Typelib/Builtin/gDay.t t/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.t t/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.t t/SOAP/WSDL/XSD/Typelib/Builtin/gYear.t t/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.t t/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.t t/SOAP/WSDL/XSD/Typelib/Builtin/ID.t t/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.t t/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.t t/SOAP/WSDL/XSD/Typelib/Builtin/int.t t/SOAP/WSDL/XSD/Typelib/Builtin/integer.t t/SOAP/WSDL/XSD/Typelib/Builtin/language.t t/SOAP/WSDL/XSD/Typelib/Builtin/list.t t/SOAP/WSDL/XSD/Typelib/Builtin/long.t t/SOAP/WSDL/XSD/Typelib/Builtin/Name.t t/SOAP/WSDL/XSD/Typelib/Builtin/NCName.t t/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.t t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.t t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.t t/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.t t/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.t t/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.t t/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.t t/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.t t/SOAP/WSDL/XSD/Typelib/Builtin/QName.t t/SOAP/WSDL/XSD/Typelib/Builtin/short.t t/SOAP/WSDL/XSD/Typelib/Builtin/string.t t/SOAP/WSDL/XSD/Typelib/Builtin/time.t t/SOAP/WSDL/XSD/Typelib/Builtin/token.t t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.t t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.t t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.t t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.t t/SOAP/WSDL/XSD/Typelib/ComplexType.t t/SOAP/WSDL/XSD/Typelib/Element.t t/SOAP/WSDL_1.wsdl t/SOAP/WSDL_EMPTY_DEFINITIONS.wsdl t/SOAP/WSDL_NO_BINDING.wsdl t/SOAP/WSDL_NO_MESSAGE.wsdl t/SOAP/WSDL_NO_PORTTYPE.wsdl t/test.wsdl TEST_COVERAGE test_html.pl TODO META.json Module JSON meta-data (added by MakeMaker) SOAP-WSDL-3.003/README0000644000175000017500000000231212375112740010630 0ustar INTRO ----- SOAP-WSDL provides a SOAP client with WSDL support. SUBCLASSING ----------- SOAP-WSDL is still under very active development. Please don't build applications using the following modules directly: - SOAP::WSDL::Definitions - SOAP::WSDL::Port - SOAP::WSDL::PortType - SOAP::WSDL::Binding - SOAP::WSDL::Message - SOAP::WSDL::Operation - SOAP::WSDL::OpMessage - SOAP::WSDL::Part - SOAP::WSDL::Service - SOAP::WSDL::Types - SOAP::WSDL::XSD::Schema Those will be replaced some time in the future. INSTALLING ---------- Use the following mantra: perl Build.PL perl Build perl Build test perl Build install If you don't have Module::Build installed, you may also use perl Makefile.PL make make test make install Note that Module::Build is the recommended installer - make will not run all tests provided with SOAP-WSDL. SOLARIS INSTALLATION NOTES -------------------------- According to a CPAN RT report http://rt.cpan.org/Ticket/Display.html?id=36865 it may be necessary to check (and possibly update) the expat libraries required by XML::Parser. SOAP::WSDL's metadata includes XML::Parser, but it seems that the expat libraries XML::Parser depends on may slip through missing or outdated.SOAP-WSDL-3.003/Makefile.PL0000644000175000017500000000272112405763414011732 0ustar use 5.010000; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'SOAP::WSDL', VERSION_FROM => 'lib/SOAP/WSDL.pm', PREREQ_PM => { 'Class::Std::Fast' => q(0.000005), 'Cwd' => 0, 'Data::Dumper' => 0, 'Date::Format' => 0, 'Date::Parse' => 0, 'File::Basename' => 0, 'File::Path' => 0, 'File::Spec' => 0, 'Getopt::Long' => 0, 'LWP::UserAgent' => 0, 'List::Util' => 0, 'Module::Build' => 0, 'Storable' => 0, 'Template' => q(2.18), 'Term::ReadKey' => 0, 'Test::More' => 0, 'URI' => 0, 'XML::Parser::Expat' => 0, 'Class::Load' => 0.20, 'perl' => q(5.008), }, test => { RECURSIVE_TEST_FILES => 1, }, ABSTRACT_FROM => 'lib/SOAP/WSDL.pm', AUTHOR => 'Scott Walters ', (eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', url => 'https://github.com/scrottie/SOAP-WSDL.git', web => 'https://github.com/scrottie/SOAP-WSDL', }, }}) : () ), ); SOAP-WSDL-3.003/lib/0000755000175000017500000000000012507276245010530 5ustar SOAP-WSDL-3.003/lib/SOAP/0000755000175000017500000000000012507276245011272 5ustar SOAP-WSDL-3.003/lib/SOAP/WSDL.pm0000644000175000017500000006310312507274706012404 0ustar package SOAP::WSDL; use strict; use warnings; use 5.008; # require at least perl 5.8 use vars qw($AUTOLOAD); use Carp; use Scalar::Util qw(blessed); use SOAP::WSDL::Client; use SOAP::WSDL::Expat::WSDLParser; use Class::Std::Fast constructor => 'none'; use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; use LWP::UserAgent; # perl -p -i -e 's{our \$VERSION = 3\.\d*;}{our \$VERSION = 3.003;}' `ack -l 'our \\$VERSION = '` # in the lib/ directory, to change version numbers our $VERSION = 3.003; my %no_dispatch_of :ATTR(:name); my %wsdl_of :ATTR(:name); my %autotype_of :ATTR(:name); my %outputxml_of :ATTR(:name :default<0>); my %outputtree_of :ATTR(:name); my %outputhash_of :ATTR(:name); my %servicename_of :ATTR(:name); my %portname_of :ATTR(:name); my %class_resolver_of :ATTR(:name); my %method_info_of :ATTR(:default<()>); my %port_of :ATTR(:default<()>); my %porttype_of :ATTR(:default<()>); my %binding_of :ATTR(:default<()>); my %service_of :ATTR(:default<()>); my %definitions_of :ATTR(:get :default<()>); my %serialize_options_of :ATTR(:default<()>); my %client_of :ATTR(:name :default<()>); my %keep_alive_of :ATTR(:name :default<0> ); my %LOOKUP = ( no_dispatch => \%no_dispatch_of, class_resolver => \%class_resolver_of, wsdl => \%wsdl_of, autotype => \%autotype_of, outputxml => \%outputxml_of, outputtree => \%outputtree_of, outputhash => \%outputhash_of, portname => \%portname_of, servicename => \%servicename_of, keep_alive => \%keep_alive_of, ); sub readable { carp <<'EOT'; 'readable' has no effect any more. If you want formatted XML, copy the debug output to your favorite XML editor and run the source format command. EOT return; } sub set_readable; *set_readable = \&readable; for my $method (keys %LOOKUP ) { no strict qw(refs); ## no critic (ProhibitNoStrict) *{ $method } = sub { my $self = shift; my $ident = ident $self; if (@_) { $LOOKUP{ $method }->{ $ident } = shift; return $self; } return $LOOKUP{ $method }->{ $ident }; }; } { # just a BLOCK for scoping warnings. # we need to roll our own for supporting # SOAP::WSDL->new( key => value ) syntax, # like SOAP::Lite does. Class::Std enforces a single hash ref as # parameters to new() no warnings qw(redefine); ## no critic ProhibitNoWarnings; sub new { my ($class, %args_from) = @_; my $self = \do { my $foo = Class::Std::Fast::ID() }; bless $self, $class; for (keys %args_from) { my $method = $self->can("set_$_") or croak "unknown parameter $_ passed to new"; $method->($self, $args_from{$_}); } my $ident = ident $self; $client_of{ $ident } = SOAP::WSDL::Client->new(); $self->wsdlinit() if ($wsdl_of{ $ident }); return $self; } } sub set_proxy { my $self = shift; return $self->get_client()->set_proxy(@_); } sub get_proxy { my $self = shift; return $self->get_client()->get_proxy(); } sub proxy { my $self = shift; if (@_) { return $self->set_proxy(@_); } return $self->get_proxy(); } sub wsdlinit { my ($self, %opt) = @_; my $ident = ident $self; my $lwp = LWP::UserAgent->new( $keep_alive_of{ $ident } ? (keep_alive => 1) : () ); $lwp->agent(qq[SOAP::WSDL $VERSION]); my $response = $lwp->get( $wsdl_of{ $ident } ); croak $response->message() if ($response->code != 200); my $parser = SOAP::WSDL::Expat::WSDLParser->new(); $parser->parse_string( $response->content() ); my $wsdl_definitions = $parser->get_data(); # sanity checks my $types = $wsdl_definitions->first_types() or croak "unable to extract schema from WSDL"; my $ns = $wsdl_definitions->get_xmlns(); # setup lookup variables $definitions_of{ $ident } = $wsdl_definitions; $serialize_options_of{ $ident } = { autotype => 0, typelib => $types, namespace => $ns, }; $servicename_of{ $ident } = $opt{servicename} if $opt{servicename}; $portname_of{ $ident } = $opt{portname} if $opt{portname}; $self->_wsdl_init_methods(); # pass-through keep_alive if we need it... $self->get_client()->set_proxy( $port_of{ $ident }->first_address()->get_location(), $keep_alive_of{ $ident } ? (keep_alive => 1) : (), ); return $self; } ## end sub wsdlinit sub _wsdl_get_service :PRIVATE { my $ident = ident shift; my $wsdl = $definitions_of{ $ident }; return $service_of{ $ident } = $servicename_of{ $ident } ? $wsdl->find_service( $wsdl->get_targetNamespace() , $servicename_of{ $ident } ) : ( $service_of{ $ident } = $wsdl->get_service()->[ 0 ] ); } ## end sub _wsdl_get_service sub _wsdl_get_port :PRIVATE { my $ident = ident shift; my $wsdl = $definitions_of{ $ident }; my $ns = $wsdl->get_targetNamespace(); return $port_of{ $ident } = $portname_of{ $ident } ? $service_of{ $ident }->get_port( $ns, $portname_of{ $ident } )->[ 0 ] : ( $port_of{ $ident } = $service_of{ $ident }->get_port()->[ 0 ] ); } sub _wsdl_get_binding :PRIVATE { my $self = shift; my $ident = ident $self; my $wsdl = $definitions_of{ $ident }; my $port = $self->_wsdl_get_port(); $binding_of{ $ident } = $wsdl->find_binding( $port->expand( $port->get_binding() ) ) or croak "no binding found for ", $port->get_binding(); return $binding_of{ $ident }; } sub _wsdl_get_portType :PRIVATE { my $self = shift; my $ident = ident $self; my $wsdl = $definitions_of{ $ident }; my $binding = $self->_wsdl_get_binding(); $porttype_of{ $ident } = $wsdl->find_portType( $binding->expand( $binding->get_type() ) ) or croak "cannot find portType for " . $binding->get_type(); return $porttype_of{ $ident }; } sub _wsdl_init_methods :PRIVATE { my $self = shift; my $ident = ident $self; my $wsdl = $definitions_of{ $ident }; my $ns = $wsdl->get_targetNamespace(); # get bindings, portType, message, part(s) - use private methods for clear separation... $self->_wsdl_get_service(); $self->_wsdl_get_portType(); $method_info_of{ $ident } = {}; foreach my $binding_operation (@{ $binding_of{ $ident }->get_operation() }) { my $method = {}; # get SOAP Action # SOAP-Action is a required HTTP Header, so we need to look it up... # There must be a soapAction uri - or the WSDL is invalid (and # it's not us to prove that...) my $soap_binding_operation = $binding_operation->get_operation()->[0]; $method->{ soap_action } = $soap_binding_operation->get_soapAction(); # get parts # 1. get operation from port my $operation = $porttype_of{ $ident }->find_operation( $ns, $binding_operation->get_name() ); # 2. get input message name my ( $prefix, $localname ) = split /:/xm, $operation->first_input()->get_message(); # 3. get input message my $message = $wsdl->find_message( $ns, $localname ) or croak "Message {$ns}$localname not found in WSDL definition"; # Is body not required? So there must be one? Do we need the "if"? # if ( my $body=$binding_operation->first_input()->first_body(); # { if ($body->get_parts()) { $method->{ parts } = []; # make sure it's empty my $message_part_ref = $message->get_part(); for my $name ( split m{\s}xm , $body->get_parts() ) { $name =~s{ \A [^:]+: }{}xm; # throw away ns prefix # could probably made more efficient, but our lists are # usually quite short push @{ $method->{ parts } }, grep { $_->get_name() eq $name } @{ $message_part_ref }; } } # } # A body does not need to specify the parts of a messages. # Use all of the message's parts if it does not. $method->{ parts } ||= $message->get_part(); # rpc / encoded methods may have a namespace specified. # look it up and set it... $method->{ namespace } = $binding_operation ? do { my $input = $binding_operation->first_input(); $input ? $input->first_body()->get_namespace() : undef; } : undef; $method_info_of{ $ident }->{ $binding_operation->get_name() } = $method; } return $method_info_of{ $ident }; } # on_action is a no-op and just here for compatibility reasons. # It returns the first parameter to allow method chaining. sub on_action { return shift } sub call { my ($self, $method, @data_from) = @_; my $ident = ${ $self }; my ($data, $header) = ref $data_from[0] ? ($data_from[0], $data_from[1] ) : (@data_from>1) ? ( { @data_from }, undef ) : ( $data_from[0], undef ); $self->wsdlinit() if not ($definitions_of{ $ident }); $self->_wsdl_init_methods() if not ($method_info_of{ $ident }); my $client = $client_of{ $ident }; $client->set_no_dispatch( $no_dispatch_of{ $ident } ); $client->set_outputxml( $outputxml_of{ $ident } ? 1 : 0 ); # only load ::Deserializer::SOM if we really need to deserialize to SOM. # maybe we should introduce something like $output{ $ident } with a fixed # set of values - m{^(TREE|HASH|XML|SOM)$}xms ? if ( ( ! $outputtree_of{ $ident } ) && ( ! $outputhash_of{ $ident } ) && ( ! $outputxml_of{ $ident } ) && ( ! $no_dispatch_of{ $ident } ) ) { require SOAP::WSDL::Deserializer::SOM; $client->set_deserializer( SOAP::WSDL::Deserializer::SOM->new() ); } my $method_info = $method_info_of{ $ident }->{ $method }; # TODO serialize both header and body, not only header my (@response) = (blessed $data) ? $client->call( { operation => $method, soap_action => $method_info->{ soap_action }, }, $data ) : do { my $content = q{}; # TODO support RPC-encoding: Top-Level element + namespace... foreach my $part ( @{ $method_info->{ parts } } ) { $content .= $part->serialize( $method, $data, { %{ $serialize_options_of{ $ident } } } ); } $client->call( { operation => $method, soap_action => $method_info->{ soap_action } }, # absolutely stupid, but we need a reference which # serializes to XML on stringification... SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => $content }), SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => $header }) ); }; return if not @response; # nothing to do for one-ways return wantarray ? @response : $response[0]; } 1; __END__ =pod =head1 NAME SOAP::WSDL - SOAP with WSDL support =head1 NOTICE This module is B recommended for new application development. Please use L or L instead if possible. This module has a large number of known bugs and is not being actively developed. This 3.0 release is intended to update the module to pass tests on newer Perls. This is a service to existing applications already dependent on this module. =head1 SYNOPSIS my $soap = SOAP::WSDL->new( wsdl => 'file://bla.wsdl', ); my $result = $soap->call('MyMethod', %data); =head1 DESCRIPTION For creating Perl classes instrumenting a web service with a WSDL definition, read L. For using an interpreting (thus slow and somewhat troublesome) WSDL based SOAP client, which mimics L's API, read on. Creating Interface classes is the recommended usage. Did I say you should create interface classes following the steps in L? If you're migrating from earlier versions of SOAP::WSDL, you should read the MIGRATING documentation. The stuff below is for users of the 1.2x SOAP::WSDL series. All others, please refer to L SOAP::WSDL provides easy access to Web Services with WSDL descriptions. The WSDL is parsed and stored in memory. Your data is serialized according to the rules in the WSDL. The only transport mechanisms currently supported are http and https. =head1 METHODS =head2 new Constructor. All parameters passed are passed to the corresponding methods. =head2 call Performs a SOAP call. The result is either an object tree (with outputtree), a hash reference (with outputhash), plain XML (with outputxml) or a SOAP::SOM object (with neither of the above set). call() can be called in different ways: =over =item * Old-style idiom my $result = $soap->call('method', %data); Does not support SOAP header data. =item * New-style idiom my $result = $soap->call('method', $body_ref, $header_ref ); Does support SOAP header data. $body_ref and $header ref may either be hash refs or SOAP::WSDL::XSD::Typelib::* derived objects. Result headers are accessible via the result SOAP::SOM object. If outputtree or outputhash are set, you may also use the following to access response header data: my ($body, $header) = $soap->call('method', $body_ref, $header_ref ); =back =head2 wsdlinit Reads the WSDL file and initializes SOAP::WSDL for working with it. Is called automatically from call() if not called directly before. servicename portname call You may set servicename and portname by passing them as attributes to wsdlinit: $soap->wsdlinit( servicename => 'MyService', portname => 'MyPort', ); =head1 CONFIGURATION METHODS =head2 outputtree When outputtree is set, SOAP::WSDL will return an object tree instead of a SOAP::SOM object. You have to specify a class_resolver for this to work. See L =head2 class_resolver Set the class resolver class (or object). Class resolvers must implement the method get_class which has to return the name of the class name for deserializing a XML node at the current XPath location. Class resolvers are typically generated by using the generate_typemap method of a SOAP::WSDL::Generator subclass. Example: XML structure (SOAP body content): Smith John Class resolver package MyResolver; my %typemap = ( 'Person' => 'MyPersonClass', 'Person/Name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'Person/FirstName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', ); sub get_class { return $typemap{ $_[1] } }; 1; You'll need a MyPersonClass module in your search path for this to work - see SOAP::WSDL::XSD::ComplexType on how to build / generate one. =head2 servicename $soap->servicename('Name'); Sets the service to operate on. If no service is set via servicename, the first service found is used. Returns the soap object, so you can chain calls like $soap->servicename->('Name')->portname('Port'); =head2 portname $soap->portname('Name'); Sets the port to operate on. If no port is set via portname, the first port found is used. Returns the soap object, so you can chain calls like $soap->portname('Port')->call('MyMethod', %data); =head2 no_dispatch When set, call() returns the plain request XML instead of dispatching the SOAP call to the SOAP service. Handy for testing/debugging. =head1 ACCESS TO SOAP::WSDL's internals =head2 get_client / set_client Returns the SOAP client implementation used (normally a SOAP::WSDL::Client object). =head1 EXAMPLES See the examples/ directory. =head1 Differences to previous versions =over =item * WSDL handling SOAP::WSDL 2 is a complete rewrite. While SOAP::WSDL 1.x attempted to process the WSDL file on the fly by using XPath queries, SOAP:WSDL 2 uses a Expat handler for parsing the WSDL and building up a object tree representing 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 you're right; there's a builtin code generation facility. Read L for using it. =item * no_dispatch call() with no_dispatch set to true now returns the complete SOAP request envelope, not only the body's content. =item * outputxml call() with outputxml set to true now returns the complete SOAP response envelope, not only the body's content. =item * servicename/portname Both servicename and portname can only be called B calling wsdlinit(). You may pass the servicename and portname as attributes to wsdlinit, though. =back =head1 Differences to previous versions The following functionality is no longer supported: =head2 Operation overloading The SOAP standard allows operation overloading - that is, you may specify SOAP operations with more than one message. The client/server than can choose which message to send. This SOAP feature is usually used similar to the use of methods with different argument lists in C++. Operation overloading is no longer supported. The WS-I Basic profile does not operation overloading. The same functionality as operation overloading can be obtained by using a choice declaration in the XML Schema. =head2 readable Readable has no effect any more. If you need readable debug output, copy the SOAP message to your favorite XML editor and run the source format command. Outputting readable XML requires lots of programming for little use: The resulting XMl is still quite unreadable. =head2 on_action Setting on_action is not required any more, the appropriate value is automatically taken from the WSDL. on_action is a no-op, and is just here for compatibility issues. =head1 Differences to SOAP::Lite =head2 readable readable is a no-op in SOAP::WSDL. Actually, the XML output from SOAP::Lite is hardly readable, either with readable switched on. If you need readable XML messages, I suggest using your favorite XML editor for displaying and formatting. =head2 Message style/encoding While SOAP::Lite supports rpc/encoded style/encoding only, SOAP::WSDL currently supports document/literal style/encoding. =head2 autotype / type information SOAP::Lite defaults to transmitting XML type information by default, where SOAP::WSDL defaults to leaving it out. autotype(1) might even be broken in SOAP::WSDL - it's not well-tested, yet. =head2 Output formats In contrast to SOAP::Lite, SOAP::WSDL supports the following output formats: =over =item * SOAP::SOM objects. This is the default. SOAP::Lite is required for outputting SOAP::SOM objects. =item * Object trees. This is the recommended output format. You need a class resolver (typemap) for outputting object trees. See L above. =item * Hash refs This is for convenience: A single hash ref containing the content of the SOAP body. =item * xml See below. =back =head2 outputxml SOAP::Lite returns only the content of the SOAP body when outputxml is set to true. SOAP::WSDL returns the complete XML response. =head2 Auto-Dispatching SOAP::WSDL does B support auto-dispatching. This is on purpose: You may easily create interface classes by using SOAP::WSDL::Client and implementing something like sub mySoapMethod { my $self = shift; $soap_wsdl_client->call( mySoapMethod, @_); } You may even do this in a class factory - see L for creating such interfaces. =head2 Debugging / Tracing While SOAP::Lite features a global tracing facility, SOAP::WSDL allows to switch tracing on/of on a per-object base. This has to be done in the SOAP client used by SOAP::WSDL - see L for an example and L for details. =head1 BUGS AND LIMITATIONS The bug tracker is at L<< https://rt.cpan.org/Dist/Display.html?Queue=SOAP-WSDL >>. This module is in legacy maintenance mode. Only show stopper bugs are being fixed, until/unless someone wishes to resume active development on it. Scott Walters, C has obtained co-mainter from the CPAN admins for the purpose of applying existing fixes people have submit to the RT tracker, and to apply other fixes as needed to get the module to install and run on newer Perls. Non show-stopper bugs reports without fixes will be added to this list of limitations. Of course, fixes for these and other bugs are welcome. Scott does not get email from L<< rt.cpan.org >>, so please drop an email to him at C<< scott@slowass.net >> if you open a ticket there. =over =item * Breaks the idiom C<< $package->can("SUPER::method") >> in your code If you redefine C<< UNIVERSAL::can() >>, and someone tries to do C<< $package->can("SUPER::method") >>, it'll look at your packages C<@ISA>, not theirs. This module does precicely that, by way of its dependency on C. =item * $obj == undef does not work in perl 5.8.6 and perl 5.8.7 Due to some strange behaviour in perl 5.8.6 and perl 5.8.7, stringification overloading is not triggered during comparison with undef. While this is probably harmless in most cases, it's important to know that you need to do defined( $obj->get_value() ) to check for undef values in simpleType objects. =item * perl 5.8.0 or higher required SOAP::WSDL needs perl 5.8.0 or higher. This is due to a bug in perls before - see http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/929746 for details. =item * Apache SOAP datatypes are not supported You can't use SOAP::WSDL with Apache SOAP datatypes like map. =item * Incomplete XML Schema definitions support This section describes the limitations of SOAP::WSDL, that is the interpreting SOAP client. For limitations of L generated SOAP clients, see L. XML Schema attribute definitions are not supported in interpreting mode. The following XML Schema definitions varieties are not supported in interpreting mod: group simpleContent The following XML Schema definition content model is only partially supported in interpreting mode: complexContent - only restriction variety supported See L for details. =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. Passing in item => [1,2,3] could serialize to 1 23 12 3 Ambiguous data can be avoided by providing data as objects. =item * XML Schema facets Almost no XML schema facets are implemented. The only facets currently implemented are: fixed default The following facets have no influence: minLength maxLength minInclusive maxInclusive minExclusive maxExclusive pattern enumeration =back =head1 SEE ALSO =head2 Related projects =over =item * L Full featured SOAP-library, little WSDL support. Supports rpc-encoded style only. Many protocols supported. =item * L Creates parser/generator functions for SOAP messages. Includes SOAP Client 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. =back =head2 Sources of documentation =over =item * SOAP::WSDL homepage at sourceforge.net L =item * SOAP::WSDL forum at CPAN::Forum L =back =head1 ACKNOWLEDGMENTS Scott Walters wrote: This code incorporates fixes contributed by C<< NORDIC@cpan.org >>, C<< dam@cpan.org >>, C<< sven.schober@uni-ulm.de >>, myself, and others. Martin Kutter wrote: There are many people out there who fostered SOAP::WSDL's developement. I would like to thank them all (and apologize to all those I have forgotten). Giovanni S. Fois wrote a improved version of SOAP::WSDL (which eventually became v1.23) David Bussenschutt, Damian A. Martinez Gelabert, Dennis S. Hennen, Dan Horne, 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. JT Justman and Noah Robin provided early feedback and bug reports for the 2.xx pre-releases. Adam Kennedy checked and suggested improvements on metadata and dependencies in the 2.xx pre-releases. 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 and error reports for testing. Thank you. Noah Robin contributed lots of documentation fixes, and the mod_perl server, and eventually joined SOAP::WSDL's developement. Thanks. Mark Overmeer wrote XML::Compile::SOAP - competition is good for business. Paul Kulchenko and Byrne Reese wrote and maintained SOAP::Lite and thus provided a base (and counterpart) for SOAP::WSDL. =head1 LICENSE AND COPYRIGHT Copyright 2004-2008 Martin Kutter. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself =head1 AUTHOR Scott Walters Escott@slowass.net 2014 Martin Kutter Emartin.kutter fen-net.deE 2004-2008 =head1 REPOSITORY INFORMATION https://github.com/scrottie/SOAP-WSDL =cut SOAP-WSDL-3.003/lib/SOAP/WSDL/0000755000175000017500000000000012507276245012043 5ustar SOAP-WSDL-3.003/lib/SOAP/WSDL/Service.pm0000644000175000017500000000030412507274706013776 0ustar package SOAP::WSDL::Service; use strict; use warnings; use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Base); our $VERSION = 3.003; my %port_of :ATTR(:name :default<[]>); 1; SOAP-WSDL-3.003/lib/SOAP/WSDL/OpMessage.pm0000644000175000017500000000062012507274706014262 0ustar package SOAP::WSDL::OpMessage; use strict; use warnings; use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Base); our $VERSION = 3.003; my %body_of :ATTR(:name :default<[]>); my %header_of :ATTR(:name
:default<[]>); my %headerfault_of :ATTR(:name :default<[]>); my %message_of :ATTR(:name :default<()>); 1; SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/0000755000175000017500000000000012507276245012605 5ustar SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/HeaderFault.pm0000644000175000017500000000020312507274706015322 0ustar package SOAP::WSDL::SOAP::HeaderFault; use strict; use warnings; use base qw(SOAP::WSDL::SOAP::Header); our $VERSION = 3.003; 1; SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Header.pm0000644000175000017500000000075112507274706014336 0ustar package SOAP::WSDL::SOAP::Header; use strict; use warnings; use base qw(SOAP::WSDL::Base); use Class::Std::Fast::Storable; our $VERSION = 3.003; my %use_of :ATTR(:name :default); my %namespace_of :ATTR(:name :default); my %encodingStyle_of :ATTR(:name :default); my %message_of :ATTR(:name :default<()>); my %part_of :ATTR(:name :default); 1;SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Address.pm0000644000175000017500000000031212507274706014524 0ustar package SOAP::WSDL::SOAP::Address; use strict; use warnings; use base qw(SOAP::WSDL::Base); use Class::Std::Fast::Storable; our $VERSION = 3.003; my %location :ATTR(:name :default<()>); 1;SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Typelib/0000755000175000017500000000000012507276245014215 5ustar SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm0000644000175000017500000001114012507274706015765 0ustar package SOAP::WSDL::SOAP::Typelib::Fault11; { use strict; use warnings; use Class::Std::Fast::Storable constructor => 'none'; our $VERSION = 3.003; use Scalar::Util qw(blessed); use SOAP::WSDL::XSD::Typelib::ComplexType; use SOAP::WSDL::XSD::Typelib::Element; use base qw( SOAP::WSDL::SOAP::Typelib::Fault SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::ComplexType ); my %faultcode_of : ATTR(:get); my %faultstring_of : ATTR(:get); my %faultactor_of : ATTR(:get); my %detail_of : ATTR(:get); __PACKAGE__->_factory( [qw(faultcode faultstring faultactor detail)], { faultcode => \%faultcode_of, faultstring => \%faultstring_of, faultactor => \%faultactor_of, detail => \%detail_of, }, { faultcode => 'SOAP::WSDL::XSD::Typelib::Builtin::QName', faultstring => 'SOAP::WSDL::XSD::Typelib::Builtin::string', faultactor => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', detail => 'SOAP::WSDL::SOAP::Typelib::Fault11Detail', } ); sub get_xmlns { return 'http://schemas.xmlsoap.org/soap/envelope/' } __PACKAGE__->__set_name('Fault'); __PACKAGE__->__set_nillable(0); __PACKAGE__->__set_minOccurs(); __PACKAGE__->__set_maxOccurs(); __PACKAGE__->__set_ref(''); # always return false in boolean context - a fault is never true... sub as_bool : BOOLIFY { return; } # override set_detail to allow "auto-vivification" of a details object # must be implemented via symbol table operation - _factory adds # methods via symbol table, too. # BLOCK to scope warnings { no warnings qw(redefine); my $set_detail_sub = \&set_detail; *set_detail = sub { my ( $self, $detail ) = @_; # create SOAP::WSDL::SOAP::Typelib::Fault11Detail wrapper if there # is none if ( not blessed $detail or not $detail->isa('SOAP::WSDL::SOAP::Typelib::Fault11Detail') ) { $detail = SOAP::WSDL::SOAP::Typelib::Fault11Detail->new( {value => $detail} ); } # call original method $set_detail_sub->( $self, $detail ); }; } Class::Std::initialize(); } package SOAP::WSDL::SOAP::Typelib::Fault11Detail; { use strict; use warnings; use Class::Std::Fast::Storable constructor => 'none'; use base qw( SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType ); sub get_xmlns { return 'http://schemas.xmlsoap.org/soap/envelope/' } __PACKAGE__->__set_name('Fault'); __PACKAGE__->__set_nillable(0); __PACKAGE__->__set_minOccurs(); __PACKAGE__->__set_maxOccurs(); Class::Std::initialize(); } 1; =pod =head1 NAME SOAP::WSDL::SOAP::Typelib::Fault11 - SOAP 1.1 Fault class =head1 DESCRIPTION Models a SOAP 1.1 Fault. SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context and serialize to XML on stringification. This means you can do something like: my $soap = SOAP::WSDL::Client->new(); # ... my $result = $soap->call($method, $data); if (not $result) { die "Error calling SOAP method: ", $result->get_faultstring(); } =head1 METHODS =head2 get_faultcode / set_faultcode Getter/setter for object's faultcode property. =head2 get_faultstring / set_faultstring Getter/setter for object's faultstring property. =head2 get_faultactor / set_faultactor Getter/setter for object's faultactor property. =head2 get_detail / set_detail Getter/setter for detail object's detail property. The detail element is a SOAP::WSDL::SOAP::Typelib::Fault11Detail object. This class is automatically loaded when using SOAP::WSDL::SOAP::Typelib::Fault11, so you can't B it separately. Any string or object not of this class will be automatically wrapped into a detail object. Note that passing a list of detail object is currently not supported (though the SOAP1.1 note allows this). =head1 LICENSE AND COPYRIGHT Copyright 2007 Martin Kutter. All rights reserved. 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: 851 $ $LastChangedBy: kutterma $ $Id: Fault11.pm 851 2009-05-15 22:45:18Z kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $ =cut SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Typelib/Fault.pm0000644000175000017500000000022412507274706015624 0ustar package SOAP::WSDL::SOAP::Typelib::Fault; use strict; use warnings; use Class::Std::Fast::Storable constructor => 'none'; our $VERSION = 3.003; 1;SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Body.pm0000644000175000017500000000064412507274706014044 0ustar package SOAP::WSDL::SOAP::Body; use strict; use warnings; use base qw(SOAP::WSDL::Base); use Class::Std::Fast::Storable; our $VERSION = 3.003; my %use_of :ATTR(:name :default); my %namespace_of :ATTR(:name :default); my %encodingStyle_of :ATTR(:name :default); my %parts_of :ATTR(:name :default); 1;SOAP-WSDL-3.003/lib/SOAP/WSDL/SOAP/Operation.pm0000644000175000017500000000040212507274706015077 0ustar package SOAP::WSDL::SOAP::Operation; use strict; use warnings; use Class::Std::Fast::Storable; use base qw(SOAP::WSDL::Base); our $VERSION = 3.003; my %style_of :ATTR(:name