Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51db446428 | ||
|
|
f0b3bdc201 |
@@ -5,7 +5,7 @@ $build = Module::Build->new(
|
|||||||
create_makefile_pl => 'passthrough',
|
create_makefile_pl => 'passthrough',
|
||||||
dist_abstract => 'SOAP with WSDL support',
|
dist_abstract => 'SOAP with WSDL support',
|
||||||
dist_name => 'SOAP-WSDL',
|
dist_name => 'SOAP-WSDL',
|
||||||
dist_version => '2.00_29',
|
dist_version => '2.00_32',
|
||||||
module_name => 'SOAP::WSDL',
|
module_name => 'SOAP::WSDL',
|
||||||
license => 'artistic',
|
license => 'artistic',
|
||||||
requires => {
|
requires => {
|
||||||
@@ -24,6 +24,7 @@ $build = Module::Build->new(
|
|||||||
'LWP::UserAgent' => 0,
|
'LWP::UserAgent' => 0,
|
||||||
'Template' => 0,
|
'Template' => 0,
|
||||||
'Term::ReadKey' => 0,
|
'Term::ReadKey' => 0,
|
||||||
|
'URI' => 0,
|
||||||
'XML::Parser::Expat' => 0,
|
'XML::Parser::Expat' => 0,
|
||||||
},
|
},
|
||||||
buildrequires => {
|
buildrequires => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Release notes for SOAP::WSDL 2.00_29
|
Release notes for SOAP::WSDL 2.00_32
|
||||||
-------
|
-------
|
||||||
|
|
||||||
I'm proud to present a new pre-release version of SOAP::WSDL.
|
I'm proud to present a new pre-release version of SOAP::WSDL.
|
||||||
@@ -34,6 +34,68 @@ Features:
|
|||||||
|
|
||||||
The following changes have been made:
|
The following changes have been made:
|
||||||
|
|
||||||
|
2.00_32
|
||||||
|
|
||||||
|
The following features were added (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924):
|
||||||
|
|
||||||
|
The following bugs have been fixed (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921):
|
||||||
|
The numbers with # are CPAN RT IDs (http://rt.cpan.org/).
|
||||||
|
|
||||||
|
* [ 1893147 ] Segfault on 2.0.0_31
|
||||||
|
|
||||||
|
The following uncategorized improvements have been made:
|
||||||
|
|
||||||
|
* changed SOAP::WSDL::XSD::ComplexType's set_/get_flavor methods to
|
||||||
|
set_/get_variety to reflect the XML standard more closely.
|
||||||
|
get_flavor is retained for compatibility reasons.
|
||||||
|
* added initial support for complexType/simpleContent definitions. Right
|
||||||
|
now, only restriction derivations are supported.
|
||||||
|
* fixed an error in the generator_test.wsdl
|
||||||
|
|
||||||
|
2.00_31 - Feb 11 2007
|
||||||
|
|
||||||
|
The following features were added (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924):
|
||||||
|
|
||||||
|
* [ 1883843 ] Support wsdl:import
|
||||||
|
* [ 1883863 ] Support xsd:import
|
||||||
|
|
||||||
|
The following bugs have been fixed (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921):
|
||||||
|
The numbers with # are CPAN RT IDs (http://rt.cpan.org/).
|
||||||
|
|
||||||
|
The following uncategorized improvements have been made:
|
||||||
|
|
||||||
|
* The WSDL Parser now warns about unsupported WSDL / XML schema elements
|
||||||
|
* Fixed path handling in t/006_client.t
|
||||||
|
* Removed useless ms regex flag in SOAP::WSDL::Factory::Transport
|
||||||
|
* The test suite has been improved
|
||||||
|
|
||||||
|
2.00_30 - unreleased
|
||||||
|
|
||||||
|
The following features were added (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924):
|
||||||
|
|
||||||
|
* [ 1875288 ] Support XML attributes (partial)
|
||||||
|
|
||||||
|
The following bugs have been fixed (the numbers in square brackets are the
|
||||||
|
tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921):
|
||||||
|
The numbers with # are CPAN RT IDs (http://rt.cpan.org/).
|
||||||
|
|
||||||
|
* [ 1876435 ] Test on perl-5.10 fails
|
||||||
|
* #32611 empty complexType structure classes are missing 'use Class::Std::Fast::Storable'
|
||||||
|
|
||||||
|
The following uncategorized improvements have been made:
|
||||||
|
|
||||||
|
* ComplexType objects now accept { foo => undef } in constructor and handle
|
||||||
|
it as non-present child element foo.
|
||||||
|
* Updated test suite
|
||||||
|
* Updated SOAP::WSDL::Client::Base to correctly handle SOAP calls with
|
||||||
|
no parameters (empty parts)
|
||||||
|
* Test on perl-5.10 fails when SOAP::Lite is not installed
|
||||||
|
|
||||||
2.00_29
|
2.00_29
|
||||||
|
|
||||||
The following bugs have been fixed (the numbers in square brackets are the
|
The following bugs have been fixed (the numbers in square brackets are the
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ benchmark/01_expat.t
|
|||||||
benchmark/hello.pl
|
benchmark/hello.pl
|
||||||
benchmark/person.pl
|
benchmark/person.pl
|
||||||
benchmark/person.xml
|
benchmark/person.xml
|
||||||
|
benchmark/person_profile.pl
|
||||||
benchmark/XSD/01_anyType.t
|
benchmark/XSD/01_anyType.t
|
||||||
benchmark/XSD/02_anySimpleType.t
|
benchmark/XSD/02_anySimpleType.t
|
||||||
benchmark/XSD/03_string.t
|
benchmark/XSD/03_string.t
|
||||||
@@ -92,6 +93,7 @@ lib/SOAP/WSDL/Factory/Generator.pm
|
|||||||
lib/SOAP/WSDL/Factory/Serializer.pm
|
lib/SOAP/WSDL/Factory/Serializer.pm
|
||||||
lib/SOAP/WSDL/Factory/Transport.pm
|
lib/SOAP/WSDL/Factory/Transport.pm
|
||||||
lib/SOAP/WSDL/Generator/Template.pm
|
lib/SOAP/WSDL/Generator/Template.pm
|
||||||
|
lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD.pm
|
lib/SOAP/WSDL/Generator/Template/XSD.pm
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/_type_class.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/_type_class.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt
|
||||||
@@ -105,8 +107,10 @@ lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt
|
|||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt
|
||||||
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/simpleContent.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt
|
||||||
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/simpleContent.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/complexType/variety.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/element.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/element.tt
|
||||||
lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt
|
lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt
|
||||||
@@ -229,7 +233,6 @@ Makefile.PL
|
|||||||
MANIFEST This list of files
|
MANIFEST This list of files
|
||||||
META.yml
|
META.yml
|
||||||
MIGRATING
|
MIGRATING
|
||||||
patches/Manual.diff
|
|
||||||
README
|
README
|
||||||
t/001_use.t
|
t/001_use.t
|
||||||
t/002_parse_wsdl.t
|
t/002_parse_wsdl.t
|
||||||
@@ -281,8 +284,13 @@ t/acceptance/wsdl/email_account.wsdl
|
|||||||
t/acceptance/wsdl/generator_test.wsdl
|
t/acceptance/wsdl/generator_test.wsdl
|
||||||
t/acceptance/wsdl/generator_test_dot_names.wsdl
|
t/acceptance/wsdl/generator_test_dot_names.wsdl
|
||||||
t/acceptance/wsdl/generator_unsupported_test.wsdl
|
t/acceptance/wsdl/generator_unsupported_test.wsdl
|
||||||
|
t/acceptance/wsdl/import.xsd
|
||||||
|
t/acceptance/wsdl/import_loop.xsd
|
||||||
t/acceptance/wsdl/message_gateway.wsdl
|
t/acceptance/wsdl/message_gateway.wsdl
|
||||||
|
t/acceptance/wsdl/WSDLParser-import.wsdl
|
||||||
|
t/acceptance/wsdl/WSDLParser-imported.wsdl
|
||||||
t/acceptance/wsdl/WSDLParser.wsdl
|
t/acceptance/wsdl/WSDLParser.wsdl
|
||||||
|
t/acceptance/wsdl/WSDLParser_import_loop.wsdl
|
||||||
t/contributed.wsdl
|
t/contributed.wsdl
|
||||||
t/Expat/03_wsdl.t
|
t/Expat/03_wsdl.t
|
||||||
t/lib/MyComplexType.pm
|
t/lib/MyComplexType.pm
|
||||||
@@ -313,6 +321,7 @@ t/SOAP/WSDL/11_helloworld.NET.t
|
|||||||
t/SOAP/WSDL/12_binding.t
|
t/SOAP/WSDL/12_binding.t
|
||||||
t/SOAP/WSDL/Client.t
|
t/SOAP/WSDL/Client.t
|
||||||
t/SOAP/WSDL/Client/Base.t
|
t/SOAP/WSDL/Client/Base.t
|
||||||
|
t/SOAP/WSDL/Definitions.t
|
||||||
t/SOAP/WSDL/Deserializer/Hash.t
|
t/SOAP/WSDL/Deserializer/Hash.t
|
||||||
t/SOAP/WSDL/Deserializer/SOM.t
|
t/SOAP/WSDL/Deserializer/SOM.t
|
||||||
t/SOAP/WSDL/Deserializer/XSD.t
|
t/SOAP/WSDL/Deserializer/XSD.t
|
||||||
@@ -330,6 +339,7 @@ t/SOAP/WSDL/Generator/XSD.t
|
|||||||
t/SOAP/WSDL/Generator/XSD_dot_names.t
|
t/SOAP/WSDL/Generator/XSD_dot_names.t
|
||||||
t/SOAP/WSDL/Generator/XSD_unsupported.t
|
t/SOAP/WSDL/Generator/XSD_unsupported.t
|
||||||
t/SOAP/WSDL/Part.t
|
t/SOAP/WSDL/Part.t
|
||||||
|
t/SOAP/WSDL/PortType.t
|
||||||
t/SOAP/WSDL/Serializer/XSD.t
|
t/SOAP/WSDL/Serializer/XSD.t
|
||||||
t/SOAP/WSDL/Server.t
|
t/SOAP/WSDL/Server.t
|
||||||
t/SOAP/WSDL/Server/CGI.t
|
t/SOAP/WSDL/Server/CGI.t
|
||||||
@@ -338,8 +348,10 @@ t/SOAP/WSDL/Transport/02_HTTP.t
|
|||||||
t/SOAP/WSDL/Transport/acceptance/test2.xml
|
t/SOAP/WSDL/Transport/acceptance/test2.xml
|
||||||
t/SOAP/WSDL/Transport/acceptance/test3.xml
|
t/SOAP/WSDL/Transport/acceptance/test3.xml
|
||||||
t/SOAP/WSDL/Typelib/Fault11.t
|
t/SOAP/WSDL/Typelib/Fault11.t
|
||||||
|
t/SOAP/WSDL/XSD/Attribute.t
|
||||||
t/SOAP/WSDL/XSD/ComplexType.t
|
t/SOAP/WSDL/XSD/ComplexType.t
|
||||||
t/SOAP/WSDL/XSD/Element.t
|
t/SOAP/WSDL/XSD/Element.t
|
||||||
|
t/SOAP/WSDL/XSD/Schema.t
|
||||||
t/SOAP/WSDL/XSD/SimpleType.t
|
t/SOAP/WSDL/XSD/SimpleType.t
|
||||||
t/SOAP/WSDL/XSD/Typelib/Attribute.t
|
t/SOAP/WSDL/XSD/Typelib/Attribute.t
|
||||||
t/SOAP/WSDL/XSD/Typelib/Builtin/01_constructors.t
|
t/SOAP/WSDL/XSD/Typelib/Builtin/01_constructors.t
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: SOAP-WSDL
|
name: SOAP-WSDL
|
||||||
version: 2.00_29
|
version: 2.00_32
|
||||||
author:
|
author:
|
||||||
- 'Martin Kutter <martin.kutter@fen-net.de>'
|
- 'Martin Kutter <martin.kutter@fen-net.de>'
|
||||||
abstract: SOAP with WSDL support
|
abstract: SOAP with WSDL support
|
||||||
@@ -25,12 +25,13 @@ requires:
|
|||||||
List::Util: 0
|
List::Util: 0
|
||||||
Template: 0
|
Template: 0
|
||||||
Term::ReadKey: 0
|
Term::ReadKey: 0
|
||||||
|
URI: 0
|
||||||
XML::Parser::Expat: 0
|
XML::Parser::Expat: 0
|
||||||
perl: 5.8.0
|
perl: 5.8.0
|
||||||
provides:
|
provides:
|
||||||
SOAP::WSDL:
|
SOAP::WSDL:
|
||||||
file: lib/SOAP/WSDL.pm
|
file: lib/SOAP/WSDL.pm
|
||||||
version: 2.00_25
|
version: 2.00_32
|
||||||
SOAP::WSDL::Base:
|
SOAP::WSDL::Base:
|
||||||
file: lib/SOAP/WSDL/Base.pm
|
file: lib/SOAP/WSDL/Base.pm
|
||||||
version: 2.00_27
|
version: 2.00_27
|
||||||
@@ -56,7 +57,7 @@ provides:
|
|||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
SOAP::WSDL::Expat::Base:
|
SOAP::WSDL::Expat::Base:
|
||||||
file: lib/SOAP/WSDL/Expat/Base.pm
|
file: lib/SOAP/WSDL/Expat/Base.pm
|
||||||
version: 2.00_27
|
version: 2.00_32
|
||||||
SOAP::WSDL::Expat::Message2Hash:
|
SOAP::WSDL::Expat::Message2Hash:
|
||||||
file: lib/SOAP/WSDL/Expat/Message2Hash.pm
|
file: lib/SOAP/WSDL/Expat/Message2Hash.pm
|
||||||
version: 2.00_27
|
version: 2.00_27
|
||||||
@@ -77,10 +78,12 @@ provides:
|
|||||||
version: 2.00_24
|
version: 2.00_24
|
||||||
SOAP::WSDL::Factory::Transport:
|
SOAP::WSDL::Factory::Transport:
|
||||||
file: lib/SOAP/WSDL/Factory/Transport.pm
|
file: lib/SOAP/WSDL/Factory/Transport.pm
|
||||||
version: 2.00_25
|
version: 2.00_31
|
||||||
SOAP::WSDL::Generator::Template:
|
SOAP::WSDL::Generator::Template:
|
||||||
file: lib/SOAP/WSDL/Generator/Template.pm
|
file: lib/SOAP/WSDL/Generator/Template.pm
|
||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
|
SOAP::WSDL::Generator::Template::Plugin::XSD:
|
||||||
|
file: lib/SOAP/WSDL/Generator/Template/Plugin/XSD.pm
|
||||||
SOAP::WSDL::Generator::Template::XSD:
|
SOAP::WSDL::Generator::Template::XSD:
|
||||||
file: lib/SOAP/WSDL/Generator/Template/XSD.pm
|
file: lib/SOAP/WSDL/Generator/Template/XSD.pm
|
||||||
version: 2.00_27
|
version: 2.00_27
|
||||||
@@ -139,7 +142,7 @@ provides:
|
|||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
SOAP::WSDL::TypeLookup:
|
SOAP::WSDL::TypeLookup:
|
||||||
file: lib/SOAP/WSDL/TypeLookup.pm
|
file: lib/SOAP/WSDL/TypeLookup.pm
|
||||||
version: 2.00_29
|
version: 2.00_31
|
||||||
SOAP::WSDL::Types:
|
SOAP::WSDL::Types:
|
||||||
file: lib/SOAP/WSDL/Types.pm
|
file: lib/SOAP/WSDL/Types.pm
|
||||||
SOAP::WSDL::XSD::Attribute:
|
SOAP::WSDL::XSD::Attribute:
|
||||||
@@ -149,7 +152,7 @@ provides:
|
|||||||
file: lib/SOAP/WSDL/XSD/Builtin.pm
|
file: lib/SOAP/WSDL/XSD/Builtin.pm
|
||||||
SOAP::WSDL::XSD::ComplexType:
|
SOAP::WSDL::XSD::ComplexType:
|
||||||
file: lib/SOAP/WSDL/XSD/ComplexType.pm
|
file: lib/SOAP/WSDL/XSD/ComplexType.pm
|
||||||
version: 2.00_25
|
version: 2.00_29
|
||||||
SOAP::WSDL::XSD::Element:
|
SOAP::WSDL::XSD::Element:
|
||||||
file: lib/SOAP/WSDL/XSD/Element.pm
|
file: lib/SOAP/WSDL/XSD/Element.pm
|
||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
@@ -163,8 +166,10 @@ provides:
|
|||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
SOAP::WSDL::XSD::Typelib::Attribute:
|
SOAP::WSDL::XSD::Typelib::Attribute:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/Attribute.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Attribute.pm
|
||||||
|
version: 2.00_29
|
||||||
SOAP::WSDL::XSD::Typelib::AttributeSet:
|
SOAP::WSDL::XSD::Typelib::AttributeSet:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/AttributeSet.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/AttributeSet.pm
|
||||||
|
version: 2.00_29
|
||||||
SOAP::WSDL::XSD::Typelib::Builtin:
|
SOAP::WSDL::XSD::Typelib::Builtin:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||||
version: 2.00_25
|
version: 2.00_25
|
||||||
@@ -265,7 +270,7 @@ provides:
|
|||||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm
|
||||||
SOAP::WSDL::XSD::Typelib::ComplexType:
|
SOAP::WSDL::XSD::Typelib::ComplexType:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
|
||||||
version: 2.00_29
|
version: 2.00_31
|
||||||
SOAP::WSDL::XSD::Typelib::Element:
|
SOAP::WSDL::XSD::Typelib::Element:
|
||||||
file: lib/SOAP/WSDL/XSD/Typelib/Element.pm
|
file: lib/SOAP/WSDL/XSD/Typelib/Element.pm
|
||||||
version: 2.00_29
|
version: 2.00_29
|
||||||
|
|||||||
@@ -1,7 +1,23 @@
|
|||||||
MIGRATING
|
MIGRATING
|
||||||
---------
|
---------
|
||||||
|
|
||||||
This document describes how to migrate from 2.00_24 and before versions to
|
MIGRATING FROM PRE-2.00_29
|
||||||
|
--------------------------
|
||||||
|
SOAP::WSDL 2.00_29 added experimental XML attribute support. The attribute
|
||||||
|
support changed the code of the generated classes, which may now
|
||||||
|
require the class SOAP::WSDL::XSD::Typelib::Attribute introduced in the same
|
||||||
|
pre-release.
|
||||||
|
|
||||||
|
While interfaces generated with pre-releases back to 2.00_25 work without
|
||||||
|
change, this does not hold true vice versa: Interfaces generated with
|
||||||
|
2.00_29 and above won't work with older pre-releases.
|
||||||
|
|
||||||
|
You'll have to update SOAP::WSDL on all your machines.
|
||||||
|
|
||||||
|
MIGRATING FROM PRE-2.00_24
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
This section describes how to migrate from 2.00_24 and before versions to
|
||||||
2.00_25.
|
2.00_25.
|
||||||
|
|
||||||
Migrating from 2.00_xx
|
Migrating from 2.00_xx
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
use lib '../lib';
|
||||||
|
use lib '../example/lib';
|
||||||
|
use lib '../../SOAP-WSDL_XS/blib/lib';
|
||||||
|
use lib '../../SOAP-WSDL_XS/blib/arch';
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use MyInterfaces::TestService::TestPort;
|
||||||
|
|
||||||
|
my $soap = MyInterfaces::TestService::TestPort->new();
|
||||||
|
# Load all classes - XML::Compile has created everything before, too
|
||||||
|
for (1..100) { $soap->ListPerson({}) };
|
||||||
+5
-8
@@ -69,8 +69,6 @@ my $url = $ARGV[0];
|
|||||||
pod2usage( -exit => 1 , verbose => 2 ) if ($opt{help});
|
pod2usage( -exit => 1 , verbose => 2 ) if ($opt{help});
|
||||||
pod2usage( -exit => 1 , verbose => 1 ) if not ($url);
|
pod2usage( -exit => 1 , verbose => 1 ) if not ($url);
|
||||||
|
|
||||||
my $parser = SOAP::WSDL::Expat::WSDLParser->new();
|
|
||||||
|
|
||||||
local $ENV{HTTP_PROXY} = $opt{proxy} if $opt{proxy};
|
local $ENV{HTTP_PROXY} = $opt{proxy} if $opt{proxy};
|
||||||
local $ENV{HTTPS_PROXY} = $opt{proxy} if $opt{proxy};
|
local $ENV{HTTPS_PROXY} = $opt{proxy} if $opt{proxy};
|
||||||
|
|
||||||
@@ -81,12 +79,11 @@ my $lwp = LWP::UserAgent->new(
|
|||||||
);
|
);
|
||||||
$lwp->env_proxy(); # get proxy from environment. Works for both http & https.
|
$lwp->env_proxy(); # get proxy from environment. Works for both http & https.
|
||||||
|
|
||||||
my $response = $lwp->get($url);
|
my $parser = SOAP::WSDL::Expat::WSDLParser->new({
|
||||||
die $response->message(), "\n" if $response->code != 200;
|
user_agent => $lwp,
|
||||||
|
});
|
||||||
|
|
||||||
my $xml = $response->content();
|
my $definitions = $parser->parse_uri( $url );
|
||||||
|
|
||||||
my $definitions = $parser->parse_string( $xml );
|
|
||||||
|
|
||||||
my %typemap = ();
|
my %typemap = ();
|
||||||
|
|
||||||
@@ -112,7 +109,7 @@ $generator->set_element_prefix($opt{ element_prefix }) if $generator->can('set_e
|
|||||||
$generator->set_interface_prefix($opt{ interface_prefix }) if $generator->can('set_interface_prefix');
|
$generator->set_interface_prefix($opt{ interface_prefix }) if $generator->can('set_interface_prefix');
|
||||||
$generator->set_OUTPUT_PATH($opt{ base_path }) if $generator->can('set_OUTPUT_PATH');
|
$generator->set_OUTPUT_PATH($opt{ base_path }) if $generator->can('set_OUTPUT_PATH');
|
||||||
$generator->set_definitions($definitions) if $generator->can('set_definitions');
|
$generator->set_definitions($definitions) if $generator->can('set_definitions');
|
||||||
$generator->set_wsdl($xml) if $generator->can('set_wsdl');
|
# $generator->set_wsdl($xml) if $generator->can('set_wsdl');
|
||||||
|
|
||||||
# start with typelib, as errors will most likely occur here...
|
# start with typelib, as errors will most likely occur here...
|
||||||
$generator->generate();
|
$generator->generate();
|
||||||
|
|||||||
+14
-8
@@ -14,7 +14,7 @@ use Class::Std::Fast;
|
|||||||
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
|
|
||||||
our $VERSION= '2.00_25';
|
our $VERSION= '2.00_32';
|
||||||
|
|
||||||
my %no_dispatch_of :ATTR(:name<no_dispatch>);
|
my %no_dispatch_of :ATTR(:name<no_dispatch>);
|
||||||
my %wsdl_of :ATTR(:name<wsdl>);
|
my %wsdl_of :ATTR(:name<wsdl>);
|
||||||
@@ -176,7 +176,7 @@ sub _wsdl_init_methods :PRIVATE {
|
|||||||
my $ns = $wsdl->get_targetNamespace();
|
my $ns = $wsdl->get_targetNamespace();
|
||||||
|
|
||||||
# get bindings, portType, message, part(s) - use private methods for clear separation...
|
# get bindings, portType, message, part(s) - use private methods for clear separation...
|
||||||
$self->_wsdl_get_service if not ($service_of{ $ident });
|
$self->_wsdl_get_service();
|
||||||
$self->_wsdl_get_portType();
|
$self->_wsdl_get_portType();
|
||||||
|
|
||||||
$method_info_of{ $ident } = {};
|
$method_info_of{ $ident } = {};
|
||||||
@@ -187,9 +187,10 @@ sub _wsdl_init_methods :PRIVATE {
|
|||||||
|
|
||||||
# get SOAP Action
|
# get SOAP Action
|
||||||
# SOAP-Action is a required HTTP Header, so we need to look it up...
|
# SOAP-Action is a required HTTP Header, so we need to look it up...
|
||||||
|
# There must be a soapAction uri - or the WSDL is invalid (and
|
||||||
|
# it's not us to prove that...)
|
||||||
my $soap_binding_operation = $binding_operation->get_operation()->[0];
|
my $soap_binding_operation = $binding_operation->get_operation()->[0];
|
||||||
$method->{ soap_action } = $soap_binding_operation ?
|
$method->{ soap_action } = $soap_binding_operation->get_soapAction();
|
||||||
$soap_binding_operation->get_soapAction() : $method;
|
|
||||||
|
|
||||||
# get parts
|
# get parts
|
||||||
# 1. get operation from port
|
# 1. get operation from port
|
||||||
@@ -204,7 +205,10 @@ sub _wsdl_init_methods :PRIVATE {
|
|||||||
my $message = $wsdl->find_message( $ns, $localname )
|
my $message = $wsdl->find_message( $ns, $localname )
|
||||||
or croak "Message {$ns}$localname not found in WSDL definition";
|
or croak "Message {$ns}$localname not found in WSDL definition";
|
||||||
|
|
||||||
if (my $body=$binding_operation->first_input()->first_body()) {
|
# Is body not required? So there must be one? Do we need the "if"?
|
||||||
|
# if (
|
||||||
|
my $body=$binding_operation->first_input()->first_body();
|
||||||
|
# {
|
||||||
if ($body->get_parts()) {
|
if ($body->get_parts()) {
|
||||||
$method->{ parts } = []; # make sure it's empty
|
$method->{ parts } = []; # make sure it's empty
|
||||||
my $message_part_ref = $message->get_part();
|
my $message_part_ref = $message->get_part();
|
||||||
@@ -216,7 +220,9 @@ sub _wsdl_init_methods :PRIVATE {
|
|||||||
grep { $_->get_name() eq $name } @{ $message_part_ref };
|
grep { $_->get_name() eq $name } @{ $message_part_ref };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
# }
|
||||||
|
# A body does not need to specify the parts of a messages.
|
||||||
|
# Use all of the message's parts if it does not.
|
||||||
$method->{ parts } ||= $message->get_part();
|
$method->{ parts } ||= $message->get_part();
|
||||||
|
|
||||||
# rpc / encoded methods may have a namespace specified.
|
# rpc / encoded methods may have a namespace specified.
|
||||||
@@ -730,9 +736,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 477 $
|
$Rev: 534 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: WSDL.pm 477 2007-12-24 10:23:52Z kutterma $
|
$Id: WSDL.pm 534 2008-02-14 17:07:18Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -8,22 +8,32 @@ our $VERSION = '2.00_25';
|
|||||||
|
|
||||||
sub call {
|
sub call {
|
||||||
my ($self, $method, $body, $header) = @_;
|
my ($self, $method, $body, $header) = @_;
|
||||||
|
|
||||||
|
# Treat non-objects special
|
||||||
if (not blessed $body) {
|
if (not blessed $body) {
|
||||||
|
|
||||||
|
# make sure there's something sensible in our body data
|
||||||
$body = {} if not defined $body;
|
$body = {} if not defined $body;
|
||||||
$body = ref $body eq 'ARRAY' ? $body : [ $body ];
|
$body = ref $body eq 'ARRAY' ? $body : [ $body ];
|
||||||
my $index = 0;
|
|
||||||
my @part_from;
|
my @body_from = @{ $body }; # make a copy
|
||||||
foreach my $part (@{ $body }) {
|
|
||||||
my $class = $method->{ body }->{ parts }->[$index];
|
# build list of parts as objects initialized with
|
||||||
|
# parameters given
|
||||||
|
my @part_from = ();
|
||||||
|
foreach my $class (@{ $method->{ body }->{ parts } }) {
|
||||||
eval "require $class" || die $@;
|
eval "require $class" || die $@;
|
||||||
push @part_from, $class->new($part);
|
push @part_from, $class->new(shift(@body_from) || {});
|
||||||
$index++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# it's either the first part or a list ref with all parts...
|
||||||
$body = $#part_from ? \@part_from : $part_from[0];
|
$body = $#part_from ? \@part_from : $part_from[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
# if we have a header
|
# if we have a header
|
||||||
if (%{ $method->{ header } }) {
|
if (%{ $method->{ header } }) {
|
||||||
|
|
||||||
|
# trat non object special - as above, but only for one
|
||||||
if (not blessed $header) {
|
if (not blessed $header) {
|
||||||
my $class = $method->{ header }->{ parts }->[0];
|
my $class = $method->{ header }->{ parts }->[0];
|
||||||
eval "require $class" || die $@;
|
eval "require $class" || die $@;
|
||||||
@@ -33,39 +43,6 @@ sub call {
|
|||||||
return $self->SUPER::call($method, $body, $header);
|
return $self->SUPER::call($method, $body, $header);
|
||||||
}
|
}
|
||||||
|
|
||||||
#sub __create_methods {
|
|
||||||
# my ($package, %info_of) = @_;
|
|
||||||
#
|
|
||||||
# no strict qw(refs);
|
|
||||||
# no warnings qw(redefine);
|
|
||||||
# for my $method (keys %info_of){
|
|
||||||
# my ($soap_action, @parts);
|
|
||||||
#
|
|
||||||
# # up to 2.00_10 we had list refs...
|
|
||||||
# if (ref $info_of{ $method }eq 'HASH') {
|
|
||||||
# @parts = @{ $info_of{ $method }->{ parts } };
|
|
||||||
# $soap_action = $info_of{ $method }->{ soap_action };
|
|
||||||
# }
|
|
||||||
# else {
|
|
||||||
# die "Pre-v2.00_10 Interfaces are no longer supported. Please re-generate your interface.";
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# *{ "$package\::$method" } = sub {
|
|
||||||
# my $self = shift;
|
|
||||||
# my @param = map {
|
|
||||||
# my $data = shift || {};
|
|
||||||
# eval "require $_";
|
|
||||||
# $_->new( $data );
|
|
||||||
# } @parts;
|
|
||||||
#
|
|
||||||
# return $self->SUPER::call( {
|
|
||||||
# operation => $method,
|
|
||||||
# soap_action => $soap_action,
|
|
||||||
# }, @param );
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
@@ -101,9 +78,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 440 $
|
$Rev: 501 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: Base.pm 440 2007-12-04 22:24:33Z kutterma $
|
$Id: Base.pm 501 2008-01-26 20:23:32Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client/Base.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ sub BUILD {
|
|||||||
sub deserialize {
|
sub deserialize {
|
||||||
my ($self, $content) = @_;
|
my ($self, $content) = @_;
|
||||||
|
|
||||||
$parser_of{ ${ $self } } ||= SOAP::WSDL::Expat::MessageParser->new();
|
$parser_of{ ${ $self } } = SOAP::WSDL::Expat::MessageParser->new()
|
||||||
|
if not $parser_of{ ${ $self } };
|
||||||
$parser_of{ ${ $self } }->class_resolver( $class_resolver_of{ ident $self } );
|
$parser_of{ ${ $self } }->class_resolver( $class_resolver_of{ ident $self } );
|
||||||
eval { $parser_of{ ${ $self } }->parse_string( $content ) };
|
eval { $parser_of{ ${ $self } }->parse_string( $content ) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
@@ -98,9 +99,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 427 $
|
$Rev: 501 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: XSD.pm 427 2007-12-02 22:20:24Z kutterma $
|
$Id: XSD.pm 501 2008-01-26 20:23:32Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Deserializer/XSD.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -1,17 +1,71 @@
|
|||||||
package SOAP::WSDL::Expat::Base;
|
package SOAP::WSDL::Expat::Base;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use URI;
|
||||||
use XML::Parser::Expat;
|
use XML::Parser::Expat;
|
||||||
|
|
||||||
our $VERSION = '2.00_27';
|
# TODO: convert to Class::Std::Fast based class - hash based classes suck.
|
||||||
|
|
||||||
|
our $VERSION = '2.00_32';
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, $args) = @_;
|
my ($class, $arg_ref) = @_;
|
||||||
my $self = {};
|
my $self = {};
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->set_user_agent($arg_ref->{ user_agent })
|
||||||
|
if $arg_ref->{ user_agent };
|
||||||
|
$self->{ parsed } = $arg_ref->{ parsed } if $arg_ref->{ parsed };
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub clone {
|
||||||
|
my $self = shift;
|
||||||
|
my $class = ref $self;
|
||||||
|
my $clone = $class->new($self);
|
||||||
|
return $clone;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub set_uri { $_[0]->{ uri } = $_[1]; }
|
||||||
|
sub get_uri { return $_[0]->{ uri }; }
|
||||||
|
|
||||||
|
sub set_user_agent { $_[0]->{ user_agent } = $_[1]; }
|
||||||
|
sub get_user_agent { return $_[0]->{ user_agent }; }
|
||||||
|
|
||||||
|
sub set_parsed {
|
||||||
|
my ($self, $uri) = @_;
|
||||||
|
$self->{ parsed }->{ $uri } = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub is_parsed {
|
||||||
|
my ($self, $uri) = @_;
|
||||||
|
return exists $self->{ parsed }->{ $uri };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parse_uri {
|
||||||
|
my $self = shift;
|
||||||
|
my $uri = shift;
|
||||||
|
|
||||||
|
if ($self->is_parsed($uri)){
|
||||||
|
warn "$uri already imported. Ignoring it\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$self->set_parsed($uri);
|
||||||
|
|
||||||
|
$self->set_uri( $uri );
|
||||||
|
|
||||||
|
if (not $self->{ user_agent }) {
|
||||||
|
require LWP::UserAgent;
|
||||||
|
$self->{ user_agent } = LWP::UserAgent->new();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $response = $self->{ user_agent }->get($uri);
|
||||||
|
die $response->message() if $response->code() ne '200';
|
||||||
|
return $self->parse( $response->content() );
|
||||||
|
}
|
||||||
|
|
||||||
sub parse {
|
sub parse {
|
||||||
eval {
|
eval {
|
||||||
$_[0]->_initialize( XML::Parser::Expat->new( Namespaces => 1 ) )->parse( $_[1] );
|
$_[0]->_initialize( XML::Parser::Expat->new( Namespaces => 1 ) )->parse( $_[1] );
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ sub _initialize {
|
|||||||
return &{$content_check{ $depth }}
|
return &{$content_check{ $depth }}
|
||||||
if exists $content_check{ $depth };
|
if exists $content_check{ $depth };
|
||||||
|
|
||||||
push @{ $path }, $_[1]; # step down in path
|
push @{ $path }, $_[1]; # step down in path
|
||||||
return if $skip; # skip inside __SKIP__
|
return if $skip; # skip inside __SKIP__
|
||||||
|
|
||||||
# resolve class of this element
|
# resolve class of this element
|
||||||
@@ -171,6 +171,7 @@ sub _initialize {
|
|||||||
$current = bless \$o, $_class;
|
$current = bless \$o, $_class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# set attributes if there are any
|
||||||
$current->attr({ @_[2..$#_] }) if (@_ > 2);
|
$current->attr({ @_[2..$#_] }) if (@_ > 2);
|
||||||
|
|
||||||
$depth++;
|
$depth++;
|
||||||
@@ -294,8 +295,8 @@ the same terms as perl itself
|
|||||||
|
|
||||||
$Id: $
|
$Id: $
|
||||||
|
|
||||||
$LastChangedDate: 2008-01-19 13:57:57 +0100 (Sa, 19 Jan 2008) $
|
$LastChangedDate: 2008-02-02 10:19:45 +0100 (Sa, 02 Feb 2008) $
|
||||||
$LastChangedRevision: 497 $
|
$LastChangedRevision: 516 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
|
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/MessageParser.pm $
|
||||||
|
|||||||
@@ -5,7 +5,59 @@ use Carp;
|
|||||||
use SOAP::WSDL::TypeLookup;
|
use SOAP::WSDL::TypeLookup;
|
||||||
use base qw(SOAP::WSDL::Expat::Base);
|
use base qw(SOAP::WSDL::Expat::Base);
|
||||||
|
|
||||||
our $VERSION = q{2.00_29};
|
our $VERSION = q{2.00_32};
|
||||||
|
|
||||||
|
sub _import_children {
|
||||||
|
my ($self, $name, $imported, $importer, $import_namespace) = @_;
|
||||||
|
return if not $imported;
|
||||||
|
|
||||||
|
my $targetNamespace = $importer->get_targetNamespace();
|
||||||
|
my $push_method = "push_$name";
|
||||||
|
my $get_method = "get_$name";
|
||||||
|
no strict qw(refs);
|
||||||
|
my $value_ref = $imported->$get_method();
|
||||||
|
if ($value_ref) {
|
||||||
|
$value_ref = [ $value_ref ] if (not ref $value_ref eq 'ARRAY');
|
||||||
|
# set xmlns - can be different from parent
|
||||||
|
for (@{ $value_ref }) {
|
||||||
|
# fixup targetNamespace, but don't override
|
||||||
|
$_->set_targetNamespace( $import_namespace )
|
||||||
|
if ( ($import_namespace ne $targetNamespace) && ! $_->get_targetNamespace);
|
||||||
|
# update parent...
|
||||||
|
$_->set_parent( $importer );
|
||||||
|
}
|
||||||
|
# push elements into importing WSDL
|
||||||
|
$importer->$push_method(@{ $value_ref });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub xml_schema_import {
|
||||||
|
my $self = shift;
|
||||||
|
my $schema = shift;
|
||||||
|
my $parser = $self->clone();
|
||||||
|
my %attr_of = @_;
|
||||||
|
my $import_namespace = $attr_of{ namespace };
|
||||||
|
my $uri = URI->new_abs($attr_of{schemaLocation}, $self->get_uri() );
|
||||||
|
my $import = $parser->parse_uri($uri);
|
||||||
|
|
||||||
|
for my $name ( qw(type element group) ) {
|
||||||
|
$self->_import_children( $name, $import, $schema, $import_namespace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub wsdl_import {
|
||||||
|
my $self = shift;
|
||||||
|
my $definitions = shift;
|
||||||
|
my $parser = $self->clone();
|
||||||
|
my %attr_of = @_;
|
||||||
|
my $import_namespace = $attr_of{ namespace };
|
||||||
|
my $uri = URI->new_abs($attr_of{location}, $self->get_uri() );
|
||||||
|
|
||||||
|
my $import = $parser->parse_uri($uri);
|
||||||
|
for my $name ( qw(types message binding portType service) ) {
|
||||||
|
$self->_import_children( $name, $import, $definitions, $import_namespace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub _initialize {
|
sub _initialize {
|
||||||
my ($self, $parser) = @_;
|
my ($self, $parser) = @_;
|
||||||
@@ -81,6 +133,20 @@ sub _initialize {
|
|||||||
: _fixup_attrs($parser, %attrs)
|
: _fixup_attrs($parser, %attrs)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
elsif ($action->{type} eq 'HANDLER') {
|
||||||
|
my $method = $self->can($action->{method});
|
||||||
|
$method->($self, $current, %attrs);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# TODO replace by hash lookup of known namespaces.
|
||||||
|
my $namespace = $parser->namespace($localname) || q{};
|
||||||
|
my $part = $namespace eq 'http://schemas.xmlsoap.org/wsdl/'
|
||||||
|
? 'WSDL 1.1'
|
||||||
|
: 'XML Schema';
|
||||||
|
|
||||||
|
warn "$part element <$localname> is not implemented yet"
|
||||||
|
if ($localname !~m{ \A (:? annotation | documentation ) \z }xms );
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
@@ -179,8 +245,8 @@ the same terms as perl itself
|
|||||||
|
|
||||||
$Id: $
|
$Id: $
|
||||||
|
|
||||||
$LastChangedDate: 2007-12-24 11:23:52 +0100 (Mo, 24 Dez 2007) $
|
$LastChangedDate: 2008-02-14 18:07:18 +0100 (Do, 14 Feb 2008) $
|
||||||
$LastChangedRevision: 477 $
|
$LastChangedRevision: 534 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
|
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ sub register {
|
|||||||
|
|
||||||
sub get_deserializer {
|
sub get_deserializer {
|
||||||
my ($self, $args_of_ref) = @_;
|
my ($self, $args_of_ref) = @_;
|
||||||
|
$args_of_ref->{ soap_version } ||= '1.1';
|
||||||
# sanity check
|
# sanity check
|
||||||
die "no deserializer registered for SOAP version $args_of_ref->{ soap_version }"
|
die "no deserializer registered for SOAP version $args_of_ref->{ soap_version }"
|
||||||
if not exists ($DESERIALIZER{ $args_of_ref->{ soap_version } });
|
if not exists ($DESERIALIZER{ $args_of_ref->{ soap_version } });
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ sub register {
|
|||||||
|
|
||||||
sub get_serializer {
|
sub get_serializer {
|
||||||
my ($self, $args_of_ref) = @_;
|
my ($self, $args_of_ref) = @_;
|
||||||
|
$args_of_ref->{ soap_version } ||= '1.1';
|
||||||
# sanity check
|
# sanity check
|
||||||
die "no serializer registered for SOAP version $args_of_ref->{ soap_version }"
|
die "no serializer registered for SOAP version $args_of_ref->{ soap_version }"
|
||||||
if not exists ($SERIALIZER{ $args_of_ref->{ soap_version } });
|
if not exists ($SERIALIZER{ $args_of_ref->{ soap_version } });
|
||||||
@@ -138,9 +138,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 391 $
|
$Rev: 510 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: Serializer.pm 391 2007-11-17 21:56:13Z kutterma $
|
$Id: Serializer.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package SOAP::WSDL::Factory::Transport;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
our $VERSION='2.00_25';
|
our $VERSION='2.00_31';
|
||||||
|
|
||||||
# class data
|
# class data
|
||||||
my %registered_transport_of = ();
|
my %registered_transport_of = ();
|
||||||
@@ -34,7 +34,7 @@ sub register {
|
|||||||
sub get_transport {
|
sub get_transport {
|
||||||
my ($class, $scheme, %attrs) = @_;
|
my ($class, $scheme, %attrs) = @_;
|
||||||
|
|
||||||
$scheme =~s{ \A ([^\:]+) \: .+ }{$1}smx;
|
$scheme =~s{ \A ([^\:]+) \: .+ }{$1}x;
|
||||||
|
|
||||||
if ($registered_transport_of{ $scheme }) {
|
if ($registered_transport_of{ $scheme }) {
|
||||||
no strict qw(refs);
|
no strict qw(refs);
|
||||||
@@ -240,9 +240,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 459 $
|
$Rev: 524 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: Transport.pm 459 2007-12-16 16:00:14Z kutterma $
|
$Id: Transport.pm 524 2008-02-10 23:24:43Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -25,17 +25,33 @@ sub _process :PROTECTED {
|
|||||||
my ($self, $template, $arg_ref, $output) = @_;
|
my ($self, $template, $arg_ref, $output) = @_;
|
||||||
my $ident = ident $self;
|
my $ident = ident $self;
|
||||||
|
|
||||||
$tt_of{$ident} = Template->new(
|
# always create a new Template object to
|
||||||
|
# force re-loading of plugins.
|
||||||
|
my $tt = Template->new(
|
||||||
DEBUG => 1,
|
DEBUG => 1,
|
||||||
EVAL_PERL => $EVAL_PERL_of{ $ident },
|
EVAL_PERL => $EVAL_PERL_of{ $ident },
|
||||||
RECURSION => $RECURSION_of{ $ident },
|
RECURSION => $RECURSION_of{ $ident },
|
||||||
INCLUDE_PATH => $INCLUDE_PATH_of{ $ident },
|
INCLUDE_PATH => $INCLUDE_PATH_of{ $ident },
|
||||||
OUTPUT_PATH => $OUTPUT_PATH_of{ $ident },
|
OUTPUT_PATH => $OUTPUT_PATH_of{ $ident },
|
||||||
)
|
PLUGIN_BASE => 'SOAP::WSDL::Generator::Template::Plugin',
|
||||||
if (not $tt_of{ $ident });
|
);
|
||||||
|
|
||||||
$tt_of{ $ident }->process( $template,
|
$tt->process( $template,
|
||||||
{
|
{
|
||||||
|
context => {
|
||||||
|
namespace_prefix_map => {
|
||||||
|
'http://www.w3.org/2001/XMLSchema' => 'SOAP::WSDL::XSD::Typelib::Builtin',
|
||||||
|
},
|
||||||
|
namespace_map => {
|
||||||
|
},
|
||||||
|
prefix => {
|
||||||
|
interface => $self->get_interface_prefix,
|
||||||
|
element => $self->get_element_prefix,
|
||||||
|
server => $self->get_server_prefix,
|
||||||
|
type => $self->get_type_prefix,
|
||||||
|
typemap => $self->get_typemap_prefix,
|
||||||
|
}
|
||||||
|
},
|
||||||
definitions => $self->get_definitions,
|
definitions => $self->get_definitions,
|
||||||
interface_prefix => $self->get_interface_prefix,
|
interface_prefix => $self->get_interface_prefix,
|
||||||
server_prefix => $self->get_server_prefix,
|
server_prefix => $self->get_server_prefix,
|
||||||
@@ -47,7 +63,7 @@ sub _process :PROTECTED {
|
|||||||
%{ $arg_ref }
|
%{ $arg_ref }
|
||||||
},
|
},
|
||||||
$output)
|
$output)
|
||||||
or die $INCLUDE_PATH_of{ $ident }, '\\', $template, ' ', $tt_of{ $ident }->error();
|
or die $INCLUDE_PATH_of{ $ident }, '\\', $template, ' ', $tt->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package SOAP::WSDL::Generator::Template::Plugin::XSD;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Class::Std::Fast::Storable constructor => 'none';
|
||||||
|
|
||||||
|
my %namespace_prefix_map_of :ATTR(:name<namespace_prefix_map> :default<{}>);
|
||||||
|
my %namespace_map_of :ATTR(:name<namespace_map> :default<{}>);
|
||||||
|
my %prefix_of :ATTR(:name<prefix> :default<()>);
|
||||||
|
|
||||||
|
# create a singleton
|
||||||
|
sub load { # called as MyPlugin->load($context)
|
||||||
|
my ($class, $context, @arg_from) = @_;
|
||||||
|
my $stash = $context->stash();
|
||||||
|
my $self = bless \do { my $o = Class::Std::Fast::ID() }, $class;
|
||||||
|
use Data::Dumper;
|
||||||
|
# die Data::Dumper::Dumper $stash->{ context };
|
||||||
|
$self->set_namespace_map( $stash->{ context }->{ namespace_map });
|
||||||
|
$self->set_namespace_prefix_map( $stash->{ context }->{ namespace_prefix_map });
|
||||||
|
$self->set_prefix( $stash->{ context }->{ prefix });
|
||||||
|
return $self; # returns 'MyPlugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
return shift;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub _get_prefix {
|
||||||
|
my ($self, $type, $namespace) = @_;
|
||||||
|
return $namespace_prefix_map_of{ $$self }->{ $namespace }
|
||||||
|
|| ( ($namespace_map_of{ $$self }->{ $namespace })
|
||||||
|
? join ('::', $prefix_of{ $$self }->{ $type }, $namespace_map_of{ $$self }->{ $namespace })
|
||||||
|
: $prefix_of{ $$self }->{ $type }
|
||||||
|
)
|
||||||
|
|| $prefix_of{ $$self }->{ $type };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_element_prefix {
|
||||||
|
shift->_get_prefix( 'element', shift );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_interface_prefix {
|
||||||
|
shift->_get_prefix( 'interface', shift );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_server_prefix {
|
||||||
|
shift->_get_prefix( 'server', shift );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_type_prefix {
|
||||||
|
# die "WIX";
|
||||||
|
shift->_get_prefix( 'type', shift );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_typemap_prefix {
|
||||||
|
shift->_get_prefix( 'typemap', shift );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub error {}
|
||||||
|
1;
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
[% USE XSD -%]
|
||||||
[% interface_name = interface_prefix _ '::'
|
[% interface_name = interface_prefix _ '::'
|
||||||
_ service.get_name.replace('\.', '::') _ '::'
|
_ service.get_name.replace('\.', '::') _ '::'
|
||||||
_ port.get_name.replace('^.+\.','');
|
_ port.get_name.replace('^.+\.','');
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
[% USE XSD(context) -%]
|
||||||
package [% type_prefix %]::[% complexType.get_name.replace('\.','::').replace('-','_') %];
|
package [% type_prefix %]::[% complexType.get_name.replace('\.','::').replace('-','_') %];
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@@ -6,8 +7,6 @@ use warnings;
|
|||||||
# Don't include any perl source here - there may be sub-packages...
|
# Don't include any perl source here - there may be sub-packages...
|
||||||
#-%]
|
#-%]
|
||||||
|
|
||||||
package [% type_prefix %]::[% complexType.get_name.replace('\.','::').replace('-','_') %]::_ATTR;
|
|
||||||
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
|
||||||
[% INCLUDE complexType/attributeSet.tt %]
|
[% INCLUDE complexType/attributeSet.tt %]
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[% indent %]{
|
[% indent %]{
|
||||||
[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %]
|
[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %]
|
||||||
[%- indent = indent _ ' ';
|
[%- indent = indent _ ' ';
|
||||||
FOREACH element = complexType.get_element %]
|
FOREACH element = complexType.get_element %]
|
||||||
[% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%]
|
[% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[% indent %]{
|
[% indent %]{
|
||||||
[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %]
|
[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %]
|
||||||
[%- indent = indent _ ' ' %]
|
[%- indent = indent _ ' ' %]
|
||||||
[% indent %]# One of the following elements.
|
[% indent %]# One of the following elements.
|
||||||
[% indent %]# No occurance checks yet, so be sure to pass just one...
|
[% indent %]# No occurance checks yet, so be sure to pass just one...
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
[% IF (complexType.get_variety == 'restriction');
|
[% IF (complexType.get_variety == 'restriction');
|
||||||
INCLUDE complexType/POD/restriction.tt(complexType = complexType);
|
INCLUDE complexType/POD/restriction.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_variety == 'sequence');
|
ELSIF (complexType.get_variety == 'extension');
|
||||||
THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet";
|
#THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet";
|
||||||
|
%]
|
||||||
|
# No documentation generated for complexContent / extension yet
|
||||||
|
[%
|
||||||
ELSE;
|
ELSE;
|
||||||
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
||||||
END;
|
END;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[% indent %]{
|
[% indent %]{
|
||||||
[%- IF complexType.get_name %] # [% type_prefix %]::[% complexType.get_name %][% END %]
|
[%- IF complexType.get_name %] # [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %][% END %]
|
||||||
[%- indent = indent _ ' ';
|
[%- indent = indent _ ' ';
|
||||||
FOREACH element = complexType.get_element %]
|
FOREACH element = complexType.get_element %]
|
||||||
[% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%]
|
[% indent %][% element.get_name %] => [% INCLUDE element/POD/structure.tt -%]
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[% IF (complexType.get_variety == 'restriction');
|
||||||
|
INCLUDE complexType/POD/restriction.tt(complexType = complexType);
|
||||||
|
ELSIF (complexType.get_variety == 'extension');
|
||||||
|
#THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType complexContent extension not implemented yet";
|
||||||
|
%]
|
||||||
|
# No documentation generated for complexContent / extension yet
|
||||||
|
[%
|
||||||
|
ELSE;
|
||||||
|
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
||||||
|
END;
|
||||||
|
|
||||||
|
%]
|
||||||
@@ -7,7 +7,7 @@ ELSIF (complexType.get_variety == 'group');
|
|||||||
ELSIF (complexType.get_variety == 'choice');
|
ELSIF (complexType.get_variety == 'choice');
|
||||||
INCLUDE complexType/POD/choice.tt(complexType = complexType);
|
INCLUDE complexType/POD/choice.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_contentModel == 'simpleContent');
|
ELSIF (complexType.get_contentModel == 'simpleContent');
|
||||||
THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType simpleContent not implemented yet";
|
INCLUDE complexType/POD/simpleContent.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_contentModel == 'complexContent');
|
ELSIF (complexType.get_contentModel == 'complexContent');
|
||||||
INCLUDE complexType/POD/complexContent.tt(complexType = complexType);
|
INCLUDE complexType/POD/complexContent.tt(complexType = complexType);
|
||||||
END %],
|
END %],
|
||||||
@@ -24,13 +24,9 @@ __PACKAGE__->_factory(
|
|||||||
{
|
{
|
||||||
[% FOREACH element = complexType.get_element;
|
[% FOREACH element = complexType.get_element;
|
||||||
IF (type = element.get_type);
|
IF (type = element.get_type);
|
||||||
element_type = complexType.expand( type );
|
element_type = complexType.expand( type ); -%]
|
||||||
IF (element_type.0 == 'http://www.w3.org/2001/XMLSchema'); -%]
|
[% element.get_name %] => '[% XSD.get_type_prefix(element_type.0) %]::[% element_type.1 %]',
|
||||||
[% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% element_type.1 %]',
|
[% ELSE;
|
||||||
[% ELSE -%]
|
|
||||||
[% element.get_name %] => '[% type_prefix %]::[% element_type.1 %]',
|
|
||||||
[% END;
|
|
||||||
ELSE;
|
|
||||||
IF (element.first_simpleType);
|
IF (element.first_simpleType);
|
||||||
atomic_types.${ element.get_name } = element.first_simpleType;
|
atomic_types.${ element.get_name } = element.first_simpleType;
|
||||||
ELSIF (element.first_complexType);
|
ELSIF (element.first_complexType);
|
||||||
@@ -38,7 +34,7 @@ __PACKAGE__->_factory(
|
|||||||
ELSE;
|
ELSE;
|
||||||
THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it";
|
THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it";
|
||||||
END; %]
|
END; %]
|
||||||
[% element.get_name %] => '[% type_prefix %]::[% complexType.get_name %]::_[% element.get_name %]',
|
[% element.get_name %] => '[% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% element.get_name %]',
|
||||||
[% END;
|
[% END;
|
||||||
END -%]
|
END -%]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
[% FOREACH type IN atomic_types; %]
|
[% FOREACH type IN atomic_types; %]
|
||||||
|
|
||||||
package [% type_prefix %]::[% complexType.get_name %]::_[% type.key %];
|
package [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% type.key %];
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
[% IF (complexType.get_attribute.size) %]
|
||||||
|
package [% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name.replace('\.','::').replace('-','_') %]::_ATTR;
|
||||||
|
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
||||||
|
|
||||||
{ # BLOCK to scope variables
|
{ # BLOCK to scope variables
|
||||||
[%
|
[%
|
||||||
|
|
||||||
@@ -19,11 +23,9 @@ __PACKAGE__->_factory(
|
|||||||
[% FOREACH element = complexType.get_attribute;
|
[% FOREACH element = complexType.get_attribute;
|
||||||
IF (type = element.get_type);
|
IF (type = element.get_type);
|
||||||
element_type = complexType.expand( type );
|
element_type = complexType.expand( type );
|
||||||
IF (element_type.0 == 'http://www.w3.org/2001/XMLSchema'); -%]
|
-%]
|
||||||
[% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% element_type.1 %]',
|
[% element.get_name %] => '[% XSD.get_type_prefix(element_type.0) %]::[% element_type.1 %]',
|
||||||
[% ELSE -%]
|
[%
|
||||||
[% element.get_name %] => '[% type_prefix %]::[% element_type.1 %]',
|
|
||||||
[% END;
|
|
||||||
ELSE;
|
ELSE;
|
||||||
IF (element.first_simpleType);
|
IF (element.first_simpleType);
|
||||||
THROW NOT_IMPLEMENTED , "Attributes with atomic simpleType definition are not implemented yet";
|
THROW NOT_IMPLEMENTED , "Attributes with atomic simpleType definition are not implemented yet";
|
||||||
@@ -31,10 +33,12 @@ __PACKAGE__->_factory(
|
|||||||
ELSE;
|
ELSE;
|
||||||
THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it";
|
THROW NOT_IMPLEMENTED , "Neither simple nor complex atomic type - don't know what to do with it";
|
||||||
END; %]
|
END; %]
|
||||||
[% element.get_name %] => '[% type_prefix %]::[% complexType.get_name %]::_[% element.get_name %]',
|
[% element.get_name %] => '[% XSD.get_type_prefix(complexType.get_targetNamespace) %]::[% complexType.get_name %]::_[% element.get_name %]',
|
||||||
[% END;
|
[% END;
|
||||||
END -%]
|
END -%]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
} # end BLOCK
|
} # end BLOCK
|
||||||
|
|
||||||
|
[% END %]
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
INCLUDE complexType/restriction.tt(complexType = complexType);
|
INCLUDE complexType/restriction.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_variety == 'sequence');
|
ELSIF (complexType.get_variety == 'sequence');
|
||||||
INCLUDE complexType/extension.tt(complexType = complexType);
|
INCLUDE complexType/extension.tt(complexType = complexType);
|
||||||
|
ELSIF (complexType.get_variety == 'all');
|
||||||
|
INCLUDE complexType/extension.tt(complexType = complexType);
|
||||||
ELSE;
|
ELSE;
|
||||||
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
||||||
END;
|
END;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[% IF (complexType.get_contentModel == 'simpleContent');
|
[% IF (complexType.get_contentModel == 'simpleContent');
|
||||||
THROW NOT_IMPLEMENTED, "${ element.get_name } - complexType simpleContent not implemented yet";
|
INCLUDE complexType/simpleContent.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_contentModel == 'complexContent');
|
ELSIF (complexType.get_contentModel == 'complexContent');
|
||||||
INCLUDE complexType/complexContent.tt(complexType = complexType);
|
INCLUDE complexType/complexContent.tt(complexType = complexType);
|
||||||
ELSE;
|
ELSE;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ END;
|
|||||||
complexType.set_element( element_list );
|
complexType.set_element( element_list );
|
||||||
|
|
||||||
-%]
|
-%]
|
||||||
use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]);
|
use base qw([% XSD.get_type_prefix(base_name.0) %]::[% base_name.1.replace('\.', '::') %]);
|
||||||
[%
|
[%
|
||||||
|
|
||||||
INCLUDE complexType/variety.tt(complexType = complexType);
|
INCLUDE complexType/variety.tt(complexType = complexType);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[% IF (base=complexType.get_base);
|
[% IF (base=complexType.get_base);
|
||||||
base_name=complexType.expand(base);
|
base_name=complexType.expand(base);
|
||||||
-%]
|
-%]
|
||||||
use base qw([% type_prefix %]::[% base_name.1.replace('\.', '::') %]);
|
use base qw([% XSD.get_type_prefix(base_name.0) %]::[% base_name.1.replace('\.', '::') %]);
|
||||||
[%
|
[%
|
||||||
ELSE;
|
ELSE;
|
||||||
THROW NOT_IMPLEMENTED, "restriction without base not supported";
|
THROW NOT_IMPLEMENTED, "restriction without base not supported";
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[% IF (complexType.get_variety == 'restriction');
|
||||||
|
INCLUDE complexType/restriction.tt(complexType = complexType);
|
||||||
|
ELSIF (complexType.get_variety == 'extension');
|
||||||
|
THROW NOT_IMPLEMENTED, "${ complexType.get_name } - complexType simpleContent extension not implemented yet";
|
||||||
|
ELSE;
|
||||||
|
THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
|
||||||
|
END;
|
||||||
|
%]
|
||||||
@@ -9,7 +9,12 @@ ELSIF (complexType.get_variety == 'choice');
|
|||||||
INCLUDE complexType/all.tt(complexType = complexType);
|
INCLUDE complexType/all.tt(complexType = complexType);
|
||||||
ELSIF (complexType.get_variety);
|
ELSIF (complexType.get_variety);
|
||||||
THROW NOT_IMPLEMENTED, "Unknown variety ${ complexType.get_variety } in ${ complexType.get_name } (${ element.get_name })";
|
THROW NOT_IMPLEMENTED, "Unknown variety ${ complexType.get_variety } in ${ complexType.get_name } (${ element.get_name })";
|
||||||
ELSE;
|
ELSE %]
|
||||||
# There's no variety - might be empty complexType
|
|
||||||
END;
|
# There's no variety - empty complexType
|
||||||
%]
|
use Class::Std::Fast::Storable constructor => 'none';
|
||||||
|
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||||
|
|
||||||
|
__PACKAGE__->_factory();
|
||||||
|
|
||||||
|
[% END %]
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
package [% element_prefix %]::[% element.get_name.replace('\.','::') %];
|
[% USE XSD(context) %]
|
||||||
|
package [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name.replace('\.','::') %];
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ use base qw(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package [% element_prefix %]::[% element.get_name.replace('\.','::').replace('-','_') %]::_ATTR;
|
package [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name.replace('\.','::').replace('-','_') %]::_ATTR;
|
||||||
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
||||||
[% INCLUDE complexType/attributeSet.tt %]
|
[% INCLUDE complexType/attributeSet.tt %]
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ use base qw(SOAP::WSDL::XSD::Typelib::AttributeSet);
|
|||||||
|
|
||||||
[% head1 %] NAME
|
[% head1 %] NAME
|
||||||
|
|
||||||
[% element_prefix %]::[% element.get_name %]
|
[% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name %]
|
||||||
|
|
||||||
[% head1 %] DESCRIPTION
|
[% head1 %] DESCRIPTION
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ Perl data type class for the XML Schema defined element
|
|||||||
|
|
||||||
[% head2 %] new
|
[% head2 %] new
|
||||||
|
|
||||||
my $element = [% element_prefix %]::[% element.get_name %]->new($data);
|
my $element = [% XSD.get_element_prefix(element.get_targetNamespace) %]::[% element.get_name %]->new($data);
|
||||||
|
|
||||||
Constructor. The following data structure may be passed to new():
|
Constructor. The following data structure may be passed to new():
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package [% type_prefix %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %];
|
[% USE XSD(context) -%]
|
||||||
|
package [% XSD.get_type_prefix(simpleType.get_targetNamespace) %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %];
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ __END__
|
|||||||
|
|
||||||
[% pod %]
|
[% pod %]
|
||||||
|
|
||||||
[% head1 %] [% type_prefix %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %]
|
[% head1 %] [% XSD.get_type_prefix(simpleType.get_targetNamespace) %]::[% simpleType.get_name.replace('\.','::').replace('-','_') %]
|
||||||
|
|
||||||
[% head1 %] DESCRIPTION
|
[% head1 %] DESCRIPTION
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ considered as bugs.
|
|||||||
=item * RULES NOT APPLICABLE
|
=item * RULES NOT APPLICABLE
|
||||||
|
|
||||||
WS-I Basic Profile contains rules for web services as a whole. SOAP::WSDL only
|
WS-I Basic Profile contains rules for web services as a whole. SOAP::WSDL only
|
||||||
plays the part of one layer in a Web Service CONSUMER, thus does not implement
|
plays the part of one layer in a Web Service CONSUMER / RECEIVER, thus does
|
||||||
some parts the WS-I Basic Profile references.
|
not implement some parts the WS-I Basic Profile references.
|
||||||
|
|
||||||
This section contains rules not applicable for SOAP::WSDL, because they refer
|
This section contains rules not applicable for SOAP::WSDL, because they refer
|
||||||
parts to web service SOAP::WSDL does not implement.
|
to parts SOAP::WSDL does not implement.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
@@ -427,9 +427,10 @@ TODO support rpc-literal bindings.
|
|||||||
In a DESCRIPTION the value of the location attribute of a wsdl:import element
|
In a DESCRIPTION the value of the location attribute of a wsdl:import element
|
||||||
SHOULD be treated as a hint.
|
SHOULD be treated as a hint.
|
||||||
|
|
||||||
SOAP::WSDL's schema parser does not handle import elements yet.
|
The wsdl:import element imports the referenced WSDL definition.
|
||||||
|
|
||||||
TODO implement support for wsdl:import in SOAP::WSDL::Expat::WSDLParser.
|
This is rather hard-wired and does not allow to specify a wsdl:import without
|
||||||
|
a resolvable location.
|
||||||
|
|
||||||
=head2 R4002
|
=head2 R4002
|
||||||
|
|
||||||
@@ -448,9 +449,7 @@ TODO Test whether UTF-16 works.
|
|||||||
The wsdl:documentation element MAY occur as a child of the wsdl:import
|
The wsdl:documentation element MAY occur as a child of the wsdl:import
|
||||||
element in a DESCRIPTION.
|
element in a DESCRIPTION.
|
||||||
|
|
||||||
SOAP::WSDL's schema parser does not handle import elements yet.
|
Not tested yet.
|
||||||
|
|
||||||
TODO implement support for wsdl:import in SOAP::WSDL::Expat::WSDLParser.
|
|
||||||
|
|
||||||
=head2 R2024
|
=head2 R2024
|
||||||
|
|
||||||
@@ -681,7 +680,11 @@ is Schema valid.
|
|||||||
A DESCRIPTION MUST only use the WSDL "import" statement to import another
|
A DESCRIPTION MUST only use the WSDL "import" statement to import another
|
||||||
WSDL description.
|
WSDL description.
|
||||||
|
|
||||||
SOAP::WSDL has no means of generating WSDL definitions
|
SOAP::WSDL (partially) supports the wsdl:import statement. The wsdl:include
|
||||||
|
statement is not supported (yet).
|
||||||
|
|
||||||
|
It's the responsibility of the WSDL author to use only the wsdl:import
|
||||||
|
statement for importing WSDL descriptions.
|
||||||
|
|
||||||
=head2 R2002
|
=head2 R2002
|
||||||
|
|
||||||
@@ -1249,9 +1252,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 478 $
|
$Rev: 514 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: WS_I.pod 478 2007-12-27 14:15:01Z kutterma $
|
$Id: WS_I.pod 514 2008-01-31 19:57:52Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Manual/WS_I.pod $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use warnings;
|
|||||||
use Class::Std::Fast::Storable;
|
use Class::Std::Fast::Storable;
|
||||||
use Scalar::Util qw(blessed);
|
use Scalar::Util qw(blessed);
|
||||||
our $VERSION=q{2.00_27};
|
our $VERSION=q{2.00_27};
|
||||||
|
use SOAP::WSDL::Factory::Serializer;
|
||||||
|
|
||||||
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
|
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
|
||||||
my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance';
|
my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance';
|
||||||
@@ -119,9 +120,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 477 $
|
$Rev: 510 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: XSD.pm 477 2007-12-24 10:23:52Z kutterma $
|
$Id: XSD.pm 510 2008-01-29 08:03:46Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Serializer/XSD.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -2,11 +2,15 @@ package SOAP::WSDL::TypeLookup;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
our $VERSION=q{2.00_29};
|
our $VERSION=q{2.00_31};
|
||||||
|
|
||||||
my %TYPES = (
|
my %TYPES = (
|
||||||
# wsdl:
|
# wsdl:
|
||||||
'http://schemas.xmlsoap.org/wsdl/' => {
|
'http://schemas.xmlsoap.org/wsdl/' => {
|
||||||
|
'import' => {
|
||||||
|
type => 'HANDLER',
|
||||||
|
method => 'wsdl_import',
|
||||||
|
},
|
||||||
binding => {
|
binding => {
|
||||||
type => 'CLASS',
|
type => 'CLASS',
|
||||||
class => 'SOAP::WSDL::Binding',
|
class => 'SOAP::WSDL::Binding',
|
||||||
@@ -83,6 +87,10 @@ my %TYPES = (
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'http://www.w3.org/2001/XMLSchema' => {
|
'http://www.w3.org/2001/XMLSchema' => {
|
||||||
|
'import' => {
|
||||||
|
type => 'HANDLER',
|
||||||
|
method => 'xml_schema_import',
|
||||||
|
},
|
||||||
schema => {
|
schema => {
|
||||||
type => 'CLASS',
|
type => 'CLASS',
|
||||||
class => 'SOAP::WSDL::XSD::Schema',
|
class => 'SOAP::WSDL::XSD::Schema',
|
||||||
@@ -159,22 +167,22 @@ my %TYPES = (
|
|||||||
},
|
},
|
||||||
group => {
|
group => {
|
||||||
type => 'METHOD',
|
type => 'METHOD',
|
||||||
method => 'set_flavor',
|
method => 'set_variety',
|
||||||
value => 'group',
|
value => 'group',
|
||||||
},
|
},
|
||||||
all => {
|
all => {
|
||||||
type => 'METHOD',
|
type => 'METHOD',
|
||||||
method => 'set_flavor',
|
method => 'set_variety',
|
||||||
value => 'all',
|
value => 'all',
|
||||||
},
|
},
|
||||||
choice => {
|
choice => {
|
||||||
type => 'METHOD',
|
type => 'METHOD',
|
||||||
method => 'set_flavor',
|
method => 'set_variety',
|
||||||
value => 'choice',
|
value => 'choice',
|
||||||
},
|
},
|
||||||
sequence => {
|
sequence => {
|
||||||
type => 'METHOD',
|
type => 'METHOD',
|
||||||
method => 'set_flavor',
|
method => 'set_variety',
|
||||||
value => 'sequence',
|
value => 'sequence',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ sub serialize {
|
|||||||
my $prefix = $prefix_of{ $ns }
|
my $prefix = $prefix_of{ $ns }
|
||||||
|| die 'No prefix found for namespace '. $ns;
|
|| die 'No prefix found for namespace '. $ns;
|
||||||
$xml .= ' type="' . $prefix . ':'
|
$xml .= ' type="' . $prefix . ':'
|
||||||
. $self->get_name() . '"' if ($self->get_name() );
|
. $self->get_name() . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $value) {
|
if (defined $value) {
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ use Class::Std::Fast::Storable;
|
|||||||
use Scalar::Util qw(blessed);
|
use Scalar::Util qw(blessed);
|
||||||
use base qw/SOAP::WSDL::Base/;
|
use base qw/SOAP::WSDL::Base/;
|
||||||
|
|
||||||
our $VERSION=q{2.00_25};
|
our $VERSION=q{2.00_29};
|
||||||
|
|
||||||
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
||||||
my %attribute_of :ATTR(:name<attribute> :default<()>);
|
my %attribute_of :ATTR(:name<attribute> :default<()>);
|
||||||
my %element_of :ATTR(:name<element> :default<()>);
|
my %element_of :ATTR(:name<element> :default<()>);
|
||||||
my %flavor_of :ATTR(:name<flavor> :default<()>);
|
#my %flavor_of :ATTR(:name<flavor> :default<()>);
|
||||||
|
my %variety_of :ATTR(:name<variety> :default<()>);
|
||||||
my %base_of :ATTR(:name<base> :default<()>);
|
my %base_of :ATTR(:name<base> :default<()>);
|
||||||
my %itemType_of :ATTR(:name<itemType> :default<()>);
|
my %itemType_of :ATTR(:name<itemType> :default<()>);
|
||||||
my %enumeration_of :ATTR(:name<enumeration> :default<()>);
|
my %enumeration_of :ATTR(:name<enumeration> :default<()>);
|
||||||
@@ -21,17 +22,17 @@ my %mixed_of :ATTR(:name<mixed> :default<()>); # default is fal
|
|||||||
# is set to simpleContent/complexContent
|
# is set to simpleContent/complexContent
|
||||||
my %content_model_of :ATTR(:name<contentModel> :default<NONE>);
|
my %content_model_of :ATTR(:name<contentModel> :default<NONE>);
|
||||||
|
|
||||||
sub get_variety; *get_variety = \&get_flavor;
|
sub get_flavor; *get_flavor = \&get_variety;
|
||||||
|
|
||||||
sub push_element {
|
sub push_element {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $element = shift;
|
my $element = shift;
|
||||||
if ($flavor_of{ ident $self } eq 'all')
|
if ($variety_of{ ident $self } eq 'all')
|
||||||
{
|
{
|
||||||
$element->set_minOccurs(0) if not defined ($element->get_minOccurs);
|
$element->set_minOccurs(0) if not defined ($element->get_minOccurs);
|
||||||
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
||||||
}
|
}
|
||||||
elsif ($flavor_of{ ident $self } eq 'sequence')
|
elsif ($variety_of{ ident $self } eq 'sequence')
|
||||||
{
|
{
|
||||||
$element->set_minOccurs(1) if not defined ($element->get_minOccurs);
|
$element->set_minOccurs(1) if not defined ($element->get_minOccurs);
|
||||||
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
||||||
@@ -42,14 +43,14 @@ sub push_element {
|
|||||||
sub set_restriction {
|
sub set_restriction {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $element = shift;
|
my $element = shift;
|
||||||
$flavor_of{ ident $self } = 'restriction';
|
$variety_of{ ident $self } = 'restriction';
|
||||||
$base_of{ ident $self } = $element->{ Value };
|
$base_of{ ident $self } = $element->{ Value };
|
||||||
}
|
}
|
||||||
|
|
||||||
sub set_extension {
|
sub set_extension {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $element = shift;
|
my $element = shift;
|
||||||
$flavor_of{ ident $self } = 'extension';
|
$variety_of{ ident $self } = 'extension';
|
||||||
$base_of{ ident $self } = $element->{ Value };
|
$base_of{ ident $self } = $element->{ Value };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ sub serialize {
|
|||||||
|
|
||||||
$opt->{ indent } ||= q{};
|
$opt->{ indent } ||= q{};
|
||||||
$opt->{ attributes } ||= [];
|
$opt->{ attributes } ||= [];
|
||||||
my $flavor = $self->get_flavor();
|
my $variety = $self->get_variety();
|
||||||
my $xml = ($opt->{ readable }) ? $opt->{ indent } : q{}; # add indentation
|
my $xml = ($opt->{ readable }) ? $opt->{ indent } : q{}; # add indentation
|
||||||
|
|
||||||
|
|
||||||
@@ -78,17 +79,17 @@ sub serialize {
|
|||||||
delete $opt->{ attributes }; # don't propagate...
|
delete $opt->{ attributes }; # don't propagate...
|
||||||
|
|
||||||
if ( $opt->{ autotype }) {
|
if ( $opt->{ autotype }) {
|
||||||
my $ns = $self->get_targetNamespace();
|
my $ns = $self->get_targetNamespace();
|
||||||
# reverse namespace by prefix hash
|
# reverse namespace by prefix hash
|
||||||
my %prefix_of = reverse %{ $opt->{ namespace } };
|
my %prefix_of = reverse %{ $opt->{ namespace } };
|
||||||
my $prefix = $prefix_of{ $ns }
|
my $prefix = $prefix_of{ $ns }
|
||||||
|| die 'No prefix found for namespace '. $ns;
|
|| die 'No prefix found for namespace '. $ns;
|
||||||
$xml .= join q{}, " type=\"$prefix:", $self->get_name(), '" '
|
$xml .= join q{}, " type=\"$prefix:", $self->get_name(), '" '
|
||||||
if ($self->get_name() );
|
if ($self->get_name() );
|
||||||
}
|
}
|
||||||
$xml .= '>';
|
$xml .= '>';
|
||||||
$xml .= "\n" if ( $opt->{ readable } ); # add linebreak
|
$xml .= "\n" if ( $opt->{ readable } ); # add linebreak
|
||||||
if ( ($flavor eq "sequence") or ($flavor eq "all") ) {
|
if ( ($variety eq "sequence") or ($variety eq "all") ) {
|
||||||
$opt->{ indent } .= "\t";
|
$opt->{ indent } .= "\t";
|
||||||
for my $element (@{ $self->get_element() }) {
|
for my $element (@{ $self->get_element() }) {
|
||||||
# might be list - listify
|
# might be list - listify
|
||||||
@@ -114,7 +115,7 @@ sub serialize {
|
|||||||
$opt->{ indent } =~s/\t$//;
|
$opt->{ indent } =~s/\t$//;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
die "sorry, we just handle all and sequence types yet...";
|
die "sorry, we just handle all and sequence types yet...";
|
||||||
}
|
}
|
||||||
$xml .= $opt->{ indent } if ( $opt->{ readable } ); # add indentation
|
$xml .= $opt->{ indent } if ( $opt->{ readable } ); # add indentation
|
||||||
$xml .= '</' . $name . '>';
|
$xml .= '</' . $name . '>';
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ sub serialize {
|
|||||||
# TODO: implement final and substitutionGroup - maybe never implement
|
# TODO: implement final and substitutionGroup - maybe never implement
|
||||||
# substitutionGroup ?
|
# substitutionGroup ?
|
||||||
|
|
||||||
$name ||= $self->get_name();
|
$name = $self->get_name() if not ($name);
|
||||||
|
|
||||||
if ( $opt->{ qualify } ) {
|
if ( $opt->{ qualify } ) {
|
||||||
$opt->{ attributes } = [ ' xmlns="' . $self->get_targetNamespace .'"' ];
|
$opt->{ attributes } = [ ' xmlns="' . $self->get_targetNamespace .'"' ];
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ use warnings;
|
|||||||
|
|
||||||
use base qw(SOAP::WSDL::XSD::Typelib::Element);
|
use base qw(SOAP::WSDL::XSD::Typelib::Element);
|
||||||
|
|
||||||
|
our $VERSION=q{2.00_29};
|
||||||
|
|
||||||
sub start_tag {
|
sub start_tag {
|
||||||
# my ($self, $opt, $value) = @_;
|
# my ($self, $opt, $value) = @_;
|
||||||
return q{} if (@_ < 3);
|
return q{} if (@_ < 3);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||||
|
|
||||||
|
our $VERSION=q{2.00_29};
|
||||||
|
|
||||||
sub serialize {
|
sub serialize {
|
||||||
# we work on @_ for performance.
|
# we work on @_ for performance.
|
||||||
$_[1] ||= {}; # $option_ref
|
$_[1] ||= {}; # $option_ref
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require Class::Std::Fast::Storable;
|
|||||||
|
|
||||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
||||||
|
|
||||||
our $VERSION = '2.00_29';
|
our $VERSION = '2.00_31';
|
||||||
|
|
||||||
my %ELEMENTS_FROM;
|
my %ELEMENTS_FROM;
|
||||||
my %ATTRIBUTES_OF;
|
my %ATTRIBUTES_OF;
|
||||||
@@ -45,6 +45,10 @@ my %xml_attr_of :ATTR();
|
|||||||
sub attr {
|
sub attr {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $class = ref $self;
|
my $class = ref $self;
|
||||||
|
|
||||||
|
# disable strictness - in perl 5.10 %{ "$foo\::_bar" } triggers a
|
||||||
|
# symbolic reference error with strictness enabled
|
||||||
|
no strict qw(refs);
|
||||||
die "$class has no attributes" if not defined %{ "$class\::_ATTR::"};
|
die "$class has no attributes" if not defined %{ "$class\::_ATTR::"};
|
||||||
if (@_) {
|
if (@_) {
|
||||||
# setter
|
# setter
|
||||||
@@ -176,7 +180,7 @@ sub _factory {
|
|||||||
: die croak "cannot use $is_ref reference as value for $name - $type required"
|
: die croak "cannot use $is_ref reference as value for $name - $type required"
|
||||||
|
|
||||||
# not $is_ref
|
# not $is_ref
|
||||||
: $type->new({ value => $_[1] });
|
: defined $_[1] ? $type->new({ value => $_[1] }) : () ;
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -223,7 +227,7 @@ sub _factory {
|
|||||||
: $_ =~ m{ \A # beginning of string
|
: $_ =~ m{ \A # beginning of string
|
||||||
xmlns # xmlns
|
xmlns # xmlns
|
||||||
}xms # get_elements is inlined for performance.
|
}xms # get_elements is inlined for performance.
|
||||||
? do {}
|
? ()
|
||||||
: do { use Data::Dumper;
|
: do { use Data::Dumper;
|
||||||
croak "unknown field $_ in $class. Valid fields are:\n"
|
croak "unknown field $_ in $class. Valid fields are:\n"
|
||||||
. join(', ', @{ $ELEMENTS_FROM{ $class } }) . "\n"
|
. join(', ', @{ $ELEMENTS_FROM{ $class } }) . "\n"
|
||||||
@@ -455,9 +459,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 497 $
|
$Rev: 524 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: ComplexType.pm 497 2008-01-19 12:57:57Z kutterma $
|
$Id: ComplexType.pm 524 2008-02-10 23:24:43Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -175,9 +175,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
|||||||
|
|
||||||
=head1 REPOSITORY INFORMATION
|
=head1 REPOSITORY INFORMATION
|
||||||
|
|
||||||
$Rev: 497 $
|
$Rev: 498 $
|
||||||
$LastChangedBy: kutterma $
|
$LastChangedBy: kutterma $
|
||||||
$Id: Element.pm 497 2008-01-19 12:57:57Z kutterma $
|
$Id: Element.pm 498 2008-01-20 22:47:18Z kutterma $
|
||||||
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
|
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
--- Manual.pod-orig 2007-12-04 00:45:33.000000000 -0500
|
|
||||||
+++ Manual.pod 2007-12-04 00:53:12.000000000 -0500
|
|
||||||
@@ -37,7 +37,7 @@
|
|
||||||
objects based on SOAP::WSDL's XML schema implementation.
|
|
||||||
|
|
||||||
To access the object's properties use get_NAME / set_NAME getter/setter
|
|
||||||
-methods whith NAME corresponding to the XML tag name / the hash structure as
|
|
||||||
+methods with NAME corresponding to the XML tag name / the hash structure as
|
|
||||||
showed in the generated pod.
|
|
||||||
|
|
||||||
=item * Run script
|
|
||||||
@@ -91,7 +91,7 @@
|
|
||||||
|
|
||||||
There should be a bunch of classes for types (in the MyTypes:: namespace by
|
|
||||||
default), elements (in MyElements::), and at least one typemap (in
|
|
||||||
-MyTypemaps::) and one ore more interface classes (in MyInterfaces::).
|
|
||||||
+MyTypemaps::) and one or more interface classes (in MyInterfaces::).
|
|
||||||
|
|
||||||
If you don't already know the details of the web service you're going to
|
|
||||||
instrument, it's now time to read the perldoc of the generated interface
|
|
||||||
@@ -111,7 +111,7 @@
|
|
||||||
print $result;
|
|
||||||
|
|
||||||
The above handling of errors ("die $result if not $result") may look a bit
|
|
||||||
-strange - it is due to the nature of
|
|
||||||
+strange - it is due to the nature of the
|
|
||||||
L<SOAP::WSDL::SOAP::Typelib::Fault11|SOAP::WSDL::SOAP::Typelib::Fault11>
|
|
||||||
objects SOAP::WSDL uses for signalling failure.
|
|
||||||
|
|
||||||
@@ -144,12 +144,12 @@
|
|
||||||
only implement a few by hand. These (precious) few classes may get lost in
|
|
||||||
the mass of (cheap) generated ones. Just imagine one of your co-workers (or
|
|
||||||
even yourself) deleting the whole bunch and re-generating everything - oops
|
|
||||||
-- almost everything. You got the point.
|
|
||||||
+- almost everything. You get the point.
|
|
||||||
|
|
||||||
For simplicity, you probably just want to use builtin types wherever possible
|
|
||||||
- you are probably not interested in whether a fault detail's error code is
|
|
||||||
presented to you as a simpleType ranging from 1 to 10 (which you have to
|
|
||||||
-write) or as a int (which is a builtin type ready to use).
|
|
||||||
+write) or as an int (which is a builtin type ready to use).
|
|
||||||
|
|
||||||
Using builtin types for simpleType definitions may greatly reduce the number
|
|
||||||
of additional classes you need to implement.
|
|
||||||
+11
-8
@@ -4,23 +4,26 @@ use warnings;
|
|||||||
use diagnostics;
|
use diagnostics;
|
||||||
use Test::More tests => 17; # qw/no_plan/; # TODO: change to tests => N;
|
use Test::More tests => 17; # qw/no_plan/; # TODO: change to tests => N;
|
||||||
use lib '../lib';
|
use lib '../lib';
|
||||||
|
use File::Spec;
|
||||||
|
use File::Basename qw(dirname);
|
||||||
eval {
|
eval {
|
||||||
require Test::XML;
|
require Test::XML;
|
||||||
import Test::XML
|
import Test::XML
|
||||||
};
|
};
|
||||||
|
|
||||||
use Cwd;
|
|
||||||
|
|
||||||
my $path = cwd;
|
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
||||||
$path =~s|\/t\/?$||; # allow running from t/ and above (Build test)
|
my ($volume, $dir) = File::Spec->splitpath($path, 1);
|
||||||
|
my @dir_from = File::Spec->splitdir($dir);
|
||||||
|
unshift @dir_from, $volume if $volume;
|
||||||
|
my $url = join '/', @dir_from;
|
||||||
|
|
||||||
use_ok(qw/SOAP::WSDL/);
|
use_ok(qw/SOAP::WSDL/);
|
||||||
|
|
||||||
my $soap = SOAP::WSDL->new(
|
my $soap;
|
||||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
$soap = SOAP::WSDL->new(
|
||||||
outputxml => 1, # required, if not set ::SOM serializer will be loaded on
|
wsdl => 'file:///' . $url .'/acceptance/wsdl/006_sax_client.wsdl',
|
||||||
# call
|
outputxml => 1, # required, if not set ::SOM serializer will be loaded
|
||||||
)->wsdlinit();
|
)->wsdlinit();
|
||||||
|
|
||||||
$soap->servicename('MessageGateway');
|
$soap->servicename('MessageGateway');
|
||||||
|
|||||||
+11
-4
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
use Test::More tests => 9;
|
use Test::More tests => 10;
|
||||||
use strict;
|
use strict;
|
||||||
use lib 'lib/';
|
use lib 'lib/';
|
||||||
use lib '../lib/';
|
use lib '../lib/';
|
||||||
@@ -48,16 +48,23 @@ ok $result->isa('SOAP::WSDL::SOAP::Typelib::Fault11'),
|
|||||||
'return fault on impossible call';
|
'return fault on impossible call';
|
||||||
ok ! $result, 'fault is false in boolean context';
|
ok ! $result, 'fault is false in boolean context';
|
||||||
|
|
||||||
package FakeResolver;
|
|
||||||
|
|
||||||
sub get_class {
|
# $soap->no_dispatch(1);
|
||||||
my %class_list = (
|
ok ! $soap->call('Test'), 'second call';
|
||||||
|
|
||||||
|
package FakeResolver;
|
||||||
|
my %class_list = (
|
||||||
'Fault' => 'SOAP::WSDL::SOAP::Typelib::Fault11',
|
'Fault' => 'SOAP::WSDL::SOAP::Typelib::Fault11',
|
||||||
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||||
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||||
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||||
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyType',
|
'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyType',
|
||||||
);
|
);
|
||||||
|
sub get_class {
|
||||||
|
|
||||||
return $class_list{ $_[1] };
|
return $class_list{ $_[1] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_typemap {
|
||||||
|
return \%class_list;
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -2,11 +2,11 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 12;
|
use Test::More tests => 12;
|
||||||
use File::Spec;
|
use File::Spec;
|
||||||
use File::Basename;
|
use File::Basename qw(dirname);
|
||||||
use_ok qw(SOAP::WSDL);
|
use_ok qw(SOAP::WSDL);
|
||||||
|
|
||||||
my $path = File::Spec->rel2abs(dirname( __FILE__ ) );
|
my $path = File::Spec->rel2abs(dirname( __FILE__ ) );
|
||||||
|
$path =~s{\\}{/}xmsg; # fix for windows
|
||||||
my $soap = SOAP::WSDL->new();
|
my $soap = SOAP::WSDL->new();
|
||||||
$soap->wsdl("file://$path/WSDL_NOT_FOUND.wsdl");
|
$soap->wsdl("file://$path/WSDL_NOT_FOUND.wsdl");
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -1,4 +1,4 @@
|
|||||||
use Test::More tests => 7;
|
use Test::More tests => 10;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use diagnostics;
|
use diagnostics;
|
||||||
@@ -29,3 +29,12 @@ ok( $soap->wsdlinit(), 'parsed WSDL' );
|
|||||||
ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );
|
ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );
|
||||||
|
|
||||||
ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit');
|
ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit');
|
||||||
|
|
||||||
|
ok( $soap = SOAP::WSDL->new(
|
||||||
|
wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl'
|
||||||
|
), 'Instantiated object' );
|
||||||
|
|
||||||
|
ok( $soap->wsdlinit() );
|
||||||
|
$soap->outputxml(1);
|
||||||
|
eval { $soap->call('test') };
|
||||||
|
like $@, qr{type \s tns:testSimpleType1 \s , \s urn:simpleType \s not \s found}xms;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
use Test::More tests => 8;
|
use Test::More tests => 9;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use lib '../lib';
|
use lib '../lib';
|
||||||
@@ -28,7 +28,11 @@ ok( $soap = SOAP::WSDL->new(
|
|||||||
), 'Instantiated object' );
|
), 'Instantiated object' );
|
||||||
|
|
||||||
#3
|
#3
|
||||||
$soap->readable(1);
|
SKIP: {
|
||||||
|
skip 'Cannot test warning without Test::Warn', 1 if not (eval "require Test::Warn");
|
||||||
|
Test::Warn::warning_like( sub { $soap->readable(1) },
|
||||||
|
qr{\A 'readable' \s has \s no \s effect \s any \s more}xms);
|
||||||
|
}
|
||||||
$soap->outputxml(1);
|
$soap->outputxml(1);
|
||||||
|
|
||||||
ok( $soap->wsdlinit(
|
ok( $soap->wsdlinit(
|
||||||
|
|||||||
+25
-1
@@ -1,6 +1,6 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 4; #qw(no_plan);
|
use Test::More tests => 8; #qw(no_plan);
|
||||||
|
|
||||||
use_ok qw(SOAP::WSDL::Client);
|
use_ok qw(SOAP::WSDL::Client);
|
||||||
|
|
||||||
@@ -11,3 +11,27 @@ ok $client = SOAP::WSDL::Client->new({
|
|||||||
});
|
});
|
||||||
|
|
||||||
is $client->get_endpoint(), 'http://localhost';
|
is $client->get_endpoint(), 'http://localhost';
|
||||||
|
|
||||||
|
$client->no_dispatch(1);
|
||||||
|
$client->set_serializer('main');
|
||||||
|
my $serialize = $client->call({
|
||||||
|
operation => 'testMethod'
|
||||||
|
}, { foo => 'bar'}, { bar => 'baz'});
|
||||||
|
is $serialize->{ body }->{ foo }, 'bar';
|
||||||
|
is $serialize->{ header }->{ bar }, 'baz';
|
||||||
|
|
||||||
|
# Old calling style compatibility test - foo => bar is body...
|
||||||
|
$serialize = $client->call({
|
||||||
|
operation => 'testMethod'
|
||||||
|
}, foo => 'bar');
|
||||||
|
is $serialize->{ body }->{ foo }, 'bar';
|
||||||
|
|
||||||
|
# Old calling style compatibility test - foo => bar is body...
|
||||||
|
$serialize = $client->call('testMethod', foo => 'bar');
|
||||||
|
is $serialize->{ body }->{ foo }, 'bar';
|
||||||
|
|
||||||
|
|
||||||
|
sub serialize {
|
||||||
|
my $self = shift;
|
||||||
|
return shift;
|
||||||
|
}
|
||||||
|
|||||||
+105
-7
@@ -4,11 +4,9 @@ use Class::Std::Fast;
|
|||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 9;
|
use Test::More tests => 21;
|
||||||
use_ok qw(SOAP::WSDL::Client::Base);
|
use_ok qw(SOAP::WSDL::Client::Base);
|
||||||
|
|
||||||
my $client = SOAP::WSDL::Client::Base->new();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
no warnings qw(redefine once);
|
no warnings qw(redefine once);
|
||||||
*SOAP::WSDL::Client::call = sub { is $_[1]->{ operation }, 'sayHello', 'Called method';
|
*SOAP::WSDL::Client::call = sub { is $_[1]->{ operation }, 'sayHello', 'Called method';
|
||||||
@@ -16,6 +14,8 @@ my $client = SOAP::WSDL::Client::Base->new();
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $client = SOAP::WSDL::Client::Base->new();
|
||||||
|
|
||||||
my @result = $client->call({
|
my @result = $client->call({
|
||||||
operation => 'sayHello',
|
operation => 'sayHello',
|
||||||
soap_action => 'urn:HelloWorld#sayHello',
|
soap_action => 'urn:HelloWorld#sayHello',
|
||||||
@@ -25,19 +25,23 @@ my @result = $client->call({
|
|||||||
'use' => 'literal',
|
'use' => 'literal',
|
||||||
namespace => '',
|
namespace => '',
|
||||||
encodingStyle => '',
|
encodingStyle => '',
|
||||||
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string
|
||||||
|
SOAP::WSDL::XSD::Typelib::Builtin::string
|
||||||
|
)],
|
||||||
},
|
},
|
||||||
header => {
|
header => {
|
||||||
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string
|
||||||
|
|
||||||
|
)],
|
||||||
},
|
},
|
||||||
headerfault => {
|
headerfault => {
|
||||||
|
|
||||||
}
|
}
|
||||||
}, { value => 'Body' }, { value => 'Header' });
|
}, { value => 'Body' }, { value => 'Header' });
|
||||||
|
|
||||||
is $result[0], 'Body';
|
is $result[0]->[0], 'Body';
|
||||||
is $result[1], 'Header';
|
is $result[1], 'Header';
|
||||||
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
isa_ok $result[0]->[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
|
||||||
@result = $client->call({
|
@result = $client->call({
|
||||||
operation => 'sayHello',
|
operation => 'sayHello',
|
||||||
@@ -64,3 +68,97 @@ is $result[0], 'Body2';
|
|||||||
is $result[1], 'Header2';
|
is $result[1], 'Header2';
|
||||||
isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
|
||||||
|
# Call with more body parts than parameters. Body parts are empty
|
||||||
|
@result = $client->call({
|
||||||
|
operation => 'sayHello',
|
||||||
|
soap_action => 'urn:HelloWorld#sayHello',
|
||||||
|
style => 'document',
|
||||||
|
body => {
|
||||||
|
|
||||||
|
'use' => 'literal',
|
||||||
|
namespace => '',
|
||||||
|
encodingStyle => '',
|
||||||
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
||||||
|
},
|
||||||
|
header => {
|
||||||
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
||||||
|
},
|
||||||
|
headerfault => {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, [],
|
||||||
|
SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'Header2' })
|
||||||
|
);
|
||||||
|
|
||||||
|
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
is $result[0], undef;
|
||||||
|
is $result[1], 'Header2';
|
||||||
|
isa_ok $result[1], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
|
||||||
|
# Call with more body parts than parameters. Body parts are empty
|
||||||
|
# No header
|
||||||
|
@result = $client->call({
|
||||||
|
operation => 'sayHello',
|
||||||
|
soap_action => 'urn:HelloWorld#sayHello',
|
||||||
|
style => 'document',
|
||||||
|
body => {
|
||||||
|
|
||||||
|
'use' => 'literal',
|
||||||
|
namespace => '',
|
||||||
|
encodingStyle => '',
|
||||||
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
||||||
|
},
|
||||||
|
header => {
|
||||||
|
},
|
||||||
|
headerfault => {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
is $result[0], undef;
|
||||||
|
|
||||||
|
eval { $client->call({
|
||||||
|
operation => 'sayHello',
|
||||||
|
soap_action => 'urn:HelloWorld#sayHello',
|
||||||
|
style => 'document',
|
||||||
|
body => {
|
||||||
|
|
||||||
|
'use' => 'literal',
|
||||||
|
namespace => '',
|
||||||
|
encodingStyle => '',
|
||||||
|
parts => [qw( SomeStupidClassYouProbablyDontHaveOnYourSystem )],
|
||||||
|
},
|
||||||
|
header => {
|
||||||
|
},
|
||||||
|
headerfault => {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
like $@, qr{ Can't \s locate }xms;
|
||||||
|
|
||||||
|
isa_ok $result[0], 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
|
is $result[0], undef;
|
||||||
|
|
||||||
|
eval { $client->call({
|
||||||
|
operation => 'sayHello',
|
||||||
|
soap_action => 'urn:HelloWorld#sayHello',
|
||||||
|
style => 'document',
|
||||||
|
body => {
|
||||||
|
|
||||||
|
'use' => 'literal',
|
||||||
|
namespace => '',
|
||||||
|
encodingStyle => '',
|
||||||
|
parts => [qw( SOAP::WSDL::XSD::Typelib::Builtin::string )],
|
||||||
|
},
|
||||||
|
header => {
|
||||||
|
parts => [qw( SomeOtherStupidClassYouProbablyDontHaveOnYourSystem )],
|
||||||
|
},
|
||||||
|
headerfault => {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
# die $@;
|
||||||
|
like $@, qr{ Can't \s locate }xms;
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More tests => 4;
|
||||||
|
|
||||||
|
use SOAP::WSDL::PortType;
|
||||||
|
use_ok qw(SOAP::WSDL::Definitions);
|
||||||
|
|
||||||
|
my $obj = SOAP::WSDL::Definitions->new({
|
||||||
|
portType => [
|
||||||
|
SOAP::WSDL::PortType->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::PortType->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'baz',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::PortType->new({
|
||||||
|
name => 'foobar',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
my $found= $obj->find_portType('bar', 'foobar');
|
||||||
|
is $found->get_name(), 'foobar', 'found PortType';
|
||||||
|
$found = $obj->find_portType('baz', 'foo');
|
||||||
|
is $found->get_name(), 'foo', 'found PortType';
|
||||||
|
|
||||||
|
$found = $obj->find_portType('baz', 'foobar');
|
||||||
|
is $found, undef, 'find_PortType returns undef on unknown PortType';
|
||||||
@@ -4,7 +4,7 @@ package TestResolver;
|
|||||||
sub get_typemap { {} };
|
sub get_typemap { {} };
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
use Test::More tests => 8;
|
use Test::More tests => 9;
|
||||||
|
|
||||||
use SOAP::WSDL::Deserializer::XSD;
|
use SOAP::WSDL::Deserializer::XSD;
|
||||||
|
|
||||||
@@ -25,3 +25,6 @@ is $fault->get_faultcode(), 'soap:Client';
|
|||||||
isa_ok $obj->deserialize('rubbeldiekatz'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
isa_ok $obj->deserialize('rubbeldiekatz'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
||||||
isa_ok $obj->deserialize('<zumsel></zumsel>'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
isa_ok $obj->deserialize('<zumsel></zumsel>'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
||||||
isa_ok $obj->deserialize('<Envelope xmlns="huchmampf"></Envelope>'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
isa_ok $obj->deserialize('<Envelope xmlns="huchmampf"></Envelope>'), 'SOAP::WSDL::SOAP::Typelib::Fault11';
|
||||||
|
is $obj->deserialize('<SOAP-ENV:Envelope
|
||||||
|
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
|
<SOAP-ENV:Body ></SOAP-ENV:Body></SOAP-ENV:Envelope>'), undef, 'Deserialize empty envelope';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 3;
|
use Test::More tests => 5;
|
||||||
use_ok qw(SOAP::WSDL::Expat::Base);
|
use_ok qw(SOAP::WSDL::Expat::Base);
|
||||||
|
|
||||||
my $parser = SOAP::WSDL::Expat::Base->new();
|
my $parser = SOAP::WSDL::Expat::Base->new();
|
||||||
@@ -10,3 +10,12 @@ ok $@;
|
|||||||
|
|
||||||
eval { $parser->parsefile('Foobar')};
|
eval { $parser->parsefile('Foobar')};
|
||||||
ok $@;
|
ok $@;
|
||||||
|
|
||||||
|
|
||||||
|
$parser = SOAP::WSDL::Expat::Base->new({
|
||||||
|
user_agent => 'foo',
|
||||||
|
});
|
||||||
|
|
||||||
|
is $parser->get_user_agent(), 'foo';
|
||||||
|
$parser->set_user_agent('bar');
|
||||||
|
is $parser->get_user_agent(), 'bar';
|
||||||
|
|||||||
@@ -36,20 +36,20 @@ my $xml_attr = q{<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
|
|||||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
<SOAP-ENV:Body><MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2">
|
<SOAP-ENV:Body><MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2">
|
||||||
<test>Test</test>
|
<test>Test</test>
|
||||||
<test2 >Test2</test2>
|
<test2 > </test2>
|
||||||
</MyElementAttrs></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
</MyElementAttrs></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||||
|
|
||||||
$parser->parse($xml_attr);
|
$parser->parse($xml_attr);
|
||||||
|
|
||||||
is $parser->get_data(),
|
is $parser->get_data(),
|
||||||
q{<MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2"><test>Test</test><test2>Test2</test2></MyElementAttrs>},
|
q{<MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2"><test>Test</test></MyElementAttrs>},
|
||||||
'Content with attributes';
|
'Content with attributes';
|
||||||
|
|
||||||
my $xml_error = q{<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
my $xml_error = q{<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
<SOAP-ENV:Body><MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2">
|
<SOAP-ENV:Body><MyElementAttrs xmlns="urn:Test" test="Test" test2="Test2">
|
||||||
<test>Test</test>
|
<test>Test</test>
|
||||||
<test2 >Test2</test2>
|
<test2 ></test2>
|
||||||
<foo>Bar</foo>
|
<foo>Bar</foo>
|
||||||
</MyElementAttrs></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
</MyElementAttrs></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 4; #qw(no_plan);
|
use Test::More tests => 11; #qw(no_plan);
|
||||||
use File::Spec;
|
use File::Spec;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
|
||||||
@@ -30,16 +30,37 @@ my $generator = SOAP::WSDL::Generator::Template::XSD->new({
|
|||||||
OUTPUT_PATH => "$path/testlib",
|
OUTPUT_PATH => "$path/testlib",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $code = "";
|
#my $code = "";
|
||||||
$generator->set_output(\$code);
|
#$generator->set_output(\$code);
|
||||||
$generator->generate_typelib();
|
#$generator->generate_typelib();
|
||||||
{
|
#{
|
||||||
eval $code;
|
# eval $code;
|
||||||
ok !$@;
|
# ok !$@;
|
||||||
print $@ if $@;
|
# print $@ if $@;
|
||||||
}
|
#}
|
||||||
|
|
||||||
# print $code;
|
$definitions = $parser->parse_uri(
|
||||||
|
"file://$path/../../../acceptance/wsdl/WSDLParser-import.wsdl"
|
||||||
|
);
|
||||||
|
|
||||||
|
ok my $service = $definitions->first_service();
|
||||||
|
is $service->get_name(), 'Service1', 'wsdl:import service name';
|
||||||
|
is $definitions->first_binding()->get_name(), 'Service1Soap', 'wsdl:import binding name';
|
||||||
|
|
||||||
|
ok my $schema_from_ref = $definitions->first_types()->get_schema();
|
||||||
|
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__
|
__END__
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 6;
|
||||||
use Scalar::Util qw(blessed);
|
use Scalar::Util qw(blessed);
|
||||||
use SOAP::WSDL::Factory::Transport;
|
use SOAP::WSDL::Factory::Transport;
|
||||||
|
|
||||||
|
eval { SOAP::WSDL::Factory::Transport->get_transport('') };
|
||||||
|
like $@, qr{^no transport};
|
||||||
|
|
||||||
|
|
||||||
eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl') };
|
eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl') };
|
||||||
like $@, qr{^no transport};
|
like $@, qr{^no transport};
|
||||||
|
|
||||||
@@ -12,7 +16,7 @@ ok blessed $obj;
|
|||||||
|
|
||||||
SOAP::WSDL::Factory::Transport->register('zumsl', 'Hope_You_Have_No_Such_Package_Installed');
|
SOAP::WSDL::Factory::Transport->register('zumsl', 'Hope_You_Have_No_Such_Package_Installed');
|
||||||
|
|
||||||
eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl') };
|
eval { SOAP::WSDL::Factory::Transport->get_transport('zumsl:foo') };
|
||||||
like $@, qr{^Cannot load};
|
like $@, qr{^Cannot load};
|
||||||
|
|
||||||
eval { SOAP::WSDL::Factory::Transport->register( \'zumsl', 'Foo') };
|
eval { SOAP::WSDL::Factory::Transport->register( \'zumsl', 'Foo') };
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use Test::More tests => 38;
|
use Test::More tests => 42;
|
||||||
use File::Basename qw(dirname);
|
use File::Basename qw(dirname);
|
||||||
use File::Spec;
|
use File::Spec;
|
||||||
use File::Path;
|
use File::Path;
|
||||||
|
use diagnostics;
|
||||||
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
my $path = File::Spec->rel2abs( dirname __FILE__ );
|
||||||
|
|
||||||
use_ok qw(SOAP::WSDL::Generator::Visitor::Typelib);
|
use_ok qw(SOAP::WSDL::Generator::Visitor::Typelib);
|
||||||
@@ -149,5 +149,16 @@ is $ct_east->get_testAtomicSimpleTypeElement2->get_value(), 23;
|
|||||||
isa_ok($ct_east->get_testAtomicSimpleTypeElement2,
|
isa_ok($ct_east->get_testAtomicSimpleTypeElement2,
|
||||||
'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement2');
|
'MyTypes::testComplexTypeElementAtomicSimpleType::_testAtomicSimpleTypeElement2');
|
||||||
|
|
||||||
|
ok eval { require MyElements::testElementCompletelyEmptyComplex; }
|
||||||
|
, 'load MyElements::testElementCompletelyEmptyComplex';
|
||||||
|
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";
|
rmtree "$path/testlib";
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More tests => 4;
|
||||||
|
|
||||||
|
use SOAP::WSDL::Operation;
|
||||||
|
use_ok qw(SOAP::WSDL::PortType);
|
||||||
|
|
||||||
|
my $portType = SOAP::WSDL::PortType->new({
|
||||||
|
operation => [
|
||||||
|
SOAP::WSDL::Operation->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::Operation->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'baz',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::Operation->new({
|
||||||
|
name => 'foobar',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
my $operation = $portType->find_operation('bar', 'foobar');
|
||||||
|
is $operation->get_name(), 'foobar', 'found operation';
|
||||||
|
$operation = $portType->find_operation('baz', 'foo');
|
||||||
|
is $operation->get_name(), 'foo', 'found operation';
|
||||||
|
|
||||||
|
$operation = $portType->find_operation('baz', 'foobar');
|
||||||
|
is $operation, undef, 'find_operation returns undef on unknown operation';
|
||||||
@@ -55,8 +55,13 @@ eval { $server->handle($request) };
|
|||||||
like $@, qr{\A Not \s implemented:}x, 'Not implemented fault caught';
|
like $@, qr{\A Not \s implemented:}x, 'Not implemented fault caught';
|
||||||
|
|
||||||
|
|
||||||
|
$server->set_action_map_ref({ Test => 'test'});
|
||||||
|
ok $server->handle($request);
|
||||||
|
|
||||||
$server->set_deserializer('MyDeserializer2');
|
$server->set_deserializer('MyDeserializer2');
|
||||||
eval { $server->handle(HTTP::Request->new()) };
|
eval { $server->handle(HTTP::Request->new()) };
|
||||||
like $@, qr{\A Error \s deserializing}x, 'Error deserializing caught';
|
like $@, qr{\A Error \s deserializing}x, 'Error deserializing caught';
|
||||||
|
|
||||||
|
sub test {
|
||||||
|
return;
|
||||||
|
}
|
||||||
+94
-32
@@ -11,7 +11,7 @@ use Test::More;
|
|||||||
eval "require IO::Scalar"
|
eval "require IO::Scalar"
|
||||||
or plan skip_all => 'IO::Scalar required for testing...';
|
or plan skip_all => 'IO::Scalar required for testing...';
|
||||||
|
|
||||||
plan tests => 8;
|
plan tests => 12;
|
||||||
|
|
||||||
use_ok(SOAP::WSDL::Server);
|
use_ok(SOAP::WSDL::Server);
|
||||||
use_ok(SOAP::WSDL::Server::CGI);
|
use_ok(SOAP::WSDL::Server::CGI);
|
||||||
@@ -30,51 +30,113 @@ $server->set_action_map_ref({
|
|||||||
my $output = q{};
|
my $output = q{};
|
||||||
my $fh = IO::Scalar->new(\$output);
|
my $fh = IO::Scalar->new(\$output);
|
||||||
my $stdout = *STDOUT;
|
my $stdout = *STDOUT;
|
||||||
|
my $stdin = *STDIN;
|
||||||
|
|
||||||
*STDOUT = $fh;
|
*STDOUT = $fh;
|
||||||
|
{
|
||||||
|
local %ENV;
|
||||||
|
$server->handle();
|
||||||
|
|
||||||
$server->handle();
|
like $output, qr{ \A Status: \s 411 \s Length \s Required}x;
|
||||||
|
$output = q{};
|
||||||
|
|
||||||
like $output, qr{ \A Status: \s 411 \s Length \s Required}x;
|
$ENV{'CONTENT_LENGTH'} = '0e0';
|
||||||
$output = q{};
|
$server->handle();
|
||||||
|
|
||||||
$ENV{'CONTENT_LENGTH'} = '0e0';
|
like $output, qr{ Error \s deserializing }xsm;
|
||||||
$server->handle();
|
$output = q{};
|
||||||
|
|
||||||
like $output, qr{ Error \s deserializing }xsm;
|
$server->set_action_map_ref({
|
||||||
$output = q{};
|
'foo' => 'bar',
|
||||||
|
});
|
||||||
|
$server->set_dispatch_to( 'HandlerClass' );
|
||||||
|
|
||||||
$server->set_action_map_ref({
|
$server->handle();
|
||||||
'foo' => 'bar',
|
like $output, qr{no \s element \s found}xms;
|
||||||
});
|
$output = q{};
|
||||||
$server->set_dispatch_to( 'HandlerClass' );
|
|
||||||
|
|
||||||
$server->handle();
|
$ENV{REQUEST_METHOD} = 'POST';
|
||||||
like $output, qr{no \s element \s found}xms;
|
$ENV{HTTP_SOAPACTION} = 'test';
|
||||||
$output = q{};
|
$server->handle();
|
||||||
|
like $output, qr{no \s element \s found}xms;
|
||||||
|
$output = q{};
|
||||||
|
|
||||||
$ENV{REQUEST_METHOD} = 'POST';
|
delete $ENV{HTTP_SOAPACTION};
|
||||||
$ENV{HTTP_SOAPACTION} = 'test';
|
|
||||||
$server->handle();
|
|
||||||
like $output, qr{no \s element \s found}xms;
|
|
||||||
$output = q{};
|
|
||||||
|
|
||||||
delete $ENV{HTTP_SOAPACTION};
|
$ENV{EXPECT} = 'Foo';
|
||||||
|
$ENV{HTTP_SOAPAction} = 'foo';
|
||||||
|
$server->handle();
|
||||||
|
|
||||||
$ENV{EXPECT} = 'Foo';
|
like $output, qr{no \s element \s found}xms;
|
||||||
$ENV{HTTP_SOAPAction} = 'foo';
|
$output = q{};
|
||||||
$server->handle();
|
|
||||||
|
|
||||||
like $output, qr{no \s element \s found}xms;
|
$ENV{EXPECT} = '100-Continue';
|
||||||
$output = q{};
|
$ENV{HTTP_SOAPAction} = 'foo';
|
||||||
|
$server->handle();
|
||||||
|
like $output, qr{100 \s Continue}xms;
|
||||||
|
$output = q{};
|
||||||
|
|
||||||
$ENV{EXPECT} = '100-Continue';
|
delete $ENV{EXPECT};
|
||||||
$ENV{HTTP_SOAPAction} = 'foo';
|
|
||||||
$server->handle();
|
my $input = 'Foobar';
|
||||||
like $output, qr{100 \s Continue}xms;
|
my $ih = IO::Scalar->new(\$input);
|
||||||
$output = q{};
|
$ih->seek(0);
|
||||||
|
*STDIN = $ih;
|
||||||
|
|
||||||
|
# my $buffer;
|
||||||
|
# read(*STDIN, $buffer, 6);
|
||||||
|
# die $buffer;
|
||||||
|
$ENV{HTTP_SOAPAction} = 'bar';
|
||||||
|
$ENV{CONTENT_LENGTH} = 6;
|
||||||
|
$server->handle();
|
||||||
|
like $output, qr{ Error \s deserializing \s message}xms;
|
||||||
|
$output = q{};
|
||||||
|
$ih->seek(0);
|
||||||
|
|
||||||
|
$input = q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
|
<SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||||
|
$ENV{HTTP_SOAPAction} = 'bar';
|
||||||
|
$ENV{CONTENT_LENGTH} = length $input;
|
||||||
|
$server->handle();
|
||||||
|
# die $output;
|
||||||
|
like $output, qr{ Not \s found:}xms;
|
||||||
|
$output = q{};
|
||||||
|
$ih->seek(0);
|
||||||
|
|
||||||
|
|
||||||
|
$server->set_dispatch_to( 'HandlerClass' );
|
||||||
|
$server->set_action_map_ref({
|
||||||
|
'bar' => 'bar',
|
||||||
|
});
|
||||||
|
$input = q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
|
<SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||||
|
$ENV{HTTP_SOAPAction} = q{"bar"};
|
||||||
|
$ENV{CONTENT_LENGTH} = length $input;
|
||||||
|
$server->handle();
|
||||||
|
use Data::Dumper;
|
||||||
|
like $output, qr{ \A Status: \s 200 \s OK}xms;
|
||||||
|
$output = q{};
|
||||||
|
$ih->seek(0);
|
||||||
|
|
||||||
|
|
||||||
|
$server->set_dispatch_to( 'HandlerClass' );
|
||||||
|
$server->set_action_map_ref({
|
||||||
|
'bar' => 'bar',
|
||||||
|
});
|
||||||
|
$input = q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||||
|
<SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||||
|
$ENV{SERVER_SOFTWARE} ='IIS Foobar';
|
||||||
|
$ENV{HTTP_SOAPAction} = q{"bar"};
|
||||||
|
$ENV{CONTENT_LENGTH} = length $input;
|
||||||
|
$server->handle();
|
||||||
|
use Data::Dumper;
|
||||||
|
like $output, qr{ \A HTTP/1.0 \s 200 \s OK}xms;
|
||||||
|
$output = q{};
|
||||||
|
$ih->seek(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# restore handles
|
||||||
*STDOUT = $stdout;
|
*STDOUT = $stdout;
|
||||||
|
*STDIN = $stdin;
|
||||||
# print $output;
|
# print $output;
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More tests => 2; #qw(no_plan);
|
||||||
|
|
||||||
|
use_ok qw(SOAP::WSDL::XSD::Attribute);
|
||||||
|
|
||||||
|
use SOAP::WSDL::Expat::WSDLParser;
|
||||||
|
my $parser = SOAP::WSDL::Expat::WSDLParser->new();
|
||||||
|
|
||||||
|
my $xml = q{<s:schema elementFormDefault="qualified"
|
||||||
|
targetNamespace="urn:HelloWorld" xmlns:s="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<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>
|
||||||
|
};
|
||||||
|
|
||||||
|
my $schema = $parser->parse($xml);
|
||||||
|
|
||||||
|
is $schema->find_element('urn:HelloWorld', 'sayHello')
|
||||||
|
->first_complexType()
|
||||||
|
->first_attribute()->get_name(),
|
||||||
|
'testAttr', 'found attribute';
|
||||||
@@ -5,7 +5,7 @@ use Test::More tests => 2; #qw(no_plan);
|
|||||||
use_ok qw(SOAP::WSDL::XSD::ComplexType);
|
use_ok qw(SOAP::WSDL::XSD::ComplexType);
|
||||||
|
|
||||||
my $obj = SOAP::WSDL::XSD::ComplexType->new();
|
my $obj = SOAP::WSDL::XSD::ComplexType->new();
|
||||||
$obj->set_flavor('extension');
|
$obj->set_variety('extension');
|
||||||
|
|
||||||
eval { $obj->serialize('foo') };
|
eval { $obj->serialize('foo') };
|
||||||
like $@, qr{sorry, \s we \s just}xsm;
|
like $@, qr{sorry, \s we \s just}xsm;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package Foo;
|
package Foo;
|
||||||
sub serialize {
|
sub serialize {
|
||||||
return "serialized $_[1] $_[2]";
|
return "serialized $_[1] $_[2]" . join ' ', @{$_[3]->{ attributes } || [] } if $_[3];
|
||||||
}
|
}
|
||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 12;
|
use Test::More tests => 16;
|
||||||
|
|
||||||
use_ok qw(SOAP::WSDL::XSD::Element);
|
use_ok qw(SOAP::WSDL::XSD::Element);
|
||||||
|
|
||||||
@@ -16,6 +16,9 @@ is $element->first_simpleType(), undef;
|
|||||||
$element->set_simpleType('Foo');
|
$element->set_simpleType('Foo');
|
||||||
is $element->first_simpleType(), 'Foo';
|
is $element->first_simpleType(), 'Foo';
|
||||||
|
|
||||||
|
is $element->serialize('Foobar', 'Bar', { namespace => {} } ), 'serialized Foobar Bar';
|
||||||
|
is $element->serialize('Foobar', undef, { namespace => {} } ), 'serialized Foobar ';
|
||||||
|
|
||||||
$element->set_simpleType( [ 'Foo', 'Bar' ]);
|
$element->set_simpleType( [ 'Foo', 'Bar' ]);
|
||||||
is $element->first_simpleType(), 'Foo';
|
is $element->first_simpleType(), 'Foo';
|
||||||
|
|
||||||
@@ -30,6 +33,13 @@ is $element->first_complexType(), 'Foo';
|
|||||||
$element->set_default('Foo');
|
$element->set_default('Foo');
|
||||||
is $element->serialize('Foobar', undef, { namespace => {} } ), 'serialized Foobar Foo';
|
is $element->serialize('Foobar', undef, { namespace => {} } ), 'serialized Foobar Foo';
|
||||||
|
|
||||||
|
$element->set_targetNamespace('urn:foobar');
|
||||||
|
is $element->serialize('Foobar', undef, { namespace => {}, qualify => 1 } ), 'serialized Foobar Foo xmlns="urn:foobar"';
|
||||||
|
|
||||||
|
$element->set_targetNamespace('urn:foobar');
|
||||||
|
is $element->serialize('Foobar', 'Bar', { namespace => {}, qualify => 1 } ), 'serialized Foobar Bar xmlns="urn:foobar"';
|
||||||
|
|
||||||
|
|
||||||
$element->set_name('Bar');
|
$element->set_name('Bar');
|
||||||
is $element->serialize(undef, undef, { namespace => {} } ), 'serialized Bar Foo';
|
is $element->serialize(undef, undef, { namespace => {} } ), 'serialized Bar Foo';
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More tests => 4;
|
||||||
|
|
||||||
|
use SOAP::WSDL::XSD::Element;
|
||||||
|
use_ok qw(SOAP::WSDL::XSD::Schema);
|
||||||
|
|
||||||
|
my $obj = SOAP::WSDL::XSD::Schema->new({
|
||||||
|
element => [
|
||||||
|
SOAP::WSDL::XSD::Element->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::XSD::Element->new({
|
||||||
|
name => 'foo',
|
||||||
|
targetNamespace => 'baz',
|
||||||
|
}),
|
||||||
|
SOAP::WSDL::XSD::Element->new({
|
||||||
|
name => 'foobar',
|
||||||
|
targetNamespace => 'bar',
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
my $found= $obj->find_element('bar', 'foobar');
|
||||||
|
is $found->get_name(), 'foobar', 'found Element';
|
||||||
|
$found = $obj->find_element('baz', 'foo');
|
||||||
|
is $found->get_name(), 'foo', 'found Element';
|
||||||
|
|
||||||
|
$found = $obj->find_element('baz', 'foobar');
|
||||||
|
is $found, undef, 'find_Element returns undef on unknown Element';
|
||||||
@@ -68,21 +68,18 @@ __PACKAGE__->_factory(
|
|||||||
);
|
);
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
use Test::More tests => 106;
|
use Test::More tests => 109;
|
||||||
use Storable;
|
use Storable;
|
||||||
|
|
||||||
my $have_warn = eval { require Test::Warn; import Test::Warn; 1; };
|
my $have_warn = eval { require Test::Warn; import Test::Warn; 1; };
|
||||||
|
|
||||||
my $obj;
|
my $obj;
|
||||||
|
|
||||||
$obj = MyEmptyType->new();
|
for my $class (qw{MyEmptyType MyEmptyType2}) {
|
||||||
is $obj->serialize, '';
|
$obj = $class->new();
|
||||||
is $obj->serialize({ name => 'test'}), '<test/>';
|
is $obj->serialize, '', "$class object serializes to q{}";
|
||||||
|
is $obj->serialize({ name => 'test'}), '<test/>', "$class object serializes to <test/> with name=test";
|
||||||
$obj = MyEmptyType2->new();
|
}
|
||||||
is $obj->serialize, '';
|
|
||||||
is $obj->serialize({ name => 'test'}), '<test/>';
|
|
||||||
|
|
||||||
|
|
||||||
$obj = MyType->new({});
|
$obj = MyType->new({});
|
||||||
isa_ok $obj, 'MyType';
|
isa_ok $obj, 'MyType';
|
||||||
@@ -106,6 +103,7 @@ $obj = MyType->new({
|
|||||||
value => 'Test2'
|
value => 'Test2'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
isa_ok $obj, 'MyType';
|
isa_ok $obj, 'MyType';
|
||||||
isa_ok $obj->get_test, 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
isa_ok $obj->get_test, 'SOAP::WSDL::XSD::Typelib::Builtin::string';
|
||||||
is $obj->get_test, 'Test2', 'element content';
|
is $obj->get_test, 'Test2', 'element content';
|
||||||
@@ -131,6 +129,7 @@ $obj = MyType->new({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
isa_ok $obj, 'MyType';
|
isa_ok $obj, 'MyType';
|
||||||
isa_ok $obj->get_test, 'ARRAY';
|
isa_ok $obj->get_test, 'ARRAY';
|
||||||
is $obj->get_test()->[0], 'Test', 'element content (list content [0])';
|
is $obj->get_test()->[0], 'Test', 'element content (list content [0])';
|
||||||
@@ -165,13 +164,10 @@ $nested = MyType2->new({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$hash_of_ref = $nested->as_hash_ref();
|
$hash_of_ref = $nested->as_hash_ref();
|
||||||
is $hash_of_ref->{ test }->{ test }->[1], 'Test2';
|
is $hash_of_ref->{ test }->{ test }->[1], 'Test2';
|
||||||
|
|
||||||
|
|
||||||
# isnt $nested->get_test->[0], $obj, 'element identity';
|
|
||||||
|
|
||||||
$obj = MyType->new();
|
$obj = MyType->new();
|
||||||
isa_ok $obj, 'MyType';
|
isa_ok $obj, 'MyType';
|
||||||
is $obj->get_test, undef, 'undefined element content';
|
is $obj->get_test, undef, 'undefined element content';
|
||||||
@@ -197,6 +193,11 @@ for my $count (1..5) {
|
|||||||
$obj->set_test();
|
$obj->set_test();
|
||||||
is $obj->get_test, (), 'removed element content';
|
is $obj->get_test, (), 'removed element content';
|
||||||
|
|
||||||
|
$obj = MyEmptyType->new();
|
||||||
|
eval {
|
||||||
|
isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet';
|
||||||
|
};
|
||||||
|
like $@, qr{\s has \s no \s attributes}x;
|
||||||
|
|
||||||
$obj = MyElement->new();
|
$obj = MyElement->new();
|
||||||
isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet';
|
isa_ok $obj->attr() , 'SOAP::WSDL::XSD::Typelib::AttributeSet';
|
||||||
@@ -263,6 +264,11 @@ for my $count (1..5) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $clone = Storable::thaw( Storable::freeze( $obj ));
|
||||||
|
is $clone->get_test()->[0], 'TestString0';
|
||||||
|
|
||||||
|
## failure tests
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$obj = MyType->new({
|
$obj = MyType->new({
|
||||||
test => [
|
test => [
|
||||||
@@ -283,6 +289,14 @@ eval {
|
|||||||
};
|
};
|
||||||
like $@, qr{cannot \s use \s CODE}xms;
|
like $@, qr{cannot \s use \s CODE}xms;
|
||||||
|
|
||||||
|
# TODO ignore XMLNS (for now)
|
||||||
|
$obj = MyType->new({ xmlns => 'fubar'});
|
||||||
|
ok defined $obj;
|
||||||
|
TODO: {
|
||||||
|
local $TODO = "Support XML namespaces";
|
||||||
|
is $obj->get_xmlns(), 'fubar';
|
||||||
|
}
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$obj = MyType->new({
|
$obj = MyType->new({
|
||||||
foobar => 'fubar'
|
foobar => 'fubar'
|
||||||
@@ -300,16 +314,13 @@ like $@, qr{Can't \s locate \s object \s method}x;
|
|||||||
eval { MyType->new({ FOO => 42 }) };
|
eval { MyType->new({ FOO => 42 }) };
|
||||||
like $@, qr{unknown \s field \s}xm;
|
like $@, qr{unknown \s field \s}xm;
|
||||||
|
|
||||||
my $clone = Storable::thaw( Storable::freeze( $obj ));
|
|
||||||
is $clone->get_test()->[0], 'TestString0';
|
|
||||||
|
|
||||||
eval { SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD() };
|
eval { SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD() };
|
||||||
like $@, qr{Cannot \s call}xm;
|
like $@, qr{Cannot \s call}xm;
|
||||||
|
|
||||||
|
|
||||||
eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, {}) };
|
eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, {}) };
|
||||||
like $@, qr{ No \s class \s given \s for \s }xms;
|
like $@, qr{ No \s class \s given \s for \s }xms;
|
||||||
|
|
||||||
eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, { test => 'HopeItDoesntExistOnYourSystem'}) };
|
eval { SOAP::WSDL::XSD::Typelib::ComplexType->_factory([], { test => {} }, { test => 'HopeItDoesntExistOnYourSystem'}) };
|
||||||
like $@, qr{ Can't \s locate \s HopeItDoesntExistOnYourSystem.pm }xms;
|
like $@, qr{ Can't \s locate \s HopeItDoesntExistOnYourSystem.pm }xms;
|
||||||
|
|
||||||
|
# print Dumper
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?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/">
|
||||||
|
<import namespace="urn:HelloWorld" location="WSDLParser-imported.wsdl"/>
|
||||||
|
|
||||||
|
<service name="Service1">
|
||||||
|
<port name="Service1Soap" binding="s0:Service1Soap">
|
||||||
|
<soap:address
|
||||||
|
location="http://localhost:81/soap-wsdl-test/helloworld.pl" />
|
||||||
|
</port>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
</definitions>
|
||||||
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<?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.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>
|
||||||
|
|
||||||
|
|
||||||
|
</definitions>
|
||||||
|
|
||||||
@@ -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>
|
||||||
|
|
||||||
@@ -78,12 +78,25 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
|||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
<xsd:complexContent>
|
<xsd:complexContent>
|
||||||
<xsd:restriction base="tns:testComplexTypeAll">
|
<xsd:restriction base="tns:testComplexTypeAll">
|
||||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
<xsd:all>
|
||||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
|
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||||
|
<xsd:element name="Test2" type="xsd:string" minOccurs="1" />
|
||||||
|
</xsd:all>
|
||||||
</xsd:restriction>
|
</xsd:restriction>
|
||||||
</xsd:complexContent>
|
</xsd:complexContent>
|
||||||
</xsd:complexType>
|
</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:complexType name="testComplexTypeExtension">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation>complexType extension test</xsd:documentation>
|
<xsd:documentation>complexType extension test</xsd:documentation>
|
||||||
@@ -201,6 +214,15 @@ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xm
|
|||||||
<xsd:complexType name="emptyComplexType">
|
<xsd:complexType name="emptyComplexType">
|
||||||
<xsd:sequence></xsd:sequence>
|
<xsd:sequence></xsd:sequence>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
|
|
||||||
|
<xsd:element name="testElementCompletelyEmptyComplex">
|
||||||
|
<xsd:complexType>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
|
||||||
|
<xsd:complexType name="completelyEmptyComplexType">
|
||||||
|
</xsd:complexType>
|
||||||
|
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
</types>
|
</types>
|
||||||
<message name="testChoice">
|
<message name="testChoice">
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<s:schema elementFormDefault="qualified" targetNamespace="urn:HelloWorld"
|
||||||
|
xmlns:s="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<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>
|
||||||
@@ -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>
|
||||||
@@ -3,9 +3,10 @@ package MyComplexType;
|
|||||||
use strict;
|
use strict;
|
||||||
use Class::Std::Fast::Storable constructor => 'none';
|
use Class::Std::Fast::Storable constructor => 'none';
|
||||||
use lib '../../lib';
|
use lib '../../lib';
|
||||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
|
||||||
use base ('SOAP::WSDL::XSD::Typelib::ComplexType');
|
use base ('SOAP::WSDL::XSD::Typelib::ComplexType');
|
||||||
|
|
||||||
|
Class::Std::initialize();
|
||||||
|
|
||||||
my %MyTestName_of :ATTR(:get<MyTestName>);
|
my %MyTestName_of :ATTR(:get<MyTestName>);
|
||||||
|
|
||||||
__PACKAGE__->_factory(
|
__PACKAGE__->_factory(
|
||||||
|
|||||||
Reference in New Issue
Block a user