import SOAP-WSDL 2.00_25 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_25 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_25.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
84b53d9261
commit
a9033164e6
@@ -27,8 +27,8 @@ is $types->get_parent(), $wsdl , 'types parent';
|
||||
my $serializer_options = {
|
||||
readable => 1,
|
||||
autotype => 1,
|
||||
namespace => { 'urn:myNamespace' => 'tns',
|
||||
"http://www.w3.org/2001/XMLSchema" => 'xsd' },
|
||||
namespace => { 'tns' => 'urn:myNamespace',
|
||||
'xsd' => "http://www.w3.org/2001/XMLSchema" },
|
||||
typelib => $wsdl->first_types(),
|
||||
indent => "\t",
|
||||
};
|
||||
|
||||
@@ -18,12 +18,12 @@ ok($parser = SOAP::WSDL::Expat::WSDLParser->new(), "Object creation");
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
@@ -32,28 +32,28 @@ ok( $wsdl = $parser->get_data() , "get object tree");
|
||||
my $schema = $wsdl->get_types()->[0]->get_schema()->[0] || die "No schema !";
|
||||
|
||||
my $opt = {
|
||||
typelib => $wsdl->first_types,
|
||||
readable => 1,
|
||||
autotype => 0,
|
||||
namespace => { 'http://www.example.org/MessageGateway2/' => 'tns',
|
||||
'http://www.w3.org/2001/XMLSchema' => 'xsd',
|
||||
'http://schemas.xmlsoap.org/wsdl/' => 'wsdl',
|
||||
},
|
||||
indent => "",
|
||||
typelib => $wsdl->first_types,
|
||||
readable => 1,
|
||||
autotype => 0,
|
||||
namespace => { 'tns' => 'http://www.example.org/MessageGateway2/',
|
||||
'xsd' => 'http://www.w3.org/2001/XMLSchema',
|
||||
'wsdl' => 'http://schemas.xmlsoap.org/wsdl/',
|
||||
},
|
||||
indent => "",
|
||||
};
|
||||
|
||||
my $data = { EnqueueMessage => {
|
||||
MMessage => {
|
||||
MRecipientURI => 'anyURI',
|
||||
MSenderAddress => 'a string',
|
||||
MMessageContent => 'a string',
|
||||
MSubject => 'a string',
|
||||
MDeliveryReportRecipientURI => 'anyURI',
|
||||
MKeepalive => {
|
||||
MKeepaliveTimeout => 1234567,
|
||||
MKeepaliveErrorPolicy => ' ( suppress | report ) ',
|
||||
}
|
||||
}
|
||||
MMessage => {
|
||||
MRecipientURI => 'anyURI',
|
||||
MSenderAddress => 'a string',
|
||||
MMessageContent => 'a string',
|
||||
MSubject => 'a string',
|
||||
MDeliveryReportRecipientURI => 'anyURI',
|
||||
MKeepalive => {
|
||||
MKeepaliveTimeout => 1234567,
|
||||
MKeepaliveErrorPolicy => ' ( suppress | report ) ',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw(no_plan);
|
||||
use lib '../lib';
|
||||
use File::Basename qw(dirname);
|
||||
use_ok(qw/SOAP::WSDL::Expat::WSDLParser/);
|
||||
|
||||
my $parser;
|
||||
|
||||
ok($parser = SOAP::WSDL::Expat::WSDLParser->new(), "Object creation");
|
||||
eval { $parser->parse_file( dirname(__FILE__) .'/contributed.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");
|
||||
@@ -108,4 +108,9 @@ eval {
|
||||
$client->set_proxy([ 'http://example.org', keep_alive => 1 ]);
|
||||
$client->set_proxy('http://example.org', keep_alive => 1 );
|
||||
};
|
||||
ok ! $@;
|
||||
if (! $@) {
|
||||
pass 'set_proxy';
|
||||
}
|
||||
else {
|
||||
fail $@
|
||||
};
|
||||
@@ -9,13 +9,11 @@ use lib 'lib';
|
||||
use SOAP::WSDL::Expat::MessageParser;
|
||||
use Cwd;
|
||||
|
||||
|
||||
use SOAP::WSDL;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
my $path = cwd;
|
||||
$path =~s|\/t\/?$||; # allow running from t/ and above (Build test)
|
||||
|
||||
|
||||
my $parser;
|
||||
|
||||
ok $parser = SOAP::WSDL::Expat::MessageParser->new({
|
||||
@@ -77,7 +75,7 @@ BEGIN {
|
||||
);
|
||||
|
||||
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 }
|
||||
|
||||
@@ -19,7 +19,7 @@ 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';
|
||||
is $obj->serialize(), 'test test2', 'stringification';
|
||||
|
||||
# simple type derived from atomic simple type (restriction)
|
||||
$obj = MyAtomicSimpleType->new({ value => 'test' });
|
||||
@@ -33,4 +33,4 @@ $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';
|
||||
is $obj->serialize(), 'test test2', 'stringification';
|
||||
|
||||
@@ -12,7 +12,7 @@ use_ok qw( MyElement );
|
||||
my $obj = MyElement->new({ value => 'test'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
|
||||
, 'inherited class';
|
||||
is $obj, '<MyElementName xmlns="urn:Test" >test</MyElementName>', 'stringification';
|
||||
is $obj->serialize_qualified(), '<MyElementName xmlns="urn:Test" >test</MyElementName>', 'stringification';
|
||||
|
||||
$obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => 'Test2'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
@@ -21,7 +21,7 @@ ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
ok $obj->get_test->isa('SOAP::WSDL::XSD::Typelib::Builtin::string')
|
||||
, 'element isa';
|
||||
|
||||
is $obj, '<MyAtomicComplexTypeElement xmlns="urn:Test" ><test >Test</test>'
|
||||
is $obj->serialize_qualified, '<MyAtomicComplexTypeElement xmlns="urn:Test" ><test >Test</test>'
|
||||
. '<test2 >Test2</test2></MyAtomicComplexTypeElement>'
|
||||
, 'stringification';
|
||||
|
||||
@@ -41,7 +41,7 @@ is $obj, '<MyAtomicComplexTypeElement xmlns="urn:Test" ><test >Test</test>'
|
||||
, 'multi value stringification';
|
||||
|
||||
ok $obj = MyComplexTypeElement->new({ MyTestName => 'test' });
|
||||
is $obj, '<MyComplexTypeElement xmlns="urn:Test" ><MyTestName >test</MyTestName ></MyComplexTypeElement>';
|
||||
is $obj->serialize_qualified(), '<MyComplexTypeElement xmlns="urn:Test" ><MyTestName >test</MyTestName ></MyComplexTypeElement>';
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
@@ -59,16 +59,13 @@ my $message_parser = SOAP::WSDL::Expat::MessageParser->new({
|
||||
class_resolver => 'Test::Typemap::MessageGateway',
|
||||
strict => 0,
|
||||
});
|
||||
|
||||
eval { $message_parser->parse_string( xml_message2() ) };
|
||||
my $msg;
|
||||
eval { $msg = $message_parser->parse_string( xml_message2() ) };
|
||||
ok ( !$@, 'parse XML message: ' . $@);
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO = 'support embedded atomic simpleType/complexType definitions';
|
||||
eval { $message_parser->parse_string( xml_message() ) };
|
||||
ok ( !$@, 'parse XML message using atomic type definitions');
|
||||
};
|
||||
eval { $message_parser->parse_string( xml_message() ) };
|
||||
ok ( !$@, 'parse XML message using atomic type definitions');
|
||||
|
||||
SKIP: {
|
||||
eval "require Test::Pod; ";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
use Test::More tests => 2;
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
|
||||
use_ok q(MyInterfaces::GlobalWeather);
|
||||
|
||||
ok MyInterfaces::GlobalWeather->new();
|
||||
77
t/096_characters.t
Normal file
77
t/096_characters.t
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/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{TEST_AUTHOR} ) {
|
||||
my $msg = 'Author test. Set $ENV{TEST_AUTHOR} 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";
|
||||
}
|
||||
@@ -39,12 +39,14 @@ BEGIN {
|
||||
'MyAtomicComplexTypeElement/test' => 'MyTestElement',
|
||||
'MyAtomicComplexTypeElement/test2' => 'MyTestElement2',
|
||||
'MyAtomicComplexTypeElement/foo' => '__SKIP__',
|
||||
'MyAtomicComplexTypeElement/foo/bar' => 'MyFooElement',
|
||||
'MyAtomicComplexTypeElement/foo/baz' => 'MyFooElement',
|
||||
# 'MyAtomicComplexTypeElement/foo/bar' => 'MyFooElement',
|
||||
# 'MyAtomicComplexTypeElement/foo/baz' => 'MyFooElement',
|
||||
);
|
||||
|
||||
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 }
|
||||
|
||||
@@ -39,16 +39,16 @@ my $element = $schema->find_element(
|
||||
);
|
||||
|
||||
ok $element, 'find element';
|
||||
is $element->get_xmlns()->{ 'http://www.example.org/MessageGateway2/' }, 'tns', 'Namespace definition';
|
||||
is $element->get_xmlns()->{ 'tns' }, 'http://www.example.org/MessageGateway2/', 'Namespace definition';
|
||||
|
||||
|
||||
my $opt = {
|
||||
typelib => $wsdl->first_types,
|
||||
readable => 1,
|
||||
autotype => 0,
|
||||
namespace => { 'http://www.example.org/MessageGateway2/' => 'tns',
|
||||
'http://www.w3.org/2001/XMLSchema' => 'xsd',
|
||||
'http://schemas.xmlsoap.org/wsdl/' => 'wsdl',
|
||||
namespace => { 'tns' => 'http://www.example.org/MessageGateway2/',
|
||||
xsd => 'http://www.w3.org/2001/XMLSchema',
|
||||
'wsdl' => 'http://schemas.xmlsoap.org/wsdl/',
|
||||
},
|
||||
indent => "",
|
||||
};
|
||||
|
||||
73
t/SOAP/WSDL.t
Normal file
73
t/SOAP/WSDL.t
Normal file
@@ -0,0 +1,73 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 12;
|
||||
use File::Spec;
|
||||
use File::Basename;
|
||||
use_ok qw(SOAP::WSDL);
|
||||
|
||||
my $path = File::Spec->rel2abs(dirname( __FILE__ ) );
|
||||
|
||||
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{ <in>test</in> }x;
|
||||
like $soap->call('NewOperation', { NewOperation => { in => 'test' } }), qr{ <in>test</in> }x;
|
||||
|
||||
$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{ <in>test</in> }x;
|
||||
like $soap->call('NewOperation', { NewOperation => { in => 'test' } }), qr{ <in>test</in> }x;
|
||||
|
||||
|
||||
$soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_NO_BINDING.wsdl",
|
||||
servicename => 'NewService',
|
||||
portname => 'NewPort',
|
||||
no_dispatch => 1,
|
||||
);
|
||||
eval {
|
||||
$soap->call('NewOperation', { NewOperation => { in => 'test' } });
|
||||
};
|
||||
like $@, qr{ no \s binding }x, 'No binding error';
|
||||
|
||||
$soap = SOAP::WSDL->new( wsdl => "file://$path/WSDL_NO_PORTTYPE.wsdl",
|
||||
servicename => 'NewService',
|
||||
portname => 'NewPort',
|
||||
no_dispatch => 1,
|
||||
);
|
||||
eval {
|
||||
$soap->call('NewOperation', { NewOperation => { in => 'test' } });
|
||||
};
|
||||
like $@, qr{ cannot \s find \s portType }x, 'No porttype error';
|
||||
65
t/SOAP/WSDL/Client/Base.t
Normal file
65
t/SOAP/WSDL/Client/Base.t
Normal file
@@ -0,0 +1,65 @@
|
||||
package MyPart;
|
||||
use Class::Std::Fast;
|
||||
|
||||
package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw(no_plan);
|
||||
use_ok qw(SOAP::WSDL::Client::Base);
|
||||
|
||||
my $client = SOAP::WSDL::Client::Base->new();
|
||||
|
||||
{
|
||||
no warnings qw(redefine once);
|
||||
*SOAP::WSDL::Client::call = sub { is $_[1]->{ operation }, 'sayHello', 'Called method';
|
||||
return $_[2], $_[3];
|
||||
};
|
||||
}
|
||||
|
||||
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 )],
|
||||
},
|
||||
header => {
|
||||
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
||||
},
|
||||
headerfault => {
|
||||
|
||||
}
|
||||
}, { value => 'Body' }, { value => 'Header' });
|
||||
|
||||
is $result[0], 'Body';
|
||||
is $result[1], 'Header';
|
||||
isa_ok $result[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';
|
||||
@@ -1,5 +1,9 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
package TestResolver;
|
||||
sub get_typemap { {} };
|
||||
|
||||
package main;
|
||||
use Test::More tests => 8;
|
||||
|
||||
use SOAP::WSDL::Deserializer::XSD;
|
||||
|
||||
12
t/SOAP/WSDL/Expat/Base.t
Normal file
12
t/SOAP/WSDL/Expat/Base.t
Normal file
@@ -0,0 +1,12 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 3;
|
||||
use_ok qw(SOAP::WSDL::Expat::Base);
|
||||
|
||||
my $parser = SOAP::WSDL::Expat::Base->new();
|
||||
|
||||
eval { $parser->parse('Foobar')};
|
||||
ok $@;
|
||||
|
||||
eval { $parser->parsefile('Foobar')};
|
||||
ok $@;
|
||||
@@ -1,6 +1,6 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 5;
|
||||
use Scalar::Util qw(blessed);
|
||||
use SOAP::WSDL::Factory::Transport;
|
||||
|
||||
@@ -14,3 +14,7 @@ SOAP::WSDL::Factory::Transport->register('zumsl', 'Hope_You_Have_No_Such_Package
|
||||
|
||||
eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl') };
|
||||
like $@, qr{^Cannot load};
|
||||
|
||||
eval { SOAP::WSDL::Factory::Transport->register( \'zumsl', 'Foo') };
|
||||
like $@, qr{^Cannot use reference};
|
||||
|
||||
|
||||
@@ -26,14 +26,10 @@ my $definitions = $parser->get_data();
|
||||
|
||||
$definitions->_accept( $visitor );
|
||||
|
||||
#use Data::Dumper;
|
||||
#print Dumper $visitor->get_typemap();
|
||||
|
||||
my $typemap = $visitor->get_typemap();
|
||||
is $typemap->{'EnqueueMessage/MMessage/MKeepalive'}, 'MyTypes::TKeepalive', 'content';
|
||||
is $typemap->{'EnqueueMessageResponse'}, 'MyTypes::TMessageID', 'content';
|
||||
is $typemap->{'KeepaliveMessageResponse'}, 'MyTypes::TMessageID', 'content';
|
||||
|
||||
is $typemap->{'EnqueueMessageResponse'}, 'MyElements::EnqueueMessageResponse', 'content';
|
||||
is $typemap->{'KeepaliveMessageResponse'}, 'MyElements::KeepaliveMessageResponse', 'content';
|
||||
|
||||
sub wsdl {
|
||||
q{<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
@@ -43,7 +43,9 @@ $generator->set_output(undef);
|
||||
$generator->generate();
|
||||
#$generator->generate_typelib();
|
||||
#$generator->generate_typemap();
|
||||
#$generator->generate_interface();
|
||||
$generator->generate_interface();
|
||||
|
||||
$generator->generate_server();
|
||||
|
||||
eval "use lib '$path/testlib'";
|
||||
use_ok qw( MyInterfaces::testService::testPort );
|
||||
|
||||
62
t/SOAP/WSDL/Server.t
Normal file
62
t/SOAP/WSDL/Server.t
Normal file
@@ -0,0 +1,62 @@
|
||||
package MyDeserializer;
|
||||
use Class::Std::Fast;
|
||||
require Test::More;
|
||||
my %class_resolver_of :ATTR(:name<class_resolver> :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_deserializer('MyDeserializer2');
|
||||
eval { $server->handle(HTTP::Request->new()) };
|
||||
like $@, qr{\A Error \s deserializing}x, 'Error deserializing caught';
|
||||
|
||||
64
t/SOAP/WSDL/Server/CGI.t
Normal file
64
t/SOAP/WSDL/Server/CGI.t
Normal file
@@ -0,0 +1,64 @@
|
||||
package MyTypemap;
|
||||
sub get_typemap { return {} };
|
||||
|
||||
package HandlerClass;
|
||||
|
||||
sub bar {
|
||||
return "Verdammte Axt";
|
||||
}
|
||||
package main;
|
||||
use Test::More tests => 4;
|
||||
|
||||
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',
|
||||
});
|
||||
|
||||
eval "require IO::Scalar"
|
||||
or exit 0;
|
||||
{
|
||||
no warnings qw(once);
|
||||
*IO::Scalar::BINMODE = sub {};
|
||||
}
|
||||
my $output = q{};
|
||||
my $fh = IO::Scalar->new(\$output);
|
||||
my $stdout = *STDOUT;
|
||||
|
||||
*STDOUT = $fh;
|
||||
|
||||
$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();
|
||||
|
||||
print "\n";
|
||||
|
||||
$ENV{HTTP_SOAPAction} = 'test';
|
||||
$server->handle();
|
||||
|
||||
print "\n";
|
||||
|
||||
$ENV{HTTP_SOAPAction} = 'foo';
|
||||
$server->handle();
|
||||
|
||||
*STDOUT = $stdout;
|
||||
|
||||
# print $output;
|
||||
@@ -11,7 +11,8 @@ use_ok(qw/SOAP::WSDL::Transport::Test/);
|
||||
$soap = SOAP::WSDL::Client->new();
|
||||
$soap->set_proxy('http://somewhere.over.the.rainbow');
|
||||
|
||||
ok( $soap->get_transport->set_base_dir( join '/', $base_dir, 'acceptance' ) );
|
||||
$soap->get_transport->set_base_dir( join '/', $base_dir, 'acceptance' );
|
||||
ok $soap->get_transport->get_base_dir();
|
||||
|
||||
{
|
||||
local $SIG{__WARN__} = sub {};
|
||||
|
||||
@@ -11,10 +11,10 @@ ok $transport->code(200);
|
||||
ok $transport->status('200 OK');
|
||||
ok $transport->message('OK');
|
||||
|
||||
$transport->send_receive(envelope => 'Test', action => 'foo');
|
||||
my $result = $transport->send_receive(envelope => 'Test', action => 'foo');
|
||||
|
||||
ok ! $transport->is_success();
|
||||
|
||||
$transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ',
|
||||
$result = $transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ',
|
||||
action => 'foo');
|
||||
ok ! $transport->is_success();
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
use Test::More tests => 5;
|
||||
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';
|
||||
|
||||
ok $ENTITY->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';
|
||||
is $ENTITY->get_value(), "127", 'stringification';
|
||||
ok $ENTITY->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';
|
||||
|
||||
@@ -7,7 +7,7 @@ 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", "127 Test", 'stringification';
|
||||
is $IDREFS->serialize(), "127 Test", 'stringification';
|
||||
|
||||
ok $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({ value => 'Test' });
|
||||
is "$IDREFS", "Test", 'stringification';
|
||||
|
||||
@@ -8,13 +8,13 @@ $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({});
|
||||
is $NMTOKENS->get_value(), undef;
|
||||
ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => [ 127 , 'Test' ] });
|
||||
|
||||
is "$NMTOKENS", '127 Test', 'stringification';
|
||||
is $NMTOKENS->serialize, '127 Test', 'stringification';
|
||||
|
||||
ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => 'Test' });
|
||||
is "$NMTOKENS", "Test", 'stringification';
|
||||
|
||||
$NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => undef });
|
||||
is "$NMTOKENS", q{}, 'stringification';
|
||||
is $NMTOKENS, undef, 'stringification';
|
||||
|
||||
|
||||
ok $NMTOKENS->isa('SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN'), 'inheritance';
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 20;
|
||||
use Test::More tests => 23;
|
||||
use Scalar::Util qw(blessed);
|
||||
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;
|
||||
|
||||
ok blessed $obj, 'constructor returned blessed reference';
|
||||
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => 'test1' });
|
||||
@@ -23,7 +30,8 @@ is $obj->end_tag({ name => 'test' }), '</test >', 'end_tag';
|
||||
ok $obj->set_value('test'), 'set_value';
|
||||
is $obj->get_value(), 'test', 'get_value';
|
||||
|
||||
is "$obj", q{test}, 'serialize overloading';
|
||||
is "$obj", q{test}, 'stringification overloading';
|
||||
is $obj->serialize, q{test}, 'stringification overloading';
|
||||
|
||||
ok ($obj)
|
||||
? pass 'boolean overloading'
|
||||
@@ -32,7 +40,11 @@ ok ($obj)
|
||||
ok ! $obj->set_value(undef), 'set_value with explicit undef';
|
||||
is $obj->get_value(), undef, 'get_value';
|
||||
|
||||
is "$obj", q{}, 'stringification overloading';
|
||||
{
|
||||
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',
|
||||
@@ -47,4 +59,4 @@ is $obj->serialize({ name => 'foo' }), '<foo ></foo >'
|
||||
is $obj->serialize(), q{}, 'serialize undef value without name';
|
||||
|
||||
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'), 'inheritance';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'), 'inheritance';
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 3;
|
||||
use Scalar::Util qw(blessed);
|
||||
use lib '../../../../../../lib';
|
||||
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';
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
||||
|
||||
# cannot instantiate abstract type...
|
||||
|
||||
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new();
|
||||
|
||||
ok blessed $obj, 'constructor returned blessed reference';
|
||||
|
||||
@@ -3,7 +3,10 @@ use strict;
|
||||
use warnings;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::base64Binary;
|
||||
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::base64Binary->new();
|
||||
is "$obj", '', 'stringification';
|
||||
{
|
||||
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==' });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 19;
|
||||
use Test::More tests => 29;
|
||||
use strict;
|
||||
use warnings;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::boolean;
|
||||
@@ -17,18 +17,19 @@ ok $bool = SOAP::WSDL::XSD::Typelib::Builtin::boolean->new({ value => 'true' });
|
||||
is $bool * 1 , 1, 'numerification';
|
||||
ok $bool, 'boolification';
|
||||
|
||||
is "$bool", 'true', 'stringification';
|
||||
is $bool->serialize(), 'true', 'serialization';
|
||||
|
||||
$bool->set_value('1');
|
||||
is $bool, 'true';
|
||||
is $bool->serialize(), 'true';
|
||||
is "$bool", 1, 'stringification';
|
||||
$bool ? pass 'boolification' : fail 'boolification';
|
||||
|
||||
$bool->set_value('0');
|
||||
is $bool, 'false';
|
||||
is $bool->serialize(), 'false';
|
||||
! $bool ? pass 'boolification' : fail 'boolification';
|
||||
|
||||
$bool->set_value(undef);
|
||||
is $bool, 'false';
|
||||
is $bool->serialize(), 'false';
|
||||
! $bool ? pass 'boolification' : fail 'boolification';
|
||||
|
||||
|
||||
@@ -41,7 +42,7 @@ else {
|
||||
pass 'boolification';
|
||||
}
|
||||
|
||||
is "$bool", 'false', 'stringification';
|
||||
is "$bool", '0', 'stringification';
|
||||
|
||||
ok $bool->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';
|
||||
|
||||
@@ -49,4 +50,19 @@ is $bool->serialize({ name => 'test'}), '<test >false</test >';
|
||||
is $bool->serialize(), 'false';
|
||||
|
||||
$bool->delete_value();
|
||||
is "$bool", '', 'serialized undef to empty string';
|
||||
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';
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 7;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
@@ -34,3 +34,9 @@ while (my ($date, $converted) = each %dates ) {
|
||||
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 { $obj->set_value(1) };
|
||||
ok $@, 'Die on illegal datetime';
|
||||
28
t/SOAP/WSDL/XSD/Typelib/Builtin/list.t
Normal file
28
t/SOAP/WSDL/XSD/Typelib/Builtin/list.t
Normal file
@@ -0,0 +1,28 @@
|
||||
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';
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 8;
|
||||
use Test::More tests => 9;
|
||||
use strict;
|
||||
use warnings;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin::normalizedString;
|
||||
@@ -11,12 +11,14 @@ 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<test>");
|
||||
is $obj->get_value() , '& "Aber" <test>';
|
||||
is $obj->get_value() , '& "Aber" <test>';
|
||||
|
||||
is $obj, '& &qout;Aber&qout; <test>'
|
||||
is $obj->serialize, '& "Aber" <test>'
|
||||
, 'escape text on serialization';
|
||||
|
||||
is $obj->serialize({ name => 'test'})
|
||||
, '<test >& &qout;Aber&qout; <test></test >'
|
||||
, '<test >& "Aber" <test></test >'
|
||||
, 'Serialization with name';
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
@@ -7,17 +7,17 @@ use_ok('SOAP::WSDL::XSD::Typelib::Builtin::string');
|
||||
my $obj;
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => '& "Aber" <test>'});
|
||||
|
||||
is $obj, '& &qout;Aber&qout; <test>'
|
||||
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" <test>');
|
||||
is $obj->get_value() , '& "Aber" <test>';
|
||||
|
||||
is $obj, '& &qout;Aber&qout; <test>'
|
||||
is $obj, '& "Aber" <test>';
|
||||
is $obj->serialize(), '& "Aber" <test>'
|
||||
, 'escape text on serialization';
|
||||
|
||||
is $obj->serialize({ name => 'test'})
|
||||
, '<test >& &qout;Aber&qout; <test></test >'
|
||||
, '<test >& "Aber" <test></test >'
|
||||
, 'Serialization with name';
|
||||
@@ -34,7 +34,7 @@ __PACKAGE__->_factory(
|
||||
);
|
||||
|
||||
package main;
|
||||
use Test::More tests => 90;
|
||||
use Test::More tests => 89;
|
||||
use Data::Dumper;
|
||||
use Storable;
|
||||
my $obj;
|
||||
@@ -77,14 +77,14 @@ $obj = MyType->new({
|
||||
});
|
||||
isa_ok $obj, 'MyType';
|
||||
isa_ok $obj->get_test, 'ARRAY';
|
||||
is $obj->get_test()->[0], 'Test', 'element content';
|
||||
is $obj->get_test()->[1], 'Test2', 'element content';
|
||||
is $obj->get_test()->[0], 'Test', 'element content (list content [0])';
|
||||
is $obj->get_test()->[1], 'Test2', 'element content (list content [1])';
|
||||
|
||||
my $nested = MyType2->new({
|
||||
test => $obj,
|
||||
});
|
||||
|
||||
is $nested->get_test, $obj;
|
||||
is $nested->get_test, $obj, 'getter';
|
||||
$nested = MyType2->new({
|
||||
test => [$obj, $obj],
|
||||
});
|
||||
@@ -105,7 +105,8 @@ $nested = MyType2->new({
|
||||
},
|
||||
});
|
||||
|
||||
is $nested->get_test->[0], $obj;
|
||||
|
||||
# isnt $nested->get_test->[0], $obj, 'element identity';
|
||||
|
||||
$obj = MyType->new();
|
||||
isa_ok $obj, 'MyType';
|
||||
@@ -114,7 +115,6 @@ 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) {
|
||||
@@ -137,13 +137,23 @@ $obj = MyType->new();
|
||||
isa_ok $obj, 'MyType';
|
||||
is $obj->get_test, undef;
|
||||
|
||||
eval { my $foo = @{ $obj->get_test() } };
|
||||
like $@ , qr{Can't \s use \s an \s undefined}x, 'get_ELEMENT still undef on ARRAYIFY';
|
||||
|
||||
$obj->test(
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'})
|
||||
);
|
||||
{
|
||||
no warnings;
|
||||
my $foo;
|
||||
eval { $foo = @{ $obj->get_test() } };
|
||||
if (! $@) {
|
||||
is $foo, undef;
|
||||
# like $warnings, qr{ uninitialized \s value \s in array \s dereference }x, 'undef warning';
|
||||
}
|
||||
else {
|
||||
like $@ , qr{Can't \s use \s an \s undefined}x, 'get_ELEMENT still undef on ARRAYIFY';
|
||||
# pass 'failed array dereference';
|
||||
}
|
||||
|
||||
$obj->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 ($@);
|
||||
@@ -171,6 +181,7 @@ for my $count (1..5) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
eval {
|
||||
$obj = MyType->new({
|
||||
test => [
|
||||
|
||||
@@ -25,7 +25,7 @@ isa_ok $obj, 'MyElement';
|
||||
is $obj->get_value(), 'Test';
|
||||
|
||||
$obj->set_value(undef);
|
||||
is $obj, '<MyElement xsi:nil="true" xmlns="http://www.w3.org/2001/XMLSchema" />';
|
||||
is $obj->serialize_qualified, '<MyElement xsi:nil="true" xmlns="http://www.w3.org/2001/XMLSchema" />';
|
||||
|
||||
$obj->__set_nillable(0);
|
||||
is $obj->__get_nillable(), 0;
|
||||
@@ -41,4 +41,4 @@ $obj->set_value('Test');
|
||||
|
||||
|
||||
eval { is @{ $obj }, 1, 'ARRAYIFY' };
|
||||
fail 'ARRAYIFY' if ($@);
|
||||
fail 'ARRAYIFY' if ($@);
|
||||
|
||||
60
t/SOAP/WSDL_1.wsdl
Normal file
60
t/SOAP/WSDL_1.wsdl
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="WSDL_1"
|
||||
targetNamespace="http://www.example.org/WSDL_1/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/WSDL_1/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.example.org/WSDL_1/">
|
||||
<xsd:element name="NewOperation">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="in" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="NewOperationResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="out" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="NewOperationRequest">
|
||||
<wsdl:part name="parameters" element="tns:NewOperation"></wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="NewOperationResponse">
|
||||
<wsdl:part name="parameters"
|
||||
element="tns:NewOperationResponse">
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="NewPortType">
|
||||
<wsdl:operation name="NewOperation">
|
||||
<wsdl:input message="tns:NewOperationRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:NewOperationResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="NewBinding" type="tns:NewPortType">
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="NewOperation">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/WSDL_1/NewOperation" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="NewService">
|
||||
<wsdl:port name="NewPort" binding="tns:NewBinding">
|
||||
<soap:address location="http://www.example.org/"></soap:address>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
2
t/SOAP/WSDL_EMPTY_DEFINITIONS.wsdl
Normal file
2
t/SOAP/WSDL_EMPTY_DEFINITIONS.wsdl
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions name="WSDL_1" targetNamespace="http://www.example.org/WSDL_1/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.org/WSDL_1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
</wsdl:definitions>
|
||||
60
t/SOAP/WSDL_NO_BINDING.wsdl
Normal file
60
t/SOAP/WSDL_NO_BINDING.wsdl
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="WSDL_1"
|
||||
targetNamespace="http://www.example.org/WSDL_1/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/WSDL_1/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.example.org/WSDL_1/">
|
||||
<xsd:element name="NewOperation">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="in" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="NewOperationResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="out" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="NewOperationRequest">
|
||||
<wsdl:part name="parameters" element="tns:NewOperation"></wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="NewOperationResponse">
|
||||
<wsdl:part name="parameters"
|
||||
element="tns:NewOperationResponse">
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="NewPortType">
|
||||
<wsdl:operation name="NewOperation">
|
||||
<wsdl:input message="tns:NewOperationRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:NewOperationResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="NewBinding" type="tns:NewPortType">
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="NewOperation">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/WSDL_1/NewOperation" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="NewService">
|
||||
<wsdl:port name="NewPort" binding="tns:BadBinding">
|
||||
<soap:address location="http://www.example.org/"></soap:address>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
60
t/SOAP/WSDL_NO_MESSAGE.wsdl
Normal file
60
t/SOAP/WSDL_NO_MESSAGE.wsdl
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="WSDL_1"
|
||||
targetNamespace="http://www.example.org/WSDL_1/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/WSDL_1/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.example.org/WSDL_1/">
|
||||
<xsd:element name="NewOperation">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="in" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="NewOperationResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="out" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="BadOperationRequest">
|
||||
<wsdl:part name="parameters" element="tns:NewOperation"></wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="NewOperationResponse">
|
||||
<wsdl:part name="parameters"
|
||||
element="tns:NewOperationResponse">
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="NewPortType">
|
||||
<wsdl:operation name="NewOperation">
|
||||
<wsdl:input message="tns:NewOperationRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:NewOperationResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="NewBinding" type="tns:NewPortType">
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="NewOperation">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/WSDL_1/NewOperation" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="NewService">
|
||||
<wsdl:port name="NewPort" binding="tns:NewBinding">
|
||||
<soap:address location="http://www.example.org/"></soap:address>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
60
t/SOAP/WSDL_NO_PORTTYPE.wsdl
Normal file
60
t/SOAP/WSDL_NO_PORTTYPE.wsdl
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="WSDL_1"
|
||||
targetNamespace="http://www.example.org/WSDL_1/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/WSDL_1/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.example.org/WSDL_1/">
|
||||
<xsd:element name="NewOperation">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="in" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="NewOperationResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="out" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="NewOperationRequest">
|
||||
<wsdl:part name="parameters" element="tns:NewOperation"></wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="NewOperationResponse">
|
||||
<wsdl:part name="parameters"
|
||||
element="tns:NewOperationResponse">
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="NewPortType">
|
||||
<wsdl:operation name="NewOperation">
|
||||
<wsdl:input message="tns:NewOperationRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:NewOperationResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="NewBinding" type="tns:BadPortType">
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="NewOperation">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/WSDL_1/NewOperation" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="NewService">
|
||||
<wsdl:port name="NewPort" binding="tns:NewBinding">
|
||||
<soap:address location="http://www.example.org/"></soap:address>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
@@ -1,105 +1,95 @@
|
||||
<?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" />
|
||||
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:complexType>
|
||||
</s:element>
|
||||
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName"
|
||||
type="s:string" nillable="1"/>
|
||||
<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:element minOccurs="0" maxOccurs="1" name="test"
|
||||
type="s0:test2" /> //-->
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:complexType name="test2">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
|
||||
<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:element minOccurs="0" maxOccurs="1"
|
||||
name="givenName" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
|
||||
<s:complexType name="test2">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
<s:complexType name="testExtended">
|
||||
<s:extension base="s0:test2">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1"
|
||||
name="extend" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:extension>
|
||||
</s:complexType>
|
||||
</s:schema>
|
||||
</types>
|
||||
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<s:complexType name="testExtended">
|
||||
<s:extension base="s0:test2">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="extend"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:extension>
|
||||
</s:complexType>
|
||||
</s:schema>
|
||||
</types>
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
|
||||
<!-- <part name="test1" type="s0:testExtended" />
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<part name="test2" type="s0:test2"
|
||||
targetNamespace="urn:test2" /> //-->
|
||||
</message>
|
||||
<binding name="Service1Soap" type="s0:Service1Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayHelloResponse" />
|
||||
</message>
|
||||
<operation name="sayHello">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayHello"
|
||||
style="document" />
|
||||
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<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://helloworld/helloworld.asmx" />
|
||||
</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>
|
||||
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
<wsdl:definitions targetNamespace="http://example.com/soap/services/ETest/impl"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:apachesoap="http://xml.apache.org/xml-soap"
|
||||
xmlns:impl="http://example.com/soap/services/ETest/impl"
|
||||
xmlns:intf="http://example.com/soap/services/ETest"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tns1="urn:ETest"
|
||||
xmlns:tns2="urn:acquisition"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<wsdl:types>
|
||||
<schema targetNamespace="urn:ETest" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="CreationBaseData">
|
||||
<sequence>
|
||||
<element name="createdBy" nillable="true" type="xsd:long" />
|
||||
<element name="creationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateCenter" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateLocal" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updatedBy" nillable="true" type="xsd:long" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="CreationData">
|
||||
<complexContent>
|
||||
<extension base="tns1:CreationBaseData">
|
||||
<sequence>
|
||||
<element name="creatorFullName" nillable="true" type="xsd:string" />
|
||||
<element name="modifierFullName" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</extension>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
<complexType abstract="true" name="EProductData">
|
||||
<sequence>
|
||||
<element name="EStatus" nillable="true" type="xsd:string" />
|
||||
<element name="EStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="SFXID" nillable="true" type="xsd:string" />
|
||||
<element name="activationFromDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activationToDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="canEditSFXID" type="xsd:boolean" />
|
||||
<element name="concurrentNumberOfUsers" nillable="true" type="xsd:int" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="deleteable" type="xsd:boolean" />
|
||||
<element name="ETestCode" nillable="true" type="xsd:string" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="mainContact" nillable="true" type="xsd:string" />
|
||||
<element name="metaLibID" nillable="true" type="xsd:string" />
|
||||
<element name="otherID" nillable="true" type="xsd:string" />
|
||||
<element name="otherSource" nillable="true" type="xsd:string" />
|
||||
<element name="privateNote" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatus" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatusUpdateDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="procurementStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="sourceInstanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryName" nillable="true" type="xsd:string" />
|
||||
<element name="updateTarget" nillable="true" type="xsd:string" />
|
||||
<element name="workExpressionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="EProductInformation">
|
||||
<sequence>
|
||||
<element name="acquisitions" nillable="true"
|
||||
type="impl:ArrayOf_tns2_AcquisitionData" />
|
||||
<element name="data" nillable="true" type="tns1:EProductData" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="urn:acquisition" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="AcquisitionCommonData">
|
||||
<sequence>
|
||||
<element name="budgets" nillable="true" type="xsd:string" />
|
||||
<element name="campusCode" nillable="true" type="xsd:string" />
|
||||
<element name="concurrentUsersNote" nillable="true" type="xsd:string" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instituteCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="AcquisitionData">
|
||||
<sequence>
|
||||
<element name="ILSSubscriptionNo" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCode" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCommonData" nillable="true"
|
||||
type="tns2:AcquisitionCommonData" />
|
||||
<element name="acquisitionMethod" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionNumber" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatus" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatusDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="advanceNoticeDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="autoRenewal" nillable="true" type="xsd:boolean" />
|
||||
<element name="consortialAgreement" type="xsd:boolean" />
|
||||
<element name="discountOnPrice" nillable="true" type="xsd:int" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="materialType" nillable="true" type="xsd:string" />
|
||||
<element name="noteForILS" nillable="true" type="xsd:string" />
|
||||
<element name="noteForVendor" nillable="true" type="xsd:string" />
|
||||
<element name="noticePeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="numberOfCopies" nillable="true" type="xsd:int" />
|
||||
<element name="orderDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="orderForm" nillable="true" type="xsd:string" />
|
||||
<element name="orderSendMethod" nillable="true" type="xsd:string" />
|
||||
<element name="pooledConcurrentUsers" nillable="true" type="xsd:int" />
|
||||
<element name="price" nillable="true" type="xsd:double" />
|
||||
<element name="pricingCap" nillable="true" type="xsd:int" />
|
||||
<element name="pricingCapFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingCapTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingModel" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationNote" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationRestriction" type="xsd:boolean" />
|
||||
<element name="printPurchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="purchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="renewallOrCancellationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="renewallOrCancellationDescisionNote" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForILS" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForVendor" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="subscriptionNotification" nillable="true" type="xsd:int" />
|
||||
<element name="subscriptionPeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionType" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionTypeNote" nillable="true" type="xsd:string" />
|
||||
<element name="vendorAdvancedNotice" nillable="true" type="xsd:int" />
|
||||
<element name="vendorAdvancedNoticeVal" nillable="true" type="xsd:string" />
|
||||
<element name="vendorCode" nillable="true" type="xsd:string" />
|
||||
<element name="vendorName" nillable="true" type="xsd:string" />
|
||||
<element name="vendorSubscriptionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="http://example.com/soap/services/ETest/impl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="ArrayOf_tns2_AcquisitionData">
|
||||
<complexContent>
|
||||
<restriction base="soapenc:Array">
|
||||
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:AcquisitionData[]" />
|
||||
</restriction>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
</schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="getETestResponse">
|
||||
<wsdl:part name="getETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestResponse">
|
||||
<wsdl:part name="getFixedETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestRequest"></wsdl:message>
|
||||
<wsdl:message name="getETestRequest">
|
||||
<wsdl:part name="indexName" type="xsd:string" />
|
||||
<wsdl:part name="indexValue" type="xsd:string" />
|
||||
<wsdl:part name="withStatus" type="xsd:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="ETestWeb">
|
||||
<wsdl:operation name="getETest" parameterOrder="indexName indexValue withStatus">
|
||||
<wsdl:input message="impl:getETestRequest" name="getETestRequest" />
|
||||
<wsdl:output message="impl:getETestResponse" name="getETestResponse" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdl:input message="impl:getFixedETestRequest" name="getFixedETestRequest" />
|
||||
<wsdl:output message="impl:getFixedETestResponse"
|
||||
name="getFixedETestResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="ETestSoapBinding" type="impl:ETestWeb">
|
||||
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="getETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getFixedETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getFixedETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="ETestWebService">
|
||||
<wsdl:port binding="impl:ETestSoapBinding" name="ETest">
|
||||
<wsdlsoap:address location="http://example.com/soap/services/ETest" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl
|
||||
package MyComplexType;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use lib '../../lib';
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use base ('SOAP::WSDL::XSD::Typelib::ComplexType');
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
package MyElements::GetWeather;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
|
||||
|
||||
# atomic complexType
|
||||
# <element name="GetWeather"><complexType> definition
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType
|
||||
);
|
||||
|
||||
|
||||
my %CityName_of :ATTR(:get<CityName>);
|
||||
|
||||
my %CountryName_of :ATTR(:get<CountryName>);
|
||||
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(
|
||||
CityName
|
||||
|
||||
CountryName
|
||||
) ],
|
||||
{
|
||||
CityName => \%CityName_of,
|
||||
CountryName => \%CountryName_of,
|
||||
|
||||
},
|
||||
{
|
||||
|
||||
CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
sub get_xmlns { 'http://www.webserviceX.NET' }
|
||||
|
||||
__PACKAGE__->__set_name('GetWeather');
|
||||
__PACKAGE__->__set_nillable();
|
||||
__PACKAGE__->__set_minOccurs();
|
||||
__PACKAGE__->__set_maxOccurs();
|
||||
__PACKAGE__->__set_ref('');
|
||||
|
||||
1;
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MyElements::GetWeather
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Type class for the XML element GetWeather.
|
||||
|
||||
=head1 PROPERTIES
|
||||
|
||||
The following properties may be accessed using get_PROPERTY / set_PROPERTY
|
||||
methods:
|
||||
|
||||
CityName
|
||||
CountryName
|
||||
|
||||
=head1 Object structure
|
||||
|
||||
CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
Structure as perl hash:
|
||||
|
||||
The object structure is displayed as hash below though this is not correct.
|
||||
Complex hash elements actually are objects of their corresponding classes
|
||||
(look for classes of the same name in your typleib).
|
||||
new() will accept a hash structure like this, but transform it to a object
|
||||
tree.
|
||||
|
||||
'GetWeather'=> {
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
},
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
package MyElements::GetWeatherResponse;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
|
||||
|
||||
# atomic complexType
|
||||
# <element name="GetWeatherResponse"><complexType> definition
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType
|
||||
);
|
||||
|
||||
|
||||
my %GetWeatherResult_of :ATTR(:get<GetWeatherResult>);
|
||||
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(
|
||||
GetWeatherResult
|
||||
) ],
|
||||
{
|
||||
GetWeatherResult => \%GetWeatherResult_of,
|
||||
|
||||
},
|
||||
{
|
||||
|
||||
GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
sub get_xmlns { 'http://www.webserviceX.NET' }
|
||||
|
||||
__PACKAGE__->__set_name('GetWeatherResponse');
|
||||
__PACKAGE__->__set_nillable();
|
||||
__PACKAGE__->__set_minOccurs();
|
||||
__PACKAGE__->__set_maxOccurs();
|
||||
__PACKAGE__->__set_ref('');
|
||||
|
||||
1;
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MyElements::GetWeatherResponse
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Type class for the XML element GetWeatherResponse.
|
||||
|
||||
=head1 PROPERTIES
|
||||
|
||||
The following properties may be accessed using get_PROPERTY / set_PROPERTY
|
||||
methods:
|
||||
|
||||
GetWeatherResult
|
||||
|
||||
=head1 Object structure
|
||||
|
||||
GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
|
||||
|
||||
Structure as perl hash:
|
||||
|
||||
The object structure is displayed as hash below though this is not correct.
|
||||
Complex hash elements actually are objects of their corresponding classes
|
||||
(look for classes of the same name in your typleib).
|
||||
new() will accept a hash structure like this, but transform it to a object
|
||||
tree.
|
||||
|
||||
'GetWeatherResponse'=> {
|
||||
'GetWeatherResult' => $someValue,
|
||||
},
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
package MyInterfaces::GlobalWeather;
|
||||
use strict;
|
||||
use warnings;
|
||||
use MyTypemaps::GlobalWeather;
|
||||
use base 'SOAP::WSDL::Client::Base';
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $arg_ref = shift || {};
|
||||
my $self = $class->SUPER::new({
|
||||
class_resolver => 'MyTypemaps::GlobalWeather',
|
||||
proxy => 'http://www.webservicex.net/globalweather.asmx',
|
||||
%{ $arg_ref }
|
||||
});
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
__PACKAGE__->__create_methods(
|
||||
GetWeather => {
|
||||
parts => [ 'MyElements::GetWeather', ],
|
||||
soap_action => 'http://www.webserviceX.NET/GetWeather',
|
||||
style => 'document',
|
||||
# use => '', # use not implemented yet
|
||||
},
|
||||
GetCitiesByCountry => {
|
||||
parts => [ 'MyElements::GetCitiesByCountry', ],
|
||||
soap_action => 'http://www.webserviceX.NET/GetCitiesByCountry',
|
||||
style => 'document',
|
||||
# use => '', # use not implemented yet
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MyInterfaces::GlobalWeather - SOAP interface to GlobalWeather at
|
||||
http://www.webservicex.net/globalweather.asmx
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $interface = MyInterfaces::GlobalWeather->new();
|
||||
my $GetCitiesByCountry = $interface->GetCitiesByCountry();
|
||||
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head2 GetWeather
|
||||
|
||||
Get weather report for all major cities around the world.
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
$service->GetWeather({
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
});
|
||||
|
||||
|
||||
=head2 GetCitiesByCountry
|
||||
|
||||
Get all major cities by country name(full / part).
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
$service->GetCitiesByCountry({
|
||||
'CountryName' => $someValue,
|
||||
});
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
package MySimpleType;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
# restriction base implemented via inheritance
|
||||
@@ -18,7 +18,7 @@ use base qw(
|
||||
# <list itemTipe="xsd:string">
|
||||
# </simpleType>
|
||||
package MySimpleListType;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
# restriction base implemented via inheritance
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
# derive by list
|
||||
@@ -30,7 +30,7 @@ use base qw(
|
||||
);
|
||||
|
||||
package MyAtomicSimpleType;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
# restriction base implemented via inheritance
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
# derive by restriction
|
||||
@@ -41,7 +41,7 @@ use base qw(
|
||||
);
|
||||
|
||||
package MyAtomicSimpleListType;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
# restriction base implemented via inheritance
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
# derive by restriction
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
package MyInterfaces::GlobalWeather;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use MyTypemaps::GlobalWeather;
|
||||
use base 'SOAP::WSDL::Client::Base';
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $arg_ref = shift || {};
|
||||
my $self = $class->SUPER::new({
|
||||
class_resolver => 'MyTypemaps::GlobalWeather',
|
||||
proxy => 'http://www.webservicex.net/globalweather.asmx',
|
||||
%{ $arg_ref }
|
||||
});
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
__PACKAGE__->__create_methods(
|
||||
GetWeather => {
|
||||
parts => [ 'MyElements::GetWeather', ],
|
||||
soap_action => 'http://www.webserviceX.NET/GetWeather',
|
||||
style => 'document',
|
||||
# use => '', # use not implemented yet
|
||||
},
|
||||
GetCitiesByCountry => {
|
||||
parts => [ 'MyElements::GetCitiesByCountry', ],
|
||||
soap_action => 'http://www.webserviceX.NET/GetCitiesByCountry',
|
||||
style => 'document',
|
||||
# use => '', # use not implemented yet
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MyInterfaces::GlobalWeather - SOAP interface to GlobalWeather at
|
||||
http://www.webservicex.net/globalweather.asmx
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $interface = MyInterfaces::GlobalWeather->new();
|
||||
my $GetCitiesByCountry = $interface->GetCitiesByCountry();
|
||||
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head2 GetWeather
|
||||
|
||||
Get weather report for all major cities around the world.
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
$service->GetWeather({
|
||||
'CityName' => $someValue,
|
||||
'CountryName' => $someValue,
|
||||
});
|
||||
|
||||
|
||||
=head2 GetCitiesByCountry
|
||||
|
||||
Get all major cities by country name(full / part).
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
$service->GetCitiesByCountry({
|
||||
'CountryName' => $someValue,
|
||||
});
|
||||
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Typelib::Base;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Fast::Storable;
|
||||
|
||||
sub mk_add_mutators {
|
||||
my $class = shift;
|
||||
@@ -7,7 +7,7 @@ sub mk_add_mutators {
|
||||
for my $method ( keys %{$ attributes }) {
|
||||
*{ "$class\::add_$method" } = sub {
|
||||
my ($self, $value) = @_;
|
||||
my $ident = ident $self;
|
||||
my $ident = ${ $self };
|
||||
|
||||
# we're the first value
|
||||
return $attributes->{ $method }->{ $ident } = $value
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package Typelib::TMessage;
|
||||
use strict;
|
||||
use base qw(Typelib::Base);
|
||||
use Class::Std::Fast constructor => 'basic';
|
||||
|
||||
my %MRecipientURI_of :ATTR(:name<MRecipientURI> :default<()>);
|
||||
my %MMessageContent_of :ATTR(:name<MMessageContent> :default<()>);
|
||||
@@ -23,4 +24,5 @@ my %attributes_of :ATTR();
|
||||
# make a add_BLA method for every attribute
|
||||
__PACKAGE__->mk_add_mutators( \%attributes_of );
|
||||
|
||||
Class::Std::Fast::initialize();
|
||||
1;
|
||||
Reference in New Issue
Block a user