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
@@ -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';
|
||||
Reference in New Issue
Block a user