import SOAP-WSDL 2.00_33 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_33 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_33.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
51db446428
commit
0cbf981665
@@ -20,7 +20,7 @@ my @dir_from = File::Spec->splitdir($dir);
|
||||
unshift @dir_from, $volume if $volume;
|
||||
my $url = join '/', @dir_from;
|
||||
|
||||
my $parser;
|
||||
my $parser;
|
||||
|
||||
ok $parser = SOAP::WSDL::Expat::MessageParser->new({
|
||||
class_resolver => FakeResolver->new(),
|
||||
@@ -56,11 +56,13 @@ q{<SOAP-ENV:Envelope
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
>
|
||||
<SOAP-ENV:Body ><EnqueueMessage><MMessage>
|
||||
<MRecipientURI>mailto:test@example.com</MRecipientURI>
|
||||
<MMessageContent>TestContent for Message</MMessageContent>
|
||||
<MMessageContent>TestContent for Message 2</MMessageContent>
|
||||
<MMessageContent xsi:nil="true"></MMessageContent>
|
||||
<MSenderAddress>martin.kutter@example.com</MSenderAddress>
|
||||
<MDeliveryReportRecipientURI>mailto:test@example.com</MDeliveryReportRecipientURI>
|
||||
</MMessage></EnqueueMessage></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ ok $interface->EnqueueMessage(
|
||||
MMessageContent => 'content',
|
||||
MSubject => 'subject',
|
||||
MDeliveryReportRecipientURI => 'mailto:report.recipient@example.org',
|
||||
}
|
||||
}
|
||||
}),
|
||||
'interface operation call (no_dispatch set)';
|
||||
|
||||
|
||||
+19
-1
@@ -48,6 +48,24 @@ sub filelist {
|
||||
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/Whitespace\.pm$}xms;
|
||||
|
||||
push @filelist, $File::Find::name;
|
||||
}
|
||||
@@ -59,4 +77,4 @@ for my $file (sort @filelist) {
|
||||
\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");
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -2,18 +2,18 @@ use Test::More;
|
||||
eval "use Test::Pod 1.00";
|
||||
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
|
||||
|
||||
# perl Build test or make test run from top-level dir.
|
||||
if ( -d '../t/' ) {
|
||||
@directories = ('../lib/');
|
||||
}
|
||||
else {
|
||||
@directories = (); # empty - will work automatically
|
||||
my @dir_from = ();
|
||||
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(@directories);
|
||||
my @files = all_pod_files(@dir_from);
|
||||
|
||||
plan tests => scalar(@files);
|
||||
|
||||
foreach my $module (@files){
|
||||
pod_file_ok( $module )
|
||||
}
|
||||
pod_file_ok( $module )
|
||||
}
|
||||
|
||||
+20
-16
@@ -12,11 +12,11 @@ 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;
|
||||
# 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
|
||||
@@ -34,25 +34,29 @@ else { # we are outside t/
|
||||
|SOAP::WSDL::Part
|
||||
|SOAP::WSDL::Operation
|
||||
|SOAP::WSDL::SOAP::[^:]+
|
||||
|SOAP::WSDL::XSD::Attribute
|
||||
|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::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$/
|
||||
]
|
||||
});
|
||||
pod_coverage_ok( $_ ,
|
||||
{
|
||||
private => [
|
||||
qr/^_/,
|
||||
qr/^BUILD$/,
|
||||
qr/^START$/,
|
||||
qr/^STORABLE/,
|
||||
qr/^AUTOMETHOD$/,
|
||||
qr/^DEMOLISH$/
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -91,7 +91,8 @@ isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
);
|
||||
|
||||
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
is $result[0], undef;
|
||||
is $result[0], q{};
|
||||
|
||||
is $result[1], 'Header2';
|
||||
isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
|
||||
@@ -116,7 +117,7 @@ isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
});
|
||||
|
||||
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
is $result[0], undef;
|
||||
is $result[0], q{};
|
||||
|
||||
eval { $client->call({
|
||||
operation => 'sayHello',
|
||||
@@ -139,7 +140,8 @@ eval { $client->call({
|
||||
like $@, qr{ Can't \s locate }xms;
|
||||
|
||||
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||
is $result[0], undef;
|
||||
|
||||
is $result[0], q{};
|
||||
|
||||
eval { $client->call({
|
||||
operation => 'sayHello',
|
||||
@@ -161,4 +163,4 @@ eval { $client->call({
|
||||
})
|
||||
};
|
||||
# die $@;
|
||||
like $@, qr{ Can't \s locate }xms;
|
||||
like $@, qr{ Can't \s locate }xms;
|
||||
|
||||
@@ -30,15 +30,6 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
||||
OUTPUT_PATH => "$path/testlib",
|
||||
});
|
||||
|
||||
#my $code = "";
|
||||
#$generator->set_output(\$code);
|
||||
#$generator->generate_typelib();
|
||||
#{
|
||||
# eval $code;
|
||||
# ok !$@;
|
||||
# print $@ if $@;
|
||||
#}
|
||||
|
||||
$definitions = $parser->parse_uri(
|
||||
"file://$path/../../../acceptance/wsdl/WSDLParser-import.wsdl"
|
||||
);
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
|
||||
eval { SOAP::WSDL::Factory::Serializer->get_serializer({
|
||||
soap_version => 'zumsl'
|
||||
eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => 'zumsl'
|
||||
}) };
|
||||
like $@, qr{^no serializer};
|
||||
like $@, qr{^no deserializer};
|
||||
|
||||
ok my $serializer = SOAP::WSDL::Factory::Serializer->get_serializer({
|
||||
soap_version => '1.1'
|
||||
ok my $serializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => '1.1'
|
||||
});
|
||||
ok $serializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({});
|
||||
|
||||
SOAP::WSDL::Factory::Serializer->register('1.1', 'Hope_You_Have_No_Such_Package_Installed');
|
||||
SOAP::WSDL::Factory::Deserializer->register('1.1', 'Hope_You_Have_No_Such_Package_Installed');
|
||||
|
||||
eval { SOAP::WSDL::Factory::Serializer->get_serializer({
|
||||
soap_version => '1.1'
|
||||
eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => '1.1'
|
||||
}) };
|
||||
like $@, qr{^Cannot load};
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use SOAP::WSDL::Factory::Deserializer;
|
||||
use SOAP::WSDL::Factory::Serializer;
|
||||
|
||||
eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => 'zumsl'
|
||||
eval { SOAP::WSDL::Factory::Serializer->get_serializer({
|
||||
soap_version => 'zumsl'
|
||||
}) };
|
||||
like $@, qr{^no deserializer};
|
||||
like $@, qr{^no serializer};
|
||||
|
||||
ok my $serializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => '1.1'
|
||||
ok my $serializer = SOAP::WSDL::Factory::Serializer->get_serializer({
|
||||
soap_version => '1.1'
|
||||
});
|
||||
|
||||
SOAP::WSDL::Factory::Deserializer->register('1.1', 'Hope_You_Have_No_Such_Package_Installed');
|
||||
ok $serializer = SOAP::WSDL::Factory::Serializer->get_serializer({});
|
||||
|
||||
eval { SOAP::WSDL::Factory::Deserializer->get_deserializer({
|
||||
soap_version => '1.1'
|
||||
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};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw(no_plan);
|
||||
use Test::More tests => 2;
|
||||
use Template;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
|
||||
@@ -4,11 +4,23 @@ 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(), 'constructor';
|
||||
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;
|
||||
|
||||
@@ -24,12 +36,21 @@ $parser->parse_file(
|
||||
|
||||
my $definitions = $parser->get_data();
|
||||
|
||||
$definitions->_accept( $visitor );
|
||||
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'}, 'MyTypes::TKeepalive', 'content';
|
||||
is $typemap->{'EnqueueMessageResponse'}, 'MyElements::EnqueueMessageResponse', 'content';
|
||||
is $typemap->{'KeepaliveMessageResponse'}, 'MyElements::KeepaliveMessageResponse', 'content';
|
||||
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{<?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -137,4 +158,4 @@ xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
</service>
|
||||
</definitions>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
use File::Spec;
|
||||
use File::Basename;
|
||||
eval { require XML::Compile::WSDL11 }
|
||||
or plan skip_all => 'Cannot test without XML::Compile::WSDL11';
|
||||
|
||||
eval { require XML::LibXML }
|
||||
or plan skip_all => 'Cannot test without XML::LibXML';
|
||||
|
||||
plan skip_all => 'XML::Compile::WSDL11 is not functional yet';
|
||||
|
||||
plan qw(no_plan);
|
||||
|
||||
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
||||
|
||||
my $libxml = XML::LibXML->new();
|
||||
my $xml = $libxml->parse_file("$path/../../../acceptance/wsdl/generator_test.wsdl");
|
||||
|
||||
my $wsdl = XML::Compile::WSDL11->new($xml);
|
||||
my $schemas = $wsdl->schemas;
|
||||
ok my $operation = $wsdl->operation('testHeader');
|
||||
|
||||
#die Dumper $operation;
|
||||
#
|
||||
#my $client = $operation->prepareClient();
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 42;
|
||||
use Test::More tests => 49;
|
||||
use File::Basename qw(dirname);
|
||||
use File::Spec;
|
||||
use File::Path;
|
||||
@@ -156,9 +156,40 @@ ok my $empty = MyElements::testElementCompletelyEmptyComplex->new();
|
||||
is $empty->serialize_qualified(), '<testElementCompletelyEmptyComplex xmlns="urn:Test"/>'
|
||||
, '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{<testElementComplexTypeSequenceWithAttribute xmlns="urn:Test" }
|
||||
. q{testAttr="foobar"><Test1>foo</Test1><Test2>bar</Test2>}
|
||||
. q{</testElementComplexTypeSequenceWithAttribute>}
|
||||
, '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{<baz testAttr="bar">foo</baz>};
|
||||
|
||||
SKIP: {
|
||||
eval { require Test::Pod::Content; }
|
||||
or skip 'Cannot test pod content without Test::Pod::Content', 1;
|
||||
Test::Pod::Content::pod_section_like(
|
||||
'MyTypes::testComplexTypeSequenceWithAttribute',
|
||||
'attr',
|
||||
qr{Test \s Attribute \s good \s for \s nothing}x,
|
||||
'Attribute POD');
|
||||
}
|
||||
|
||||
rmtree "$path/testlib";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 12;
|
||||
use Test::More tests => 14;
|
||||
use File::Basename qw(dirname);
|
||||
use File::Spec;
|
||||
use File::Path;
|
||||
@@ -12,7 +12,7 @@ use SOAP::WSDL::Expat::WSDLParser;
|
||||
|
||||
my $parser = SOAP::WSDL::Expat::WSDLParser->new();
|
||||
|
||||
my $definitions = $parser->parse_file(
|
||||
my $definitions = $parser->parse_file(
|
||||
"$path/../../../acceptance/wsdl/generator_test_dot_names.wsdl"
|
||||
#"$path/../../../acceptance/wsdl/elementAtomicComplexType.xml"
|
||||
);
|
||||
@@ -26,7 +26,7 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
||||
});
|
||||
|
||||
my $code = "";
|
||||
$generator->set_output(\$code);
|
||||
$generator->set_output(\$code);
|
||||
$generator->generate_typelib();
|
||||
{
|
||||
eval $code;
|
||||
@@ -47,9 +47,9 @@ $generator->generate();
|
||||
#$generator->generate_typemap();
|
||||
|
||||
if (eval { require Test::Warn; }) {
|
||||
Test::Warn::warning_like( sub { $generator->generate_interface() },
|
||||
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 };
|
||||
@@ -61,38 +61,40 @@ 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);
|
||||
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',
|
||||
'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',
|
||||
'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',
|
||||
'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',
|
||||
'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',
|
||||
'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',
|
||||
'MyServer::My::SOAP::testService::testPort',
|
||||
'SYNOPSIS',
|
||||
qr{\s MyServer::My::SOAP::testService::testPort->new\(}xms,
|
||||
'Pod SYNOPSIS section');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
use Test::More tests => 14;
|
||||
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::Visitor::Typelib);
|
||||
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",
|
||||
});
|
||||
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
#rmtree "$path/testlib";
|
||||
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{<SOAP-ENV:Envelope
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
<SOAP-ENV:Body >
|
||||
<sayHello xmlns="urn:HelloWorld" testAttr="Foo">
|
||||
<name>Kutter</name>
|
||||
<givenName testAttr="Bar">
|
||||
<givenName>Martin</givenName>
|
||||
<middleInitial>A.</middleInitial>
|
||||
</givenName>
|
||||
</sayHello>
|
||||
</SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||
}
|
||||
@@ -10,7 +10,7 @@ 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(
|
||||
my $definitions = $parser->parse_file(
|
||||
"$path/../../../acceptance/wsdl/generator_unsupported_test.wsdl"
|
||||
);
|
||||
|
||||
@@ -21,4 +21,4 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
||||
{
|
||||
eval { $generator->generate_typelib() };
|
||||
}
|
||||
ok $@;
|
||||
ok $@, $@;
|
||||
@@ -0,0 +1,23 @@
|
||||
use Test::More qw(no_plan);
|
||||
use lib 'testlib';
|
||||
#ok eval { require MyTypes::testComplexTypeSequenceWithAttribute; }
|
||||
# , 'load MyTypes::testComplexTypeSequenceWithAttribute';
|
||||
#
|
||||
#my $obj = MyTypes::testComplexTypeSequenceWithAttribute->new({
|
||||
# Test1 => 'foo',
|
||||
# Test2 => 'bar',
|
||||
#});
|
||||
#$obj->attr({ testAttr => 'foobar' });
|
||||
#
|
||||
#print $obj->attr();
|
||||
#
|
||||
|
||||
use_ok qw(MyElements::testElementComplexTypeSequenceWithAttribute);
|
||||
|
||||
my $obj = MyElements::testElementComplexTypeSequenceWithAttribute->new({
|
||||
Test1 => 'foo',
|
||||
Test2 => 'bar',
|
||||
});
|
||||
$obj->attr({ testAttr => 'foobar' });
|
||||
|
||||
print $obj;
|
||||
@@ -0,0 +1,34 @@
|
||||
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');
|
||||
@@ -0,0 +1,6 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 1; #qw(no_plan);
|
||||
|
||||
use_ok qw(SOAP::WSDL::XSD::AttributeGroup);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
@@ -1,6 +1,6 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 2; #qw(no_plan);
|
||||
use Test::More tests => 3; #qw(no_plan);
|
||||
|
||||
use_ok qw(SOAP::WSDL::XSD::ComplexType);
|
||||
|
||||
@@ -9,3 +9,13 @@ $obj->set_variety('extension');
|
||||
|
||||
eval { $obj->serialize('foo') };
|
||||
like $@, qr{sorry, \s we \s just}xsm;
|
||||
|
||||
$obj->set_targetNamespace('bar');
|
||||
|
||||
eval {
|
||||
$obj->serialize(
|
||||
'foo', 'bar', { autotype => 1 , namespace => {} }
|
||||
)
|
||||
};
|
||||
|
||||
like $@, qr{^No \s prefix \s found \s for \s namespace \s bar}x;
|
||||
@@ -0,0 +1,30 @@
|
||||
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{<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld" xmlns:s="http://www.w3.org/2001/XMLSchema">
|
||||
<s:simpleType name="test">
|
||||
<s:restriction base="s:string">
|
||||
<s:enumeration value="foo"/>
|
||||
<s:enumeration value="bar">
|
||||
<s:annotation>
|
||||
<s:documentation>foobar</s:documentation>
|
||||
</s:annotation>
|
||||
</s:enumeration>
|
||||
</s:restriction>
|
||||
</s:simpleType>
|
||||
</s:schema>
|
||||
};
|
||||
|
||||
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';
|
||||
@@ -1,21 +1,30 @@
|
||||
use Test::More tests => 9;
|
||||
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;
|
||||
is $NMTOKENS->get_value(), undef, 'get undef value';
|
||||
$NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({});
|
||||
is $NMTOKENS->get_value(), undef;
|
||||
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';
|
||||
is $NMTOKENS->serialize(), '127 Test', 'stringification';
|
||||
|
||||
ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => 'Test' });
|
||||
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 });
|
||||
is $NMTOKENS, undef, 'stringification';
|
||||
|
||||
#{
|
||||
# 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';
|
||||
ok $NMTOKENS->isa('SOAP::WSDL::XSD::Typelib::Builtin::list'), 'inheritance';
|
||||
|
||||
@@ -54,7 +54,7 @@ is $obj->get_value(), 'test2', 'get_value on attr value';
|
||||
|
||||
$obj->set_value(undef);
|
||||
|
||||
is $obj->serialize({ name => 'foo' }), '<foo></foo>'
|
||||
is $obj->serialize({ name => 'foo' }), '<foo xsi:nil="true"/>'
|
||||
, 'serialize undef value with name';
|
||||
is $obj->serialize(), q{}, 'serialize undef value without name';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 5;
|
||||
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->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{<foo>}, 'serialize with name';
|
||||
exit 0;
|
||||
|
||||
@@ -34,6 +34,8 @@ use base qw(
|
||||
|
||||
__PACKAGE__->__set_name( 'MyElement' );
|
||||
|
||||
sub __get_attr_class { 'MyElement::_ATTR' };
|
||||
|
||||
package MyElement::_ATTR;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
||||
{
|
||||
@@ -51,6 +53,7 @@ use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
package MyType2;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
@@ -67,8 +70,19 @@ __PACKAGE__->_factory(
|
||||
}
|
||||
);
|
||||
|
||||
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' };
|
||||
|
||||
package main;
|
||||
use Test::More tests => 109;
|
||||
use Test::More tests => 111;
|
||||
use Storable;
|
||||
|
||||
my $have_warn = eval { require Test::Warn; import Test::Warn; 1; };
|
||||
@@ -150,6 +164,12 @@ $nested = MyType2->new({
|
||||
|
||||
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 => [
|
||||
@@ -194,10 +214,7 @@ $obj->set_test();
|
||||
is $obj->get_test, (), 'removed element content';
|
||||
|
||||
$obj = MyEmptyType->new();
|
||||
eval {
|
||||
isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet';
|
||||
};
|
||||
like $@, qr{\s has \s no \s attributes}x;
|
||||
is $obj->attr(), undef;
|
||||
|
||||
$obj = MyElement->new();
|
||||
isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet';
|
||||
@@ -324,3 +341,7 @@ eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, { tes
|
||||
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(), '<MyElementSimpleContent xmlns="http://www.w3.org/2001/XMLSchema" test="foo" test2="bar">foo</MyElementSimpleContent>';
|
||||
|
||||
@@ -1,51 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HelloWorld"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HelloWorld"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema>
|
||||
<s:import namespace="urn:HelloWorld" schemaLocation="import.xsd"/>
|
||||
</s:schema>
|
||||
</types>
|
||||
</types>
|
||||
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
|
||||
</definitions>
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HelloWorld"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld">
|
||||
<s:element name="sayHello">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName"
|
||||
type="s:string" nillable="1" />
|
||||
</s:sequence>
|
||||
<s:attribute name="testAttr" type="s:string" use="optional"></s:attribute>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HelloWorld"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld">
|
||||
<s:element name="sayHello">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName"
|
||||
type="s:string" nillable="1" />
|
||||
</s:sequence>
|
||||
<s:attribute name="testAttr" type="s:string" use="optional"></s:attribute>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
|
||||
<s:element name="sayHelloResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1"
|
||||
name="sayHelloResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
</s:schema>
|
||||
</types>
|
||||
<s:element name="sayHelloResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1"
|
||||
name="sayHelloResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
</s:schema>
|
||||
</types>
|
||||
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<service name="Service1">
|
||||
<port name="Service1Soap" binding="s0:Service1Soap">
|
||||
<soap:address
|
||||
location="http://localhost:81/soap-wsdl-test/helloworld.pl" />
|
||||
</port>
|
||||
</service>
|
||||
<service name="Service1">
|
||||
<port name="Service1Soap" binding="s0:Service1Soap">
|
||||
<soap:address
|
||||
location="http://localhost:81/soap-wsdl-test/helloworld.pl" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
|
||||
@@ -88,35 +88,40 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
|
||||
<xsd:complexType name="testComplexTypeSimpleRestriction">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
<xsd:documentation>complexType with simpleContent test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="xsd:string">
|
||||
</xsd:restriction>
|
||||
<xsd:restriction base="xsd:long">
|
||||
<xsd:maxExclusive value="5"/>
|
||||
<xsd:minExclusive value="0"/>
|
||||
<xsd:maxInclusive value="1"/>
|
||||
<xsd:minInclusive value="4"/>
|
||||
<xsd:enumeration value="2"/>
|
||||
<xsd:enumeration value="4"/>
|
||||
<xsd:totalDigits value="1"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="testComplexTypeExtension">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>complexType extension test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="tns:testComplexTypeAll">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" />
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test3" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeChoice">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
<xsd:documentation>complexType extension test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="tns:testComplexTypeAll">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" />
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test3" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeChoice">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>ComplexType choice test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:choice>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
@@ -126,9 +131,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequence">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
@@ -136,11 +139,24 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequenceWithAttribute">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="testAttr" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Test Attribute good for nothing</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequence2">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
<xsd:documentation>ComplexType test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
@@ -148,6 +164,13 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testSimpleContentExtension">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="testAttr" type="xsd:string" use="optional"/>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="testElementString" type="xsd:string" />
|
||||
<xsd:element name="testElementInt" type="xsd:int" />
|
||||
@@ -155,7 +178,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
<xsd:element name="testElementSimpleTypeList" type="tns:testSimpleTypeList"/>
|
||||
<xsd:element name="testElementComplexTypeAll" type="tns:testComplexTypeAll"/>
|
||||
<xsd:element name="testElementComplexTypeSequence" type="tns:testComplexTypeSequence"/>
|
||||
|
||||
<xsd:element name="testElementComplexTypeSequenceWithAttribute" type="tns:testComplexTypeSequenceWithAttribute"/>
|
||||
<xsd:element name="testElementAtomicSimpleTypeRestriction">
|
||||
<xsd:simpleType>
|
||||
<xsd:annotation>
|
||||
@@ -180,30 +203,30 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="Header" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testHeader" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testChoice" type="tns:testComplexTypeChoice"/>
|
||||
<xsd:element name="Header" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testHeader" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testChoice" type="tns:testComplexTypeChoice"/>
|
||||
|
||||
|
||||
<xsd:complexType name="testComplexTypeElementAtomicSimpleType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="testString" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="testAtomicSimpleTypeElement" minOccurs="0">
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:decimal">
|
||||
<xsd:minInclusive value="0"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
<xsd:element name="testAtomicSimpleTypeElement2" minOccurs="0">
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:decimal">
|
||||
<xsd:minInclusive value="0"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="testComplexTypeElementAtomicSimpleType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="testString" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="testAtomicSimpleTypeElement" minOccurs="0">
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:decimal">
|
||||
<xsd:minInclusive value="0"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
<xsd:element name="testAtomicSimpleTypeElement2" minOccurs="0">
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:decimal">
|
||||
<xsd:minInclusive value="0"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:element name="testElementEmptyComplex">
|
||||
@@ -226,7 +249,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testChoice">
|
||||
<part name="parameters" element="tns:testChoice"/>
|
||||
<part name="parameters" element="tns:testChoice"/>
|
||||
</message>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
@@ -259,19 +282,19 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
<operation name="testHeader">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="tns:testHeaderRequest"/>
|
||||
<output message="tns:testHeaderResponse"/>
|
||||
</operation>
|
||||
<operation name="testChoice">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="tns:testChoice"/>
|
||||
<output message="tns:testChoice"/>
|
||||
</operation>
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="tns:testHeaderRequest"/>
|
||||
<output message="tns:testHeaderResponse"/>
|
||||
</operation>
|
||||
<operation name="testChoice">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="tns:testChoice"/>
|
||||
<output message="tns:testChoice"/>
|
||||
</operation>
|
||||
<operation name="testMultiPartWarning">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
@@ -284,34 +307,34 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
<input message="tns:testEmptyComplex"/>
|
||||
<output message="tns:testEmptyComplex"/>
|
||||
</operation>
|
||||
</portType>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="testChoice">
|
||||
<soap:operation soapAction="testChoice" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<soap:operation soapAction="testChoice" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<soap:operation soapAction="test" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="testHeader">
|
||||
<soap:operation soapAction="testHeader"/>
|
||||
<input>
|
||||
<soap:body use="literal" parts="tns:testBody"/>
|
||||
<soap:header use="literal" part="tns:testHeader" message="tns:testHeaderRequest"/>
|
||||
<input>
|
||||
<soap:body use="literal" parts="tns:testBody"/>
|
||||
<soap:header use="literal" part="tns:testHeader" message="tns:testHeaderRequest"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
@@ -337,60 +360,60 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</operation>
|
||||
|
||||
</binding>
|
||||
<wsdl:binding name="HTTPBinding" type="tns:testPort">
|
||||
<http:binding verb="GET" />
|
||||
<wsdl:operation name="test">
|
||||
<http:operation location="/test" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testHeader">
|
||||
<http:operation location="/testHeader" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testChoice">
|
||||
<http:operation location="/testChoice" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testMultiPartWarning">
|
||||
<http:operation location="/testMultiPartWarning" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testEmptyComplex">
|
||||
<http:operation location="/testEmptyComplex" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
<wsdl:port name="HTTPPort" binding="tns:HTTPBinding">
|
||||
<http:address location="http://www.example.org/"></http:address>
|
||||
</wsdl:port>
|
||||
<wsdl:binding name="HTTPBinding" type="tns:testPort">
|
||||
<http:binding verb="GET" />
|
||||
<wsdl:operation name="test">
|
||||
<http:operation location="/test" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testHeader">
|
||||
<http:operation location="/testHeader" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testChoice">
|
||||
<http:operation location="/testChoice" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testMultiPartWarning">
|
||||
<http:operation location="/testMultiPartWarning" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="testEmptyComplex">
|
||||
<http:operation location="/testEmptyComplex" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
<wsdl:port name="HTTPPort" binding="tns:HTTPBinding">
|
||||
<http:address location="http://www.example.org/"></http:address>
|
||||
</wsdl:port>
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
<definitions name="Test"
|
||||
targetNamespace="urn:Test"
|
||||
xmlns:tns="urn:Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
@@ -9,7 +9,7 @@
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:Test">
|
||||
<xsd:simpleType name="testSimpleTypeList">
|
||||
<xsd:simpleType name="test-SimpleTypeList">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer (length 2)
|
||||
@@ -43,7 +43,7 @@
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minExclusive value="0"/>
|
||||
<xsd:maxExclusive value="10"/>
|
||||
</xsd:restriction>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testRestrictionAtomicType">
|
||||
@@ -57,7 +57,7 @@
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minExclusive value="0"/>
|
||||
<xsd:maxExclusive value="10"/>
|
||||
</xsd:restriction>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
@@ -67,8 +67,8 @@
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
<xsd:element name="Test1" type="xsd:string" />
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
|
||||
<xsd:element name="Test-1" type="xsd:string" />
|
||||
<xsd:element name="Test-2" type="xsd:string" minOccurs="1" />
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:restriction base="tns:testComplexTypeAll">
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
|
||||
<xsd:element name="Test.1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test.2" type="xsd:string" minOccurs="1" />
|
||||
</xsd:restriction>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
@@ -139,17 +139,17 @@
|
||||
<xsd:element name="testElementString" type="xsd:string" />
|
||||
<xsd:element name="testElementInt" type="xsd:int" />
|
||||
<xsd:element name="testElementRefInt" ref="tns:testElementInt" />
|
||||
<xsd:element name="testElementSimpleTypeList" type="tns:testSimpleTypeList"/>
|
||||
<xsd:element name="testElementSimpleTypeList" type="tns:test-SimpleTypeList"/>
|
||||
<xsd:element name="testElementComplexTypeAll" type="tns:testComplexTypeAll"/>
|
||||
<xsd:element name="testElementComplexTypeSequence" type="tns:testComplexTypeSequence"/>
|
||||
|
||||
<xsd:element name="testElementAtomicSimpleTypeRestriction">
|
||||
<xsd:simpleType>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
(Inclusive constraints) </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:restriction base="xsd:int" minInclusive="1"
|
||||
<xsd:restriction base="xsd:int" minInclusive="1"
|
||||
maxInclusive="9"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
@@ -157,7 +157,7 @@
|
||||
<xsd:element name="testElementAtomicComplexTypeAll">
|
||||
<xsd:complexType>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
(Inclusive constraints) </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
@@ -170,8 +170,8 @@
|
||||
<xsd:element name="Header" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testHeader" type="tns:testComplexTypeSequence"/>
|
||||
<xsd:element name="testChoice" type="tns:testComplexTypeChoice"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<xsd:complexType name="testComplexTypeElementAtomicSimpleType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="testString" type="xsd:string" minOccurs="0"/>
|
||||
@@ -191,8 +191,8 @@
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
|
||||
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testChoice">
|
||||
@@ -202,7 +202,7 @@
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
</message>
|
||||
<message name="testMultiPartWarning">
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
@@ -213,7 +213,7 @@
|
||||
<part name="testHeader" element="tns:Header"/>
|
||||
</message>
|
||||
<message name="testHeaderResponse">
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
<part name="testAll" element="tns:testElementString"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
@@ -258,7 +258,7 @@
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
|
||||
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test" style="document"/>
|
||||
<input>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
<definitions name="Test"
|
||||
targetNamespace="urn:Test"
|
||||
xmlns:tns="urn:Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
@@ -9,101 +9,23 @@
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:Test">
|
||||
|
||||
<xsd:simpleType name="testUnion">
|
||||
<xsd:simpleType name="testAny">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="xsd:int xsd:string"/>
|
||||
<xsd:any/>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testUnionAtomic">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minInclusive value="1"/>
|
||||
<xsd:maxInclusive value="3"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="union"/>
|
||||
<xsd:enumeration value="test"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:union>
|
||||
</xsd:simpleType>
|
||||
|
||||
|
||||
<xsd:simpleType name="testUnion">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="xsd:int xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testUnionAtomic">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minInclusive value="1"/>
|
||||
<xsd:maxInclusive value="3"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="union"/>
|
||||
<xsd:enumeration value="test"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:union>
|
||||
</xsd:simpleType>
|
||||
|
||||
|
||||
<xsd:element name="testElementAtomicSimpleTypeRestriction">
|
||||
<xsd:simpleType>
|
||||
<xsd:union memberTypes="xsd:int xsd:long"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="testElementAtomicComplexTypeAllWithAtomicComplexTypeElement">
|
||||
<xsd:complexType>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
(Inclusive constraints) </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
<xsd:element name="test1">
|
||||
<xsd:simpleType>
|
||||
<xsd:list itemType="xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
<xsd:element name="test2" type="xsd:string"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testSimpleType1"/>
|
||||
<part name="testAll" type="tns:testAny"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexType1"/>
|
||||
<part name="testAll" type="tns:testAny"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HelloWorld"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld">
|
||||
<s:element name="sayHello">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element type="string" name="givenName"></s:element>
|
||||
<s:element type="string" name="middleInitial"></s:element>
|
||||
</s:sequence>
|
||||
<s:attribute name="testAttr" type="s:string" use="optional"></s:attribute>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
</s:sequence>
|
||||
<s:attribute name="testAttr" type="s:string" use="optional"></s:attribute>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
|
||||
<s:element name="sayHelloResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1"
|
||||
name="sayHelloResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
</s:schema>
|
||||
</types>
|
||||
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<service name="Service1">
|
||||
<port name="Service1Soap" binding="s0:Service1Soap">
|
||||
<soap:address
|
||||
location="http://localhost:81/soap-wsdl-test/helloworld.pl" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
+12
-10
@@ -66,8 +66,8 @@ my %test2_of :ATTR(:get<test2>);
|
||||
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
{
|
||||
test => \%test_of,
|
||||
test2 => \%test2_of,
|
||||
@@ -99,11 +99,11 @@ use base (
|
||||
{
|
||||
my %test_of :ATTR(:get<test>);
|
||||
my %test2_of :ATTR(:get<test2>);
|
||||
|
||||
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
{
|
||||
test => \%test_of,
|
||||
test2 => \%test2_of,
|
||||
@@ -117,6 +117,8 @@ use base (
|
||||
}
|
||||
__PACKAGE__->__set_name('MyElementAttrs');
|
||||
|
||||
sub __get_attr_class { 'MyElementAttrs::_ATTR' };
|
||||
|
||||
package MyElementAttrs::_ATTR;
|
||||
|
||||
use strict;
|
||||
@@ -128,11 +130,11 @@ use base qw(
|
||||
{
|
||||
my %test_of :ATTR(:get<test>);
|
||||
my %test2_of :ATTR(:get<test2>);
|
||||
|
||||
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(test test2) ],
|
||||
{
|
||||
test => \%test_of,
|
||||
test2 => \%test2_of,
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#!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;
|
||||
@@ -0,0 +1,42 @@
|
||||
#!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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#!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() );
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
@@ -1,64 +0,0 @@
|
||||
package Test::SOAPMessage;
|
||||
|
||||
use strict;
|
||||
|
||||
use SOAP::Lite;
|
||||
use Test::Differences;
|
||||
use Tie::IxHash;
|
||||
|
||||
use base qw/Exporter/;
|
||||
|
||||
our @EXPORT = qw/soap_eq_or_diff/;
|
||||
|
||||
sub soap_eq_or_diff
|
||||
{
|
||||
my $got = shift;
|
||||
my $expected = shift;
|
||||
my $message = shift;
|
||||
my $soapGot = SOAP::Deserializer->deserialize( $got );
|
||||
my $soapExpected = SOAP::Deserializer->deserialize( $expected );
|
||||
|
||||
return eq_or_diff(
|
||||
unlather( $soapGot ),
|
||||
unlather( $soapExpected ),
|
||||
$message
|
||||
);
|
||||
}
|
||||
|
||||
sub unlather
|
||||
{
|
||||
my $som = shift;
|
||||
my $path = shift || '/Envelope/Body/[1]';
|
||||
my $data = shift;
|
||||
|
||||
unless ( $data )
|
||||
{
|
||||
my %hashData = ();
|
||||
tie (%hashData, q/Tie::IxHash/);
|
||||
$data = \%hashData;
|
||||
}
|
||||
|
||||
my $value;
|
||||
my $tag;
|
||||
my $i = 1;
|
||||
while( $som->match("$path/[$i]") )
|
||||
{
|
||||
$tag = $som->dataof->name();
|
||||
$data ||= {};
|
||||
$value = unlather($som,$path.'/'. '[' . $i . ']' ) || $som->valueof("$path/[$i]");
|
||||
if ($data->{ $tag })
|
||||
{
|
||||
$data->{ $tag } = [ $data->{ $tag } ] unless ( ref ( $data->{ $tag } ) eq 'ARRAY' );
|
||||
push @{ $data->{ $tag } }, $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data->{ $tag } = $value;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$data ||= $som->valueof($path);
|
||||
return $data;
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user