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:
committed by
Michael G. Schwern
parent
c2ac24dd0f
commit
3de318be40
@@ -22,7 +22,7 @@ use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $soap;
|
||||
$soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $url .'/acceptance/wsdl/006_sax_client.wsdl',
|
||||
wsdl => 'file://' . $url .'/acceptance/wsdl/006_sax_client.wsdl',
|
||||
outputxml => 1, # required, if not set ::SOM serializer will be loaded
|
||||
)->wsdlinit();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 => {} }
|
||||
|
||||
@@ -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()
|
||||
};
|
||||
|
||||
@@ -193,6 +193,44 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="testReferencesExtension">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="data" type="tns:testReferencedExtension" />
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="flags" type="xsd:int" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="testReferencedExtension">
|
||||
<xsd:complexContent mixed="false">
|
||||
<xsd:extension base="tns:testExtensionBase">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1"
|
||||
name="test1" type="xsd:int" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1"
|
||||
name="test2" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="test3"
|
||||
type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1"
|
||||
name="test4" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1"
|
||||
name="test5" type="xsd:boolean" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="test6"
|
||||
type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="test7"
|
||||
type="xsd:int" />
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="testExtensionBase" abstract="true">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="test"
|
||||
type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:element name="testElementNestedExtension" type="tns:testComplexNestedExtension" />
|
||||
<xsd:element name="testElementString" type="xsd:string" />
|
||||
<xsd:element name="testElementInt" type="xsd:int" />
|
||||
@@ -272,6 +310,27 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="abstractComplexType" abstract="true">
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="intermediateComplexType">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="abstractComplexType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Name" type="xsd:string"/>
|
||||
<xsd:element name="GivenName" type="xsd:string"/>
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="finalComplexType">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="intermediateComplexType">
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="completelyEmptyComplexType">
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="urn:HelloWorld"
|
||||
xmlns:tns="urn:HelloWorld"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
@@ -37,6 +38,53 @@
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
|
||||
|
||||
<s:complexType name="testAbstract" abstract="true">
|
||||
<s:sequence>
|
||||
<s:element name="abstract" type="s:string"/>
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
|
||||
<s:complexType name="testAbstractChild" abstract="true">
|
||||
<s:complexContent>
|
||||
<s:extension base="tns:testAbstract">
|
||||
<s:sequence>
|
||||
<s:element name="abstractChild" type="s:string"/>
|
||||
</s:sequence>
|
||||
</s:extension>
|
||||
</s:complexContent>
|
||||
</s:complexType>
|
||||
|
||||
<s:complexType name="testAbstractGrandChild">
|
||||
<s:complexContent>
|
||||
<s:extension base="tns:testAbstractChild">
|
||||
<s:sequence>
|
||||
<s:element name="abstractGrandChild" type="s:string"/>
|
||||
</s:sequence>
|
||||
</s:extension>
|
||||
</s:complexContent>
|
||||
</s:complexType>
|
||||
|
||||
<s:complexType name="GrandParent" abstract="true">
|
||||
</s:complexType>
|
||||
|
||||
<s:complexType name="Parent" abstract="true">
|
||||
<s:complexContent>
|
||||
<s:extension base="tns:GrandParent"/>
|
||||
</s:complexContent>
|
||||
</s:complexType>
|
||||
<s:complexType name="Child">
|
||||
<s:complexContent>
|
||||
<s:extension base="tns:Parent">
|
||||
<s:sequence>
|
||||
<s:element name="foo" type="s:string"/>
|
||||
</s:sequence>
|
||||
</s:extension>
|
||||
</s:complexContent>
|
||||
</s:complexType>
|
||||
|
||||
|
||||
</s:schema>
|
||||
</types>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user