import SOAP-WSDL 2.00_09 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_09 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_09.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
312f3d6bbd
commit
a554e87f49
+2
-1
@@ -56,7 +56,8 @@ for my $element (@{ $wsdl->first_types()->get_schema()->[1]->get_type() } ) {
|
||||
next;
|
||||
}
|
||||
my $name = 'MessageGateway::' . $element->get_name();
|
||||
ok eval $output, $name;
|
||||
ok eval $output, $name
|
||||
or die $@, $output;
|
||||
|
||||
ok $name->can('serialize'), "$name\->can('serialize')";
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 6;
|
||||
use Test::More tests => 8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
@@ -39,6 +39,16 @@ ok ($xml = $soap->call('test',
|
||||
testElement1 => 'Test'
|
||||
), 'Serialized (simple) element' );
|
||||
|
||||
ok ($xml = $soap->call('testRef',
|
||||
testElementRef => 'Test'
|
||||
), 'Serialized (simple) element' );
|
||||
|
||||
is $xml
|
||||
, q{<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ><SOAP-ENV:Body><testElementRef xmlns="urn:Test">Test</testElementRef>
|
||||
</SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
||||
, 'element ref serialization result'
|
||||
;
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement min/maxOccurs checks";
|
||||
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
use Test::More tests => 2;
|
||||
use Test::More tests => 4;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
use Date::Parse;
|
||||
use Date::Format;
|
||||
|
||||
sub timezone {
|
||||
my @time = strptime shift;
|
||||
my $tz = strftime('%z', @time);
|
||||
substr $tz, -2, 0, ':';
|
||||
return $tz;
|
||||
}
|
||||
|
||||
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::dateTime');
|
||||
my $obj;
|
||||
my %dates = (
|
||||
'2007-12-31 12:32' => '2007-12-31T12:32:00',
|
||||
'2007-08-31 00:32' => '2007-08-31T00:32:00',
|
||||
'30 Aug 2007' => '2007-08-30T00:00:00',
|
||||
);
|
||||
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new();
|
||||
while (my ($date, $converted) = each %dates ) {
|
||||
|
||||
$obj->set_value( '2037-12-31' );
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new();
|
||||
$obj->set_value( $date );
|
||||
|
||||
is $obj->get_value() , $converted . timezone($date), 'conversion';
|
||||
}
|
||||
$obj->set_value('2007-12-31T00:00:00.0000000+01:00');
|
||||
|
||||
is $obj->get_value() , '2037-12-31T00:00:00+01:00', 'conversion';
|
||||
|
||||
$obj->set_value('2037-12-31T00:00:00.0000000+01:00');
|
||||
|
||||
|
||||
|
||||
# exit;
|
||||
|
||||
#~ use Benchmark;
|
||||
|
||||
@@ -1,17 +1,35 @@
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 6;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
|
||||
use Date::Format;
|
||||
use Date::Parse;
|
||||
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::date');
|
||||
my $obj;
|
||||
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new();
|
||||
sub timezone {
|
||||
my @time = strptime shift;
|
||||
my $tz = strftime('%z', @time);
|
||||
substr $tz, -2, 0, ':';
|
||||
return $tz;
|
||||
}
|
||||
|
||||
$obj->set_value( '2037/12/31' );
|
||||
|
||||
is $obj->get_value() , '2037-12-31+01:00', 'conversion';
|
||||
|
||||
my %dates = (
|
||||
'2007/12/31' => '2007-12-31',
|
||||
'2007:08:31' => '2007-08-31',
|
||||
'30 Aug 2007' => '2007-08-30',
|
||||
);
|
||||
|
||||
while (my ($date, $converted) = each %dates ) {
|
||||
|
||||
$obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new();
|
||||
$obj->set_value( $date );
|
||||
|
||||
is $obj->get_value() , $converted . timezone($date), 'conversion';
|
||||
}
|
||||
|
||||
$obj->set_value('2007-12-31T00:00:00.0000000+01:00');
|
||||
is $obj->get_value() , '2007-12-31+01:00', 'conversion from XML dateTime';
|
||||
|
||||
$obj->set_value( '2037-12-31' );
|
||||
is $obj->get_value() , '2037-12-31', 'no conversion on match';
|
||||
|
||||
@@ -1,72 +1,63 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="urn:Test"
|
||||
targetNamespace="urn:Test"
|
||||
xmlns:tns="urn:Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<definitions name="urn:Test" targetNamespace="urn:Test" xmlns:tns="urn:Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:Test">
|
||||
<xsd:complexType name="testComplexTypeAll">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
<xsd:element name="Test1" type="xsd:string"/>
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:all>
|
||||
<xsd:element name="Test1" type="xsd:string" />
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequence">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="testComplexTypeSequence">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>ComplexType Test</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1" />
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testComplexTypeAll"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexTypeAll"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testComplexTypeAll" />
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexTypeAll" />
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>Test-Methode</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<input message="tns:testRequest" />
|
||||
<output message="tns:testResponse" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal" />
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
@@ -9,12 +9,17 @@
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:Test">
|
||||
<xsd:element name="testElement1" type="xsd:string" />
|
||||
<xsd:element name="testElement2" type="xsd:int" />
|
||||
<xsd:element name="testElement2" type="xsd:int" />
|
||||
<xsd:element name="testElementRef" ref="tns:testElement1" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" element="tns:testElement1"/>
|
||||
</message>
|
||||
<message name="testRefRequest">
|
||||
<part name="testAll" element="tns:testElementRef"/>
|
||||
</message>
|
||||
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testElement1"/>
|
||||
</message>
|
||||
@@ -27,10 +32,18 @@
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
<operation name="testRef">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRefRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<operation name="test">
|
||||
<operation name="test">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
@@ -40,7 +53,18 @@
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</operation>
|
||||
<operation name="testRef">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="testRef">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
|
||||
Reference in New Issue
Block a user