import SOAP-WSDL 2.00_32 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_32
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_32.tar.gz
This commit is contained in:
Martin Kutter
2008-02-14 09:13:39 -08:00
committed by Michael G. Schwern
parent f0b3bdc201
commit 51db446428
36 changed files with 376 additions and 106 deletions

View File

@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 10; #qw(no_plan);
use Test::More tests => 11; #qw(no_plan);
use File::Spec;
use File::Basename;
@@ -52,6 +52,16 @@ is @{ $schema_from_ref }, 2, 'got builtin and imported schema';
ok @{ $schema_from_ref->[1]->get_element } > 0;
is $schema_from_ref->[1]->get_element->[0]->get_name(), 'sayHello';
$SIG{ALRM} = sub { die 'looped'};
alarm 1;
$definitions = $parser->parse_file(
"$path/../../../acceptance/wsdl/WSDLParser_import_loop.wsdl"
);
alarm 0;
pass 'import loop';
__END__
$generator->set_type_prefix('MyTypes');

View File

@@ -1,8 +1,8 @@
use Test::More tests => 41;
use Test::More tests => 42;
use File::Basename qw(dirname);
use File::Spec;
use File::Path;
use diagnostics;
my $path = File::Spec->rel2abs( dirname __FILE__ );
use_ok qw(SOAP::WSDL::Generator::Visitor::Typelib);
@@ -12,7 +12,7 @@ use SOAP::WSDL::Expat::WSDLParser;
my $parser = SOAP::WSDL::Expat::WSDLParser->new();
my $definitions = $parser->parse_file(
my $definitions = $parser->parse_file(
"$path/../../../acceptance/wsdl/generator_test.wsdl"
#"$path/../../../acceptance/wsdl/elementAtomicComplexType.xml"
);
@@ -26,7 +26,7 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
});
my $code = "";
$generator->set_output(\$code);
$generator->set_output(\$code);
$generator->generate_typelib();
{
eval $code;
@@ -47,9 +47,9 @@ $generator->generate();
#$generator->generate_typemap();
if (eval { require Test::Warn; }) {
Test::Warn::warning_like( sub { $generator->generate_interface() },
Test::Warn::warning_like( sub { $generator->generate_interface() },
qr{\A Multiple \s parts \s detected \s in \s message \s testMultiPartWarning}xms);
}
}
else {
$generator->generate_interface();
SKIP: { skip 'Cannot test warnings without Test::Warn', 1 };
@@ -67,7 +67,7 @@ $interface->set_no_dispatch(1);
my $message;
ok $message = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'}
ok $message = $interface->testHeader( { Test1 => 'Test1', Test2 => 'Test2'}
, { Test1 => 'Header1', Test2 => 'Header2'}), 'call soap method (no_dispatch)';
use_ok qw(SOAP::WSDL::Expat::MessageParser);
@@ -140,13 +140,13 @@ my $ct_east = MyTypes::testComplexTypeElementAtomicSimpleType->new({
is $ct_east->get_testAtomicSimpleTypeElement, 42;
is $ct_east->get_testAtomicSimpleTypeElement->get_value(), 42;
isa_ok($ct_east->get_testAtomicSimpleTypeElement,
isa_ok($ct_east->get_testAtomicSimpleTypeElement,
'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement');
is $ct_east->get_testAtomicSimpleTypeElement2, 23;
is $ct_east->get_testAtomicSimpleTypeElement2->get_value(), 23;
isa_ok($ct_east->get_testAtomicSimpleTypeElement2,
isa_ok($ct_east->get_testAtomicSimpleTypeElement2,
'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement2');
ok eval { require MyElements::testElementCompletelyEmptyComplex; }
@@ -155,6 +155,10 @@ ok my $empty = MyElements::testElementCompletelyEmptyComplex->new();
is $empty->serialize_qualified(), '<testElementCompletelyEmptyComplex xmlns="urn:Test"/>'
, 'serialize empty';
ok eval { require MyTypes::testComplexTypeSimpleRestriction; }
, 'load MyTypes::testComplexTypeSimpleRestriction';
rmtree "$path/testlib";

View File

@@ -5,7 +5,7 @@ use Test::More tests => 2; #qw(no_plan);
use_ok qw(SOAP::WSDL::XSD::ComplexType);
my $obj = SOAP::WSDL::XSD::ComplexType->new();
$obj->set_flavor('extension');
$obj->set_variety('extension');
eval { $obj->serialize('foo') };
like $@, qr{sorry, \s we \s just}xsm;
like $@, qr{sorry, \s we \s just}xsm;

View File

@@ -0,0 +1,60 @@
<?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>
<s:import namespace="urn:HelloWorld" schemaLocation="import_loop.xsd"/>
</s:schema>
</types>
<message name="sayHelloSoapIn">
<part name="parameters" element="s0:sayHello" />
</message>
<message name="sayHelloSoapOut">
<part name="parameters" element="s0:sayHelloResponse" />
</message>
<portType name="Service1Soap">
<operation name="sayHello">
<input message="s0:sayHelloSoapIn" />
<output message="s0:sayHelloSoapOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="sayHello">
<soap:operation soapAction="urn:HelloWorld#sayHello"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address
location="http://localhost:81/soap-wsdl-test/helloworld.pl" />
</port>
</service>
</definitions>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<definitions name="Test"
<definitions name="Test"
targetNamespace="urn:Test"
xmlns:tns="urn:Test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -43,7 +43,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
<xsd:maxExclusive value="10"/>
</xsd:restriction>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="testRestrictionAtomicType">
@@ -57,7 +57,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
<xsd:maxExclusive value="10"/>
</xsd:restriction>
</xsd:restriction>
</xsd:simpleType>
</xsd:restriction>
</xsd:simpleType>
@@ -78,12 +78,25 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
</xsd:annotation>
<xsd:complexContent>
<xsd:restriction base="tns:testComplexTypeAll">
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
<xsd:all>
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
</xsd:all>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="testComplexTypeSimpleRestriction">
<xsd:annotation>
<xsd:documentation>ComplexType Test</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="xsd:string">
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="testComplexTypeExtension">
<xsd:annotation>
<xsd:documentation>complexType extension test</xsd:documentation>
@@ -146,10 +159,10 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:element name="testElementAtomicSimpleTypeRestriction">
<xsd:simpleType>
<xsd:annotation>
<xsd:documentation> SimpleType: Integer between 1 and 9
<xsd:documentation> SimpleType: Integer between 1 and 9
(Inclusive constraints) </xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:int" minInclusive="1"
<xsd:restriction base="xsd:int" minInclusive="1"
maxInclusive="9"/>
</xsd:simpleType>
</xsd:element>
@@ -157,7 +170,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:element name="testElementAtomicComplexTypeAll">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation> SimpleType: Integer between 1 and 9
<xsd:documentation> SimpleType: Integer between 1 and 9
(Inclusive constraints) </xsd:documentation>
</xsd:annotation>
<xsd:all>
@@ -170,8 +183,8 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:element name="Header" type="tns:testComplexTypeSequence"/>
<xsd:element name="testHeader" type="tns:testComplexTypeSequence"/>
<xsd:element name="testChoice" type="tns:testComplexTypeChoice"/>
<xsd:complexType name="testComplexTypeElementAtomicSimpleType">
<xsd:sequence>
<xsd:element name="testString" type="xsd:string" minOccurs="0"/>
@@ -191,8 +204,8 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="testElementEmptyComplex">
<xsd:complexType>
<xsd:sequence/>
@@ -206,7 +219,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<xsd:complexType>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="completelyEmptyComplexType">
</xsd:complexType>
@@ -219,7 +232,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<part name="testAll" element="tns:testElementString"/>
</message>
<message name="testResponse">
<part name="testAll" element="tns:testElementString"/>
<part name="testAll" element="tns:testElementString"/>
</message>
<message name="testMultiPartWarning">
<part name="testAll" element="tns:testElementString"/>
@@ -230,7 +243,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<part name="testHeader" element="tns:Header"/>
</message>
<message name="testHeaderResponse">
<part name="testAll" element="tns:testElementString"/>
<part name="testAll" element="tns:testElementString"/>
</message>
<message name="testEmptyComplex">
@@ -284,7 +297,7 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
<soap:body use="literal"/>
</output>
</operation>
<operation name="test">
<soap:operation soapAction="test" style="document"/>
<input>

View File

@@ -0,0 +1,24 @@
<s:schema elementFormDefault="qualified" targetNamespace="urn:HelloWorld"
xmlns:s="http://www.w3.org/2001/XMLSchema">
<s:import namespace="urn:HelloWorld" schemaLocation="import_loop.xsd"/>
<s:element name="sayHello">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="name"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="givenName"
type="s:string" nillable="1" />
</s:sequence>
<s:attribute name="testAttr" type="s:string" use="optional"></s:attribute>
</s:complexType>
</s:element>
<s:element name="sayHelloResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sayHelloResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>

View File

@@ -3,10 +3,11 @@ package MyComplexType;
use strict;
use Class::Std::Fast::Storable constructor => 'none';
use lib '../../lib';
use SOAP::WSDL::XSD::Typelib::ComplexType;
use base ('SOAP::WSDL::XSD::Typelib::ComplexType');
my %MyTestName_of :ATTR(:get<MyTestName>);
Class::Std::initialize();
my %MyTestName_of :ATTR(:get<MyTestName>);
__PACKAGE__->_factory(
[ qw(MyTestName) ], # order