import SOAP-WSDL 2.00.06 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00.06
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.06.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:48:54 -08:00
committed by Michael G. Schwern
parent c2ac24dd0f
commit 3de318be40
66 changed files with 758 additions and 342 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 8; #qw(no_plan);
use Test::More tests => 9; #qw(no_plan);
use_ok qw(SOAP::WSDL::Client);
ok my $client = SOAP::WSDL::Client->new();
@@ -9,6 +9,8 @@ ok $client = SOAP::WSDL::Client->new({
proxy => 'http://localhost',
});
is $client->get_content_type(), 'text/xml; charset=utf-8';
is $client->get_endpoint(), 'http://localhost';
$client->no_dispatch(1);
+15 -2
View File
@@ -1,4 +1,4 @@
use Test::More tests => 68;
use Test::More tests => 71;
use File::Basename qw(dirname);
use File::Spec;
use File::Path;
@@ -51,6 +51,7 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
my $code = "";
$generator->set_output(\$code);
$generator->generate_typelib();
{
eval $code;
@@ -227,12 +228,24 @@ is q{<testAtomicRef xmlns="urn:Test"><in>foo</in></testAtomicRef>}
SKIP: {
eval { require Test::Pod::Content; }
or skip 'Cannot test pod content without Test::Pod::Content', 1;
or skip 'Cannot test pod content without Test::Pod::Content', 2;
Test::Pod::Content::pod_section_like(
'MyTypes::testComplexTypeSequenceWithAttribute',
'attr',
qr{Test \s Attribute \s good \s for \s nothing}x,
'Attribute POD');
Test::Pod::Content::pod_section_like(
'MyInterfaces::testService::testPort',
'testChoice',
qr{Returns \s a \s MyElements::testComplexTypeRestriction \s object\.}x,
'Interface POD contains response class name');
}
use_ok qw(MyTypes::finalComplexType);
{
no warnings qw(once);
ok *MyTypes::finalComplexType::get_Name, 'complexType inheritance flattened out';
}
ok $typemap = MyTypemaps::testService->get_typemap();
@@ -1,4 +1,4 @@
use Test::More tests => 14;
use Test::More tests => 17;
use File::Basename qw(dirname);
use File::Spec;
use File::Path;
@@ -115,4 +115,10 @@ sub xml {
</SOAP-ENV:Body></SOAP-ENV:Envelope>};
}
require FooType::testAbstractGrandChild;
ok(FooType::testAbstractGrandChild->can('get_abstractGrandChild'), 'attribute');
ok(FooType::testAbstractGrandChild->can('get_abstractChild'), 'parent attribute');
ok(FooType::testAbstractGrandChild->can('get_abstract'), 'grandparent attribute');
rmtree "$path/testlib";
+11 -6
View File
@@ -17,13 +17,18 @@ like $serializer->serialize({ body => {} }), qr{<SOAP-ENV:Body></SOAP-ENV:Body>}
like $serializer->serialize({ body => [] }), qr{<SOAP-ENV:Body></SOAP-ENV:Body>}, 'empty body';
like $serializer->serialize({ header => {}, body => [] }),
qr{<SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body></SOAP-ENV:Body>}, 'empty header and body';
like $serializer->serialize({ header => {}, body => [] , options => {
like $serializer->serialize({
header => {},
body => [] ,
options => {
namespace => {
'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP',
'http://www.w3.org/2001/XMLSchema-instance' => 'xsi',
}
} }),
qr{<SOAP:Header></SOAP:Header><SOAP:Body></SOAP:Body>}, 'empty header and body';
'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP',
'http://www.w3.org/2001/XMLSchema-instance' => 'xsi',
}
}})
, qr{xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"}
, 'namespace';
like $serializer->serialize({ header => {}, body => [ undef ] }),
qr{<SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body></SOAP-ENV:Body>}, 'empty header and body';
+17 -3
View File
@@ -1,4 +1,4 @@
use Test::More tests => 7;
use Test::More tests => 8;
use strict;
use utf8;
@@ -15,10 +15,24 @@ my $result = $transport->send_receive(envelope => 'Test', action => 'foo');
ok ! $transport->is_success();
$result = $transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ',
$result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ',
action => 'foo');
ok ! $transport->is_success();
$result = $transport->send_receive(encoding => 'utf8', envelope => 'ÄÖÜ',
$result = $transport->send_receive(encoding => 'utf-8', envelope => 'ÄÖÜ',
action => 'foo', content_type => 'application/xml');
ok ! $transport->is_success();
{
no warnings qw(redefine);
my $request_sub =\&LWP::UserAgent::request;
*LWP::UserAgent::request = sub {
my $self = shift;
my $request = shift;
is $request->header('Content-Type'), 'text/xml; charset=utf-8';
return HTTP::Response->new();
};
$transport->send_receive(envelope => 'Test', action => 'foo');
*LWP::UserAgent::request = $request_sub;
}
+3 -2
View File
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 3; #qw(no_plan);
use Test::More tests => 5; #qw(no_plan);
use_ok qw(SOAP::WSDL::XSD::ComplexType);
@@ -11,7 +11,8 @@ eval { $obj->serialize('foo') };
like $@, qr{sorry, \s we \s just}xsm;
$obj->set_targetNamespace('bar');
ok $obj->set_abstract(1);
ok $obj->set_final(1);
eval {
$obj->serialize(
'foo', 'bar', { autotype => 1 , namespace => {} }
+7 -3
View File
@@ -327,8 +327,12 @@ like $@, qr{unknown \s field \s foobar \s in \s MyType }xms;
eval { $obj->set_FOO(42) };
like $@, qr{Can't \s locate \s object \s method}x, 'error on calling unknown object method';
eval { MyType->set_FOO(42) };
like $@, qr{Can't \s locate \s object \s method}x, 'error on calling unknown class method';
TODO: {
local $TODO = "Identify calls to class methods";
eval { MyType->set_FOO(42) };
like $@, qr{Can't \s locate \s class \s method}x, 'error on calling unknown class method';
}
ok ! MyType->can('set_FOO'), 'MyType->can("setFOO")';
@@ -338,7 +342,7 @@ eval { MyType->new({ FOO => 42 }) };
like $@, qr{unknown \s field \s}xm, 'error passing unknown field to constructor';
eval {
# catch warning -
# catch warning -
local $SIG{__WARN__} = sub {};
SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD()
};