import SOAP-WSDL 2.00_01 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_01 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_01.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
bfbf5e27e0
commit
6fe52c4370
42
Build.PL
42
Build.PL
@@ -1,20 +1,22 @@
|
||||
#!/usr/bin/perl -w
|
||||
use Module::Build;
|
||||
|
||||
Module::Build->new(
|
||||
dist_abstract => 'WSDL support for SOAP::Lite',
|
||||
module_name => 'SOAP::WSDL',
|
||||
license => 'artistic',
|
||||
requires => {
|
||||
'SOAP::Lite' => 0,
|
||||
'XML::XPath' => 0,
|
||||
},
|
||||
buildrequires => {
|
||||
'Test::More' => 0,
|
||||
'SOAP::Lite' => 0,
|
||||
'XML::XPath' => 0,
|
||||
'Time::HiRes' => 0,
|
||||
'Cwd' => 0,
|
||||
},
|
||||
|
||||
)->create_build_script;
|
||||
use Module::Build;
|
||||
Module::Build->new(
|
||||
dist_abstract => 'SOAP with WSDL support',
|
||||
dist_name => 'SOAP-WSDL',
|
||||
dist_version => '2.00_01',
|
||||
module_name => 'SOAP::WSDL',
|
||||
license => 'artistic',
|
||||
requires => {
|
||||
'SOAP::Lite' => 0,
|
||||
'XML::XPath' => 0,
|
||||
'XML::LibXML' => 0,
|
||||
'XML::SAX::Base' => 0,
|
||||
'XML::SAX::ParserFactory' => 0,
|
||||
},
|
||||
buildrequires => { 'Test::More' => 0,
|
||||
'SOAP::Lite' => 0,
|
||||
'XML::XPath' => 0,
|
||||
'XML::LibXML' => 0,
|
||||
'XML::SAX::Base' => 0,
|
||||
'XML::SAX::ParserFactory' => 0,
|
||||
},
|
||||
)->create_build_script;
|
||||
|
||||
216
CHANGES
216
CHANGES
@@ -1,159 +1,57 @@
|
||||
* v1.23 2007/06/05 - bugfixes and optimizations
|
||||
- fixes #27426: missing prereq XML::XPath
|
||||
- fixed build_requires
|
||||
- some doc fixes
|
||||
- now performs some initializations on calling portname()
|
||||
|
||||
* v1.22 2007/05/30 - auto-discover service and port again
|
||||
- re-introduces auto-detecting of servicename and portname
|
||||
- fixes #27325: Test fails with Test::Pod::Coverage v 1.06.
|
||||
- Now build requires Test::More
|
||||
- documentation update
|
||||
- cosmetics
|
||||
|
||||
2007/05/28 private methods made private and pod update
|
||||
- added pod tests
|
||||
- made encodeComplexType and method generators private
|
||||
- updated pod
|
||||
- fixed test scripts to work again from within/without t/
|
||||
- moved development repository to
|
||||
https://svn.sourceforge.net/svnroot/soap-wsdl/ (finally !)
|
||||
|
||||
2007/05/21 updated base version to customized version from Giovanni S Fois
|
||||
- merged in doc changes, so that they don't refer to "customized version"
|
||||
- changed build process to Build.PL
|
||||
- changed repository layout to support new build process
|
||||
|
||||
2006/11/06 only in the customized version
|
||||
Added the support for default values in the wsdl file
|
||||
|
||||
2006/11/04 only in the customized version
|
||||
Changed the calling interface. Now it's driven by the by the service
|
||||
and port names.
|
||||
|
||||
2006/11/03 only in the customized version
|
||||
Corrected the Check for the correct number of elements in complex types
|
||||
|
||||
If a complex type is marked optional in a WSDL file, but sub-parts are marked as
|
||||
required, SOAP::WSDL used to die if the complex type was found in the data.
|
||||
Now, if a complex type has not data associated and is not strictly required, it
|
||||
will not be encoded.
|
||||
|
||||
A quick-and-dirty workaround is to turn off the check with
|
||||
|
||||
$soap->wsdl_checkoccurs(0);
|
||||
|
||||
2006/11/02 only in the customized version
|
||||
- small changes for .Net compatibility when encoding complex types
|
||||
- added some test cases to the test suite try perl t/3_varous.t for more details
|
||||
|
||||
|
||||
2006/10/28 only in the customized version
|
||||
- added a small support for the complexType restrictions of Arrays
|
||||
|
||||
2006/10/02 only in the customized version
|
||||
(Thanks to Dan Horne for having spotted so many bugs in a row)
|
||||
- the xml prefix was used as the default wsdl namespace when looking for the complextype restrictions
|
||||
- the module crashed when the operation had no part declaration
|
||||
- the port name stated in the service definition was used as the portType
|
||||
- the test suited failed when the module was unzipped in a t.* named directory
|
||||
|
||||
|
||||
|
||||
2006/09/15 only in the customized version
|
||||
(Thanks to Terje Kristensen for his support and twisted wsdl files :)
|
||||
- cleaned up the code for readability
|
||||
- cleaned up the code for "use warnings" and "use strict"
|
||||
- added support for wsdl files with multiple schema declarations
|
||||
- added supporto for some restriction on complexTypes
|
||||
|
||||
|
||||
|
||||
|
||||
2006/07/10 only in the customized version
|
||||
- added the support for SOAP::header calls
|
||||
|
||||
2006/06/10 only in the customized version
|
||||
|
||||
- removed the overload based on the type of the call's parameters
|
||||
|
||||
- added an overloading support based on the unique name of the input message of the call. The input message must be provided by the calling script (sorry, the module has no mean to find this).
|
||||
|
||||
- added a light support to the sympletypes.
|
||||
|
||||
- added a light support to the imported namespaces in the types section.
|
||||
|
||||
- added the support for the multiple SOAP bindings. The correct binding must be provided by the calling script (sorry, the module has no mean to find this).
|
||||
|
||||
- the method will use his own soapAction if defined
|
||||
|
||||
- the method will use his own namespace if defined
|
||||
|
||||
- some other code cleaning
|
||||
|
||||
2006/04/23 only in the customized version
|
||||
|
||||
- corrected a bug related to the presence of the same method name on multiple
|
||||
webservices
|
||||
|
||||
- added an overloading support based on the type of the call's parameters
|
||||
|
||||
- multiple extensions support added: a complextype can be an extension of a complextype which is an extension and so on
|
||||
|
||||
|
||||
|
||||
Revision 1.7 2004/07/27 13:00:03 lsc
|
||||
- added missing test file
|
||||
|
||||
Revision 1.18 2004/07/16 07:43:05 lsc
|
||||
fixed test scripts for windows
|
||||
|
||||
Revision 1.17 2004/07/05 08:19:49 lsc
|
||||
- added wsdl_checkoccurs
|
||||
|
||||
Revision 1.16 2004/07/04 09:01:14 lsc
|
||||
- change <definitions> element lookup from find('/definitions') and find('wsdl:definitions') to find('/*[1]') to process arbitrary default (wsdl) namespaces correctly
|
||||
- fixed test output in test 06
|
||||
|
||||
Revision 1.15 2004/07/02 12:28:31 lsc
|
||||
- documentation update
|
||||
- cosmetics
|
||||
|
||||
Revision 1.14 2004/07/02 10:53:36 lsc
|
||||
- API change:
|
||||
- call now behaves (almost) like SOAP::Lite::call
|
||||
- call() takes a list (hash) as second argument
|
||||
- call does no longer support the "dispatch" option
|
||||
- dispatching calls can be suppressed by passing
|
||||
"no_dispatch => 1" to new()
|
||||
- dispatching calls can be suppressed by calling
|
||||
$soap->no_dispatch(1);
|
||||
and re-enabled by calling
|
||||
$soap->no_dispatch(0);
|
||||
- Updated test skripts to reflect API change.
|
||||
|
||||
Revision 1.13 2004/06/30 12:08:40 lsc
|
||||
- added IServiceInstance (ecmed) to acceptance tests
|
||||
- refined documentation
|
||||
|
||||
Revision 1.12 2004/06/26 14:13:29 lsc
|
||||
- refined file caching
|
||||
- added descriptive output to test scripts
|
||||
|
||||
Revision 1.11 2004/06/26 07:55:40 lsc
|
||||
- fixed "freeze" caching bug
|
||||
- improved test scripts to test file system caching (and show the difference)
|
||||
|
||||
Revision 1.10 2004/06/26 06:30:33 lsc
|
||||
- added filesystem caching using Cache::FileCache
|
||||
|
||||
Revision 1.9 2004/06/24 12:27:23 lsc
|
||||
Cleanup
|
||||
|
||||
Revision 1.8 2004/06/11 19:49:15 lsc
|
||||
- moved .t files to more self-describing names
|
||||
- changed WSDL.pm to accept AXIS wsdl files
|
||||
- implemented XPath query result caching on all absolute queries
|
||||
|
||||
Revision 1.7 2004/06/07 13:01:16 lsc
|
||||
added changelog to pod
|
||||
$Log: CHANGES,v $
|
||||
|
||||
Revision 1.19 2004/07/27 13:00:03 lsc
|
||||
- added missing test file
|
||||
|
||||
Revision 1.18 2004/07/16 07:43:05 lsc
|
||||
fixed test scripts for windows
|
||||
|
||||
Revision 1.17 2004/07/05 08:19:49 lsc
|
||||
- added wsdl_checkoccurs
|
||||
|
||||
Revision 1.16 2004/07/04 09:01:14 lsc
|
||||
- change <definitions> element lookup from find('/definitions') and find('wsdl:definitions') to find('/*[1]') to process arbitrary default (wsdl) namespaces correctly
|
||||
- fixed test output in test 06
|
||||
|
||||
Revision 1.15 2004/07/02 12:28:31 lsc
|
||||
- documentation update
|
||||
- cosmetics
|
||||
|
||||
Revision 1.14 2004/07/02 10:53:36 lsc
|
||||
- API change:
|
||||
- call now behaves (almost) like SOAP::Lite::call
|
||||
- call() takes a list (hash) as second argument
|
||||
- call does no longer support the "dispatch" option
|
||||
- dispatching calls can be suppressed by passing
|
||||
"no_dispatch => 1" to new()
|
||||
- dispatching calls can be suppressed by calling
|
||||
$soap->no_dispatch(1);
|
||||
and re-enabled by calling
|
||||
$soap->no_dispatch(0);
|
||||
- Updated test skripts to reflect API change.
|
||||
|
||||
Revision 1.13 2004/06/30 12:08:40 lsc
|
||||
- added IServiceInstance (ecmed) to acceptance tests
|
||||
- refined documentation
|
||||
|
||||
Revision 1.12 2004/06/26 14:13:29 lsc
|
||||
- refined file caching
|
||||
- added descriptive output to test scripts
|
||||
|
||||
Revision 1.11 2004/06/26 07:55:40 lsc
|
||||
- fixed "freeze" caching bug
|
||||
- improved test scripts to test file system caching (and show the difference)
|
||||
|
||||
Revision 1.10 2004/06/26 06:30:33 lsc
|
||||
- added filesystem caching using Cache::FileCache
|
||||
|
||||
Revision 1.9 2004/06/24 12:27:23 lsc
|
||||
Cleanup
|
||||
|
||||
Revision 1.8 2004/06/11 19:49:15 lsc
|
||||
- moved .t files to more self-describing names
|
||||
- changed WSDL.pm to accept AXIS wsdl files
|
||||
- implemented XPath query result caching on all absolute queries
|
||||
|
||||
Revision 1.7 2004/06/07 13:01:16 lsc
|
||||
added changelog to pod
|
||||
|
||||
2
HACKING
2
HACKING
@@ -17,6 +17,8 @@ The (my) current roadmap for SOAP::WSDL is:
|
||||
|
||||
1.3: Bindings support
|
||||
|
||||
Development of the 1.* tree has stopped - I won't get past 1.2x anymore...
|
||||
|
||||
2.*: WSDL -> Perl Class factory with offline WSDL processing
|
||||
|
||||
May 2007,
|
||||
|
||||
7
LICENSE
Normal file
7
LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
SOAP::WSDL is dual licensed under the same terms as
|
||||
Perl itself.
|
||||
|
||||
This means at your choice, either the Perl Artistic License, or
|
||||
the GNU GPL version 1 or higher.
|
||||
|
||||
|
||||
119
MANIFEST
119
MANIFEST
@@ -1,16 +1,103 @@
|
||||
Build.PL
|
||||
CHANGES
|
||||
HACKING
|
||||
lib/SOAP/WSDL.pm
|
||||
MANIFEST This list of files
|
||||
META.yml
|
||||
README
|
||||
t/1_performance.t
|
||||
t/2_helloworld.NET.t
|
||||
t/3_various.t
|
||||
t/4_auto_set_port.t
|
||||
t/97_pod.t
|
||||
t/98_pod_coverage.t
|
||||
t/acceptance/helloworld.asmx.xml
|
||||
t/acceptance/helloworld.xml
|
||||
t/acceptance/test.wsdl.xml
|
||||
Build.PL
|
||||
CHANGES
|
||||
HACKING
|
||||
lib/SOAP/WSDL.pm
|
||||
lib/SOAP/WSDL/Base.pm
|
||||
lib/SOAP/WSDL/Binding.pm
|
||||
lib/SOAP/WSDL/Client.pm
|
||||
lib/SOAP/WSDL/Client/Base.pm
|
||||
lib/SOAP/WSDL/Definitions.pm
|
||||
lib/SOAP/WSDL/Envelope.pm
|
||||
lib/SOAP/WSDL/Message.pm
|
||||
lib/SOAP/WSDL/Operation.pm
|
||||
lib/SOAP/WSDL/OpMessage.pm
|
||||
lib/SOAP/WSDL/Part.pm
|
||||
lib/SOAP/WSDL/Port.pm
|
||||
lib/SOAP/WSDL/PortType.pm
|
||||
lib/SOAP/WSDL/SAX/MessageHandler.pm
|
||||
lib/SOAP/WSDL/SAX/WSDLHandler.pm
|
||||
lib/SOAP/WSDL/Service.pm
|
||||
lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm
|
||||
lib/SOAP/WSDL/SoapOperation.pm
|
||||
lib/SOAP/WSDL/TypeLookup.pm
|
||||
lib/SOAP/WSDL/Types.pm
|
||||
lib/SOAP/WSDL/XSD/ComplexType.pm
|
||||
lib/SOAP/WSDL/XSD/Element.pm
|
||||
lib/SOAP/WSDL/XSD/Primitive.pm
|
||||
lib/SOAP/WSDL/XSD/Schema.pm
|
||||
lib/SOAP/WSDL/XSD/Schema/Builtin.pm
|
||||
lib/SOAP/WSDL/XSD/SimpleType.pm
|
||||
lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
|
||||
lib/SOAP/WSDL/XSD/Typelib/Element.pm
|
||||
lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm
|
||||
LICENSE
|
||||
MANIFEST
|
||||
META.yml
|
||||
README
|
||||
t/001_use.t
|
||||
t/002_sax.t
|
||||
t/003_sax_serializer.t
|
||||
t/004_sax_wsdl.t
|
||||
t/005_sax_contributed_wsdl.t
|
||||
t/006_client.t
|
||||
t/007_envelope.t
|
||||
t/008_client_wsdl_complexType.t
|
||||
t/009_data_classes.t
|
||||
t/011_simpleType.t
|
||||
t/012_element.t
|
||||
t/013_complexType.t
|
||||
t/014_sax_typelib.t
|
||||
t/015_to_typemap.t
|
||||
t/016_client_object.t
|
||||
t/acceptance/results/03_complexType-all.xml
|
||||
t/acceptance/results/03_complexType-sequence.xml
|
||||
t/acceptance/results/04_element-simpleType.xml
|
||||
t/acceptance/results/04_element.xml
|
||||
t/acceptance/results/05_simpleType-list.xml
|
||||
t/acceptance/results/05_simpleType-restriction.xml
|
||||
t/acceptance/results/05_simpleType-union.xml
|
||||
t/acceptance/results/11_helloworld.xml
|
||||
t/acceptance/wsdl/006_sax_client.wsdl
|
||||
t/acceptance/wsdl/008_complexType.wsdl
|
||||
t/acceptance/wsdl/02_port.wsdl
|
||||
t/acceptance/wsdl/03_complexType-all.wsdl
|
||||
t/acceptance/wsdl/03_complexType-sequence.wsdl
|
||||
t/acceptance/wsdl/04_element-simpleType.wsdl
|
||||
t/acceptance/wsdl/04_element.wsdl
|
||||
t/acceptance/wsdl/05_simpleType-list.wsdl
|
||||
t/acceptance/wsdl/05_simpleType-restriction.wsdl
|
||||
t/acceptance/wsdl/05_simpleType-union.wsdl
|
||||
t/acceptance/wsdl/10_helloworld.asmx.xml
|
||||
t/acceptance/wsdl/11_helloworld.wsdl
|
||||
t/acceptance/wsdl/contributed/Axis.wsdl
|
||||
t/acceptance/wsdl/contributed/ETest.wsdl
|
||||
t/acceptance/wsdl/contributed/OITest.wsdl
|
||||
t/acceptance/wsdl/contributed/tools.wsdl
|
||||
t/acceptance/wsdl/email_account.wsdl
|
||||
t/attic/01_use.t
|
||||
t/attic/02_port.t
|
||||
t/attic/03_complexType-all.t
|
||||
t/attic/03_complexType-choice.t
|
||||
t/attic/03_complexType-complexContent.t
|
||||
t/attic/03_complexType-group.t
|
||||
t/attic/03_complexType-sequence.t
|
||||
t/attic/03_complexType-simpleContent.t
|
||||
t/attic/04_element-complexType.t
|
||||
t/attic/04_element-simpleType.t
|
||||
t/attic/04_element.t
|
||||
t/attic/05_simpleType-list.t
|
||||
t/attic/05_simpleType-restriction.t
|
||||
t/attic/05_simpleType-union.t
|
||||
t/attic/10_performance.t
|
||||
t/attic/11_helloworld.NET.t
|
||||
t/attic/12_binding.pl
|
||||
t/attic/97_pod.t
|
||||
t/attic/98_pod_coverage.t
|
||||
t/lib/MyComplexType.pm
|
||||
t/lib/MyElement.pm
|
||||
t/lib/MySimpleType.pm
|
||||
t/lib/Test/SOAPMessage.pm
|
||||
t/lib/Typelib/Base.pm
|
||||
t/lib/Typelib/TEnqueueMessage.pm
|
||||
t/lib/Typelib/TMessage.pm
|
||||
|
||||
163
META.yml
163
META.yml
@@ -1,11 +1,15 @@
|
||||
---
|
||||
name: SOAP-WSDL
|
||||
version: 1.23
|
||||
version: 2.00_01
|
||||
author:
|
||||
abstract: WSDL support for SOAP::Lite
|
||||
- "Replace the whitespace in the e-mail adresses by '@'."
|
||||
abstract: SOAP with WSDL support
|
||||
license: artistic
|
||||
requires:
|
||||
SOAP::Lite: 0
|
||||
XML::LibXML: 0
|
||||
XML::SAX::Base: 0
|
||||
XML::SAX::ParserFactory: 0
|
||||
XML::XPath: 0
|
||||
generated_by: Module::Build version 0.2808
|
||||
meta-spec:
|
||||
@@ -14,6 +18,159 @@ meta-spec:
|
||||
provides:
|
||||
SOAP::WSDL:
|
||||
file: lib/SOAP/WSDL.pm
|
||||
version: 1.23
|
||||
version: 1.21
|
||||
SOAP::WSDL::Base:
|
||||
file: lib/SOAP/WSDL/Base.pm
|
||||
SOAP::WSDL::Binding:
|
||||
file: lib/SOAP/WSDL/Binding.pm
|
||||
SOAP::WSDL::Client:
|
||||
file: lib/SOAP/WSDL/Client.pm
|
||||
SOAP::WSDL::Client::Base:
|
||||
file: lib/SOAP/WSDL/Client/Base.pm
|
||||
version: 0.1
|
||||
SOAP::WSDL::Definitions:
|
||||
file: lib/SOAP/WSDL/Definitions.pm
|
||||
SOAP::WSDL::Envelope:
|
||||
file: lib/SOAP/WSDL/Envelope.pm
|
||||
SOAP::WSDL::Message:
|
||||
file: lib/SOAP/WSDL/Message.pm
|
||||
SOAP::WSDL::OpMessage:
|
||||
file: lib/SOAP/WSDL/OpMessage.pm
|
||||
SOAP::WSDL::Operation:
|
||||
file: lib/SOAP/WSDL/Operation.pm
|
||||
SOAP::WSDL::Part:
|
||||
file: lib/SOAP/WSDL/Part.pm
|
||||
SOAP::WSDL::Port:
|
||||
file: lib/SOAP/WSDL/Port.pm
|
||||
SOAP::WSDL::PortType:
|
||||
file: lib/SOAP/WSDL/PortType.pm
|
||||
SOAP::WSDL::SAX::MessageHandler:
|
||||
file: lib/SOAP/WSDL/SAX/MessageHandler.pm
|
||||
SOAP::WSDL::SAX::WSDLHandler:
|
||||
file: lib/SOAP/WSDL/SAX/WSDLHandler.pm
|
||||
SOAP::WSDL::SOAP::Typelib::Fault11:
|
||||
file: lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm
|
||||
SOAP::WSDL::Service:
|
||||
file: lib/SOAP/WSDL/Service.pm
|
||||
SOAP::WSDL::SoapOperation:
|
||||
file: lib/SOAP/WSDL/SoapOperation.pm
|
||||
SOAP::WSDL::TypeLookup:
|
||||
file: lib/SOAP/WSDL/TypeLookup.pm
|
||||
SOAP::WSDL::Types:
|
||||
file: lib/SOAP/WSDL/Types.pm
|
||||
SOAP::WSDL::XSD::ComplexType:
|
||||
file: lib/SOAP/WSDL/XSD/ComplexType.pm
|
||||
SOAP::WSDL::XSD::Element:
|
||||
file: lib/SOAP/WSDL/XSD/Element.pm
|
||||
SOAP::WSDL::XSD::Primitive:
|
||||
file: lib/SOAP/WSDL/XSD/Primitive.pm
|
||||
SOAP::WSDL::XSD::Schema:
|
||||
file: lib/SOAP/WSDL/XSD/Schema.pm
|
||||
SOAP::WSDL::XSD::Schema::Builtin:
|
||||
file: lib/SOAP/WSDL/XSD/Schema/Builtin.pm
|
||||
SOAP::WSDL::XSD::SimpleType:
|
||||
file: lib/SOAP/WSDL/XSD/SimpleType.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::ENTITY:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::ID:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::IDREF:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::IDREFS:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::NCName:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::NOTATION:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::Name:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::anyType:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::anyURI:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::base64Binary:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::boolean:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::byte:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::date:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::dateTime:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::decimal:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::double:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::duration:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::float:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::gDay:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::gMonth:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::gYear:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::hex64Binary:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::int:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::integer:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::language:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::long:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::normalizedString:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::qName:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::short:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::string:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::time:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::token:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
|
||||
SOAP::WSDL::XSD::Typelib::Element:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/Element.pm
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType::restriction:
|
||||
file: lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm
|
||||
resources:
|
||||
license: http://opensource.org/licenses/artistic-license.php
|
||||
|
||||
35
README
35
README
@@ -1,31 +1,4 @@
|
||||
SOAP::WSDL - a WSDL-driven message preprocessor for SOAP::Lite.
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
See "perldoc SOAP::WSDL" (or "perldoc WSDL.pm") for details.
|
||||
|
||||
|
||||
PREREQUISITES
|
||||
|
||||
SOAP::WSDL requires the following perl modules:
|
||||
|
||||
- SOAP::Lite
|
||||
- XML::XPath
|
||||
|
||||
|
||||
If you want to use file system caching (improves performance), you also
|
||||
need the following packages:
|
||||
|
||||
- Cache::Cache
|
||||
|
||||
INSTALLING
|
||||
|
||||
perl Build.PL
|
||||
perl Build
|
||||
perl Build test
|
||||
perl Build install
|
||||
|
||||
LICENSE
|
||||
|
||||
This library is free software, you can distribute/modify it under the same
|
||||
terms as perl itself.
|
||||
This is a developer release - everything may (and most things will) change.
|
||||
|
||||
You should not expect the SOAP::WSDL to survive - it will probably be replaced
|
||||
by SOAP::WSDL::Client.
|
||||
3133
lib/SOAP/WSDL.pm
3133
lib/SOAP/WSDL.pm
File diff suppressed because it is too large
Load Diff
105
lib/SOAP/WSDL/Base.pm
Normal file
105
lib/SOAP/WSDL/Base.pm
Normal file
@@ -0,0 +1,105 @@
|
||||
package SOAP::WSDL::Base;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use Class::Std::Storable;
|
||||
|
||||
my %id_of :ATTR(:name<id> :default<()>);
|
||||
my %name_of :ATTR(:name<name> :default<()>);
|
||||
my %targetNamespace_of :ATTR(:name<targetNamespace> :default<()>);
|
||||
my %xmlns_of :ATTR(:name<xmlns> :default<{}>);
|
||||
|
||||
sub STORABLE_freeze_pre :CUMULATIVE {};
|
||||
sub STORABLE_freeze_post :CUMULATIVE {};
|
||||
sub STORABLE_thaw_pre :CUMULATIVE {};
|
||||
sub STORABLE_thaw_post :CUMULATIVE { return $_[0] };
|
||||
|
||||
# unfortunately, AUTOMETHOD is SLOW.
|
||||
# Re-implement in derived package wherever speed is an issue...
|
||||
#
|
||||
sub AUTOMETHOD {
|
||||
my ($self, $ident, @values) = @_;
|
||||
my $subname = $_; # Requested subroutine name is passed via $_
|
||||
|
||||
# we're called as $self->push_something(@values);
|
||||
if ($subname =~s{^push_}{}xms) {
|
||||
# we're not paranoid - we could be checking get_subname, too
|
||||
my $getter = "get_$subname";
|
||||
my $setter = "set_$subname";
|
||||
croak "no set accessor found for push_$subname"
|
||||
if not ($self->can( $setter ));
|
||||
return sub {
|
||||
no strict qw(refs);
|
||||
my $old_value = $self->$getter();
|
||||
# Listify if not a list ref
|
||||
$old_value = $old_value ? [ $old_value ] : [] if not ref $old_value;
|
||||
|
||||
push @$old_value , @values;
|
||||
$self->$setter( $old_value );
|
||||
};
|
||||
}
|
||||
|
||||
# we're called as $obj->find_something($ns, $key)
|
||||
elsif ($subname =~s {^find_}{get_}xms) {
|
||||
return sub {
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $values[0] &&
|
||||
$_->get_name() eq $values[1]
|
||||
}
|
||||
@{ $self->$subname() };
|
||||
return $found_at[0];
|
||||
}
|
||||
}
|
||||
elsif ($subname =~s {^first_}{get_}xms) {
|
||||
return sub {
|
||||
my $result_ref = $self->$subname();
|
||||
return if not $result_ref;
|
||||
return $result_ref if (not ref $result_ref eq 'ARRAY');
|
||||
return $result_ref->[0];
|
||||
};
|
||||
}
|
||||
croak "$subname not found in class " . (ref $self || $self);
|
||||
}
|
||||
|
||||
#sub to_string :STRINGIFY {
|
||||
# $_[0]->_DUMP();
|
||||
#}
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
foreach my $value (@args)
|
||||
{
|
||||
die $value if (not defined ($value->{ Name }));
|
||||
if ($value->{ Name } =~m{^xmlns\:}xms) {
|
||||
die $xmlns_of{ ident $self }
|
||||
if ref $xmlns_of{ ident $self } ne 'HASH';
|
||||
$xmlns_of{ ident $self }->{ $value->{ Value } } =
|
||||
$value->{ LocalName };
|
||||
next;
|
||||
}
|
||||
elsif ($value->{ Name } =~m{^xmlns$}xms) {
|
||||
# just ignore xmlns = for now
|
||||
# TODO handle xmlns correctly - maybe via setting a prefix ?
|
||||
next;
|
||||
}
|
||||
my $name = $value->{ LocalName };
|
||||
my $method = "set_$name";
|
||||
$self->$method( $value->{ Value } ) if ( $method );
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub add_namespace {
|
||||
my ($self, $uri, $prefix ) = @_;
|
||||
return unless $uri;
|
||||
$self->{ namespace } ||= {};
|
||||
$self->{ namespace }->{ $uri } = $prefix;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
warn "to_typemap";
|
||||
return q{};
|
||||
}
|
||||
|
||||
1;
|
||||
130
lib/SOAP/WSDL/Binding.pm
Normal file
130
lib/SOAP/WSDL/Binding.pm
Normal file
@@ -0,0 +1,130 @@
|
||||
package SOAP::WSDL::Binding;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
my %transport_of :ATTR(:name<transport> :default<()>);
|
||||
my %style_of :ATTR(:name<style> :default<()>);
|
||||
|
||||
sub explain {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $name = $self->get_name();
|
||||
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
|
||||
my ($prefix, $localname) = split /:/ , $self->get_type();
|
||||
my $portType = $opt->{ wsdl }->find_portType(
|
||||
$ns_map{ $prefix }, $localname
|
||||
) or die "portType $prefix:$localname not found !";
|
||||
|
||||
|
||||
my $txt = <<"EOT";
|
||||
|
||||
=head2 Binding name: $name
|
||||
|
||||
=over
|
||||
|
||||
=item * Style $style_of{ ident $self }
|
||||
|
||||
=item * Transport $transport_of{ ident $self }
|
||||
|
||||
=back
|
||||
|
||||
=head3 Operations
|
||||
|
||||
EOT
|
||||
|
||||
foreach my $operation (@{ $self->get_operation() })
|
||||
{
|
||||
my $operation_name = $operation->get_name();
|
||||
my $operation_style = $operation->get_style() || q{};
|
||||
|
||||
my $port_operation = $portType->find_operation( $ns_map{ $prefix },
|
||||
$operation->get_name() )
|
||||
or die "operation not found:" . $operation->get_name();
|
||||
|
||||
# TODO rename lexical $input to "message"
|
||||
my $input_message = do {
|
||||
my $input = $port_operation->first_input();
|
||||
$input ? $input->explain($opt) : q{};
|
||||
};
|
||||
my $output_message = do {
|
||||
my $input = $port_operation->first_output();
|
||||
$input ? $input->explain($opt) : q{};
|
||||
};
|
||||
my $fault_message = do {
|
||||
my $input = $port_operation->first_fault();
|
||||
$input ? $input->explain($opt) : q{};
|
||||
};
|
||||
|
||||
$txt .= <<"EOT";
|
||||
=over
|
||||
|
||||
=item * $operation_name
|
||||
|
||||
=over 8
|
||||
|
||||
=item * Style: $operation_style
|
||||
|
||||
=item * Input Message:
|
||||
|
||||
$input_message
|
||||
|
||||
=item * Output Message:
|
||||
|
||||
$output_message
|
||||
|
||||
=item * Fault:
|
||||
|
||||
$fault_message
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
EOT
|
||||
}
|
||||
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
my ($self, $opt) = @_;
|
||||
my $name = $self->get_name();
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
my ($prefix, $localname) = split /:/ , $self->get_type();
|
||||
my $portType = $opt->{ wsdl }->find_portType(
|
||||
$ns_map{ $prefix }, $localname
|
||||
) or die "portType $prefix:$localname not found !";
|
||||
my $txt = q{};
|
||||
foreach my $operation (@{ $self->get_operation() })
|
||||
{
|
||||
my $operation_name = $operation->get_name();
|
||||
my $operation_style = $operation->get_style() || q{};
|
||||
|
||||
my $port_operation = $portType->find_operation( $ns_map{ $prefix },
|
||||
$operation->get_name() )
|
||||
or die "operation not found:" . $operation->get_name();
|
||||
|
||||
# TODO rename lexical $input to "message"
|
||||
$txt .= do {
|
||||
my $input = $port_operation->first_input();
|
||||
$input ? $input->to_typemap($opt) : q{};
|
||||
};
|
||||
$txt .= do {
|
||||
my $input = $port_operation->first_output();
|
||||
$input ? $input->to_typemap($opt) : q{};
|
||||
};
|
||||
$txt .= do {
|
||||
my $input = $port_operation->first_fault();
|
||||
$input ? $input->to_typemap($opt) : q{};
|
||||
};
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
1;
|
||||
446
lib/SOAP/WSDL/Client.pm
Normal file
446
lib/SOAP/WSDL/Client.pm
Normal file
@@ -0,0 +1,446 @@
|
||||
package SOAP::WSDL::Client;
|
||||
use strict;
|
||||
use warnings;
|
||||
use vars qw/$AUTOLOAD/;
|
||||
use Scalar::Util qw(blessed);
|
||||
use SOAP::WSDL::Envelope;
|
||||
use SOAP::WSDL::SAX::WSDLHandler;
|
||||
|
||||
BEGIN {
|
||||
eval {
|
||||
use XML::LibXML;
|
||||
};
|
||||
if ($@) {
|
||||
use XML::SAX::ParserFactory;
|
||||
}
|
||||
}
|
||||
|
||||
use base qw/SOAP::Lite/;
|
||||
|
||||
sub outputtree {
|
||||
my $self = shift;
|
||||
return $self->{ _WSDL }->{ outputtree } if not @_;
|
||||
return $self->{ _WSDL }->{ outputtree } = shift;
|
||||
}
|
||||
|
||||
sub class_resolver {
|
||||
my $self = shift;
|
||||
return $self->{ _WSDL }->{ class_resolver } if not @_;
|
||||
return $self->{ _WSDL }->{ class_resolver } = shift;
|
||||
}
|
||||
|
||||
sub wsdlinit
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
my $wsdl_xml = SOAP::Schema->new( schema_url => $self->wsdl() )->access(
|
||||
$self->wsdl()
|
||||
);
|
||||
|
||||
my $filter;
|
||||
my $parser = eval { XML::LibXML->new() };
|
||||
if ($parser) {
|
||||
$filter = SOAP::WSDL::SAX::WSDLHandler->new();
|
||||
$parser->set_handler( $filter );
|
||||
}
|
||||
else {
|
||||
$filter = SOAP::WSDL::SAX::WSDLHandler->new( base => 'XML::SAX::Base' );
|
||||
$parser = XML::SAX::ParserFactory->parser( Handler => $filter );
|
||||
}
|
||||
|
||||
$parser->parse_string( $wsdl_xml );
|
||||
|
||||
my $wsdl_definitions = $filter->get_data()
|
||||
or die "unable to parse WSDL";
|
||||
|
||||
my $types = $wsdl_definitions->first_types()
|
||||
or die "unable to extract schema from WSDL";
|
||||
|
||||
my $ns = $wsdl_definitions->get_xmlns()
|
||||
or die "unable to extract XML Namespaces" . $wsdl_definitions->to_string;
|
||||
( %{ $ns } ) or die "unable to extract XML Namespaces";
|
||||
|
||||
# setup lookup variables
|
||||
$self->{ _WSDL }->{ wsdl_definitions } = $wsdl_definitions;
|
||||
$self->{ _WSDL }->{ serialize_options } = {
|
||||
autotype => 0,
|
||||
readable => 1,
|
||||
typelib => $types,
|
||||
namespace => $ns,
|
||||
};
|
||||
$self->{ _WSDL }->{ explain_options } = {
|
||||
readable => 1,
|
||||
wsdl => $wsdl_definitions,
|
||||
namespace => $ns,
|
||||
typelib => $types,
|
||||
};
|
||||
|
||||
return $self;
|
||||
} ## end sub wsdlinit
|
||||
|
||||
sub _wsdl_get_service
|
||||
{
|
||||
my $self = shift;
|
||||
my $service;
|
||||
my $wsdl = $self->{ _WSDL }->{ wsdl_definitions };
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
if ( $self->{ _WSDL }->{ servicename } )
|
||||
{
|
||||
$service =
|
||||
$wsdl->find_service( $ns, $self->{ _WSDL }->{ servicename } );
|
||||
}
|
||||
else
|
||||
{
|
||||
$service = $wsdl->get_service()->[ 0 ];
|
||||
warn "no servicename specified - using " . $service->get_name();
|
||||
}
|
||||
return $self->{ _WSDL }->{ service } = $service;
|
||||
} ## end sub _wsdl_get_service
|
||||
|
||||
sub _wsdl_get_port
|
||||
{
|
||||
my $self = shift;
|
||||
my $service = $self->{ _WSDL }->{ service }
|
||||
|| $self->_wsdl_get_service();
|
||||
my $wsdl = $self->{ _WSDL }->{ wsdl_definitions };
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
my $port;
|
||||
if ( $self->{ _WSDL }->{ portname } )
|
||||
{
|
||||
$port = $service->get_port( $ns, $self->{ _WSDL }->{ portname } );
|
||||
}
|
||||
else
|
||||
{
|
||||
$port = $service->get_port()->[ 0 ];
|
||||
}
|
||||
$self->{ _WSDL }->{ port } = $port;
|
||||
|
||||
# preload portType
|
||||
$self->_wsdl_get_portType();
|
||||
|
||||
# Auto-set proxy - required before issuing call()
|
||||
$self->proxy( $port->get_location() );
|
||||
|
||||
return $port;
|
||||
} ## end sub _wsdl_get_port
|
||||
|
||||
sub _wsdl_get_binding
|
||||
{
|
||||
my $self = shift;
|
||||
my $wsdl = $self->{ _WSDL }->{ wsdl_definitions };
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
my $port = $self->{ _WSDL }->{ port }
|
||||
|| $self->_wsdl_get_port();
|
||||
|
||||
my ( $prefix, $localname ) = split /:/, $port->get_binding();
|
||||
|
||||
# TODO lookup $ns instead of just using
|
||||
# the top element's targetns...
|
||||
my $binding = $wsdl->find_binding( $ns, $localname )
|
||||
or die "no binding found for ", $port->get_binding();
|
||||
return $self->{ _WSDL }->{ binding } = $binding;
|
||||
} ## end sub _wsdl_get_binding
|
||||
|
||||
sub _wsdl_get_portType
|
||||
{
|
||||
my $self = shift;
|
||||
my $wsdl = $self->{ _WSDL }->{ wsdl_definitions };
|
||||
my $binding = $self->{ _WSDL }->{ binding }
|
||||
|| $self->_wsdl_get_binding();
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
my ( $prefix, $localname ) = split /:/, $binding->get_type();
|
||||
my $portType = $wsdl->find_portType( $ns, $localname );
|
||||
$self->{ _WSDL }->{ portType } = $portType;
|
||||
return $portType;
|
||||
} ## end sub _wsdl_get_portType
|
||||
|
||||
=pod
|
||||
|
||||
=head2 _wsdl_init_methods
|
||||
|
||||
=over
|
||||
|
||||
=item DESCRIPTION
|
||||
|
||||
Creates a lookup table containing the information required for all methods
|
||||
specified for the service/port selected.
|
||||
|
||||
The lookup table is used by L<call|call>.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub _wsdl_init_methods {
|
||||
my $self = shift;
|
||||
my $wsdl = $self->{ _WSDL }->{ wsdl_definitions };
|
||||
my $ns = $wsdl->get_targetNamespace();
|
||||
|
||||
# get bindings, portType, message, part(s)
|
||||
# - use cached values where possible for speed,
|
||||
# private methods if not for clear separation...
|
||||
my $binding = $self->{ _WSDL }->{ binding }
|
||||
|| $self->_wsdl_get_binding();
|
||||
my $portType = $self->{ _WSDL }->{ portType }
|
||||
|| $self->_wsdl_get_portType();
|
||||
|
||||
my $methodHashRef = {};
|
||||
|
||||
foreach my $binding_operation (@{ $binding->get_operation() })
|
||||
{
|
||||
my $method = {};
|
||||
|
||||
# get SOAP Action
|
||||
# SOAP-Action is a required HTTP Header, so we need to look it up...
|
||||
my $soap_binding_operation = $binding_operation->get_operation()->[0];
|
||||
$method->{ soap_action } = $soap_binding_operation ?
|
||||
$soap_binding_operation->get_soapAction() : $method;
|
||||
|
||||
# get parts
|
||||
# 1. get operation from port
|
||||
my $operation = $portType->find_operation( $ns,
|
||||
$binding_operation->get_name() );
|
||||
# 2. get input message name
|
||||
my ( $prefix, $localname ) = split /:/,
|
||||
$operation->get_input()->[0]->get_message();
|
||||
# 3. get input message
|
||||
my $message = $wsdl->find_message( $ns, $localname );
|
||||
$method->{ parts } = $message->get_part();
|
||||
|
||||
# rpc / encoded methods may have a namespace specified.
|
||||
# look it up and set it...
|
||||
$method->{ namespace } = $binding_operation ?
|
||||
$binding_operation->get_input()->[0]->get_namespace() : undef;
|
||||
|
||||
$methodHashRef->{ $binding_operation->get_name() } = $method;
|
||||
}
|
||||
|
||||
$self->{ _WSDL }->{ methodInfo } = $methodHashRef;
|
||||
|
||||
return $methodHashRef;
|
||||
}
|
||||
|
||||
sub call {
|
||||
my $self = shift;
|
||||
my $method = shift;
|
||||
my $data = ref $_[0] ? $_[0] : { @_ };
|
||||
|
||||
my $content = q{};
|
||||
my $envelope;
|
||||
my $methodInfo;
|
||||
|
||||
if (blessed $data
|
||||
&& $data->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'))
|
||||
{
|
||||
$envelope = SOAP::WSDL::Envelope->serialize( $method, $data );
|
||||
|
||||
# TODO replace by something derived from binding - this is just a
|
||||
# workaround...
|
||||
$methodInfo->{ soap_action }
|
||||
= join '/', $data->get_xmlns(), $method;
|
||||
|
||||
}
|
||||
else {
|
||||
my $methodLookup = $self->{ _WSDL }->{ methodInfo }
|
||||
|| $self->_wsdl_init_methods();
|
||||
|
||||
$methodInfo = $methodLookup->{ $method };
|
||||
my $partListRef = $methodInfo->{ parts };
|
||||
|
||||
# set serializer options
|
||||
# TODO allow custom options here
|
||||
my $opt = $self->{ _WSDL }->{ serialize_options };
|
||||
|
||||
# set response target namespace
|
||||
# TODO make rpc-encoded encoding recognise this namespace
|
||||
# $opt->{ targetNamespace } = $soap_binding_operation ?
|
||||
# $operation->input()->namespace() : undef;
|
||||
|
||||
# serialize content
|
||||
# TODO create surrounding element for rpc-encoded messages
|
||||
foreach my $part ( @{ $partListRef } )
|
||||
{
|
||||
$content .= $part->serialize( $method, $data, $opt );
|
||||
}
|
||||
$envelope = SOAP::WSDL::Envelope->serialize(
|
||||
$method, $content , $opt );
|
||||
};
|
||||
|
||||
|
||||
if ( $self->no_dispatch() )
|
||||
{
|
||||
return $envelope;
|
||||
} ## end if ( $self->no_dispatch...
|
||||
|
||||
# get response via transport layer
|
||||
# TODO remove dependency from SOAP::Lite and use a
|
||||
# SAX-based filter using XML::LibXML to get the
|
||||
# result.
|
||||
# Filter should have the following methods:
|
||||
# - result: returns the result of the call (like SOAP::Lite, but as
|
||||
# perl data structure)
|
||||
# - header: returns the content of the SOAP header
|
||||
# - fault: returns the result of the call if a SOAP fault is sent back
|
||||
# by the server. Retuns undef (nothing) if the call has been
|
||||
# processed without errors.
|
||||
my $response = $self->transport->send_receive(
|
||||
context => $self, # this is provided for context
|
||||
endpoint => $self->endpoint(),
|
||||
action => $methodInfo->{ soap_action }, # SOAPAction from binding
|
||||
envelope => $envelope, # use custom content
|
||||
);
|
||||
|
||||
return $response if ($self->outputxml() );
|
||||
|
||||
if ($self->outputtree()) {
|
||||
|
||||
my ($parser, $handler); # replace by globals - singleton is faster
|
||||
if (not $parser) {
|
||||
require SOAP::WSDL::SOAP::Typelib::Fault11;
|
||||
require SOAP::WSDL::SAX::MessageHandler;
|
||||
require XML::LibXML;
|
||||
$handler = SOAP::WSDL::SAX::MessageHandler->new(
|
||||
{ class_resolver => $self->class_resolver() },
|
||||
);
|
||||
$parser = XML::LibXML->new();
|
||||
$parser->set_handler( $handler);
|
||||
}
|
||||
|
||||
# if we had no success (Transport layer error status code)
|
||||
# or if transport layer failed
|
||||
if (! $self->transport->is_success() ) {
|
||||
# Try deserializing response - there may be some
|
||||
if ($response) {
|
||||
eval { $parser->parse_string( $response ) };
|
||||
return $handler->get_data if not $@;
|
||||
};
|
||||
|
||||
# generate & return fault if we cannot serialize response
|
||||
# or have none...
|
||||
return SOAP::WSDL::SOAP::Typelib::Fault11->new({
|
||||
faultcode => 'soap:Server',
|
||||
faultactor => 'urn:localhost',
|
||||
faultstring => 'Error sending / receiving message: '
|
||||
. $self->transport->message()
|
||||
});
|
||||
}
|
||||
|
||||
eval { $parser->parse_string( $response ) };
|
||||
|
||||
# return fault if we cannot deserialize response
|
||||
if ($@) {
|
||||
return SOAP::WSDL::SOAP::Typelib::Fault11->new({
|
||||
faultcode => 'soap:Server',
|
||||
faultactor => 'urn:localhost',
|
||||
faultstring => "Error deserializing message: $@. \n"
|
||||
. "Message was: \n$response"
|
||||
});
|
||||
}
|
||||
|
||||
return $handler->get_data();
|
||||
}
|
||||
|
||||
# deserialize and store result
|
||||
my $result = $self->{ '_call' } =
|
||||
eval { $self->deserializer->deserialize( $response ) }
|
||||
if $response;
|
||||
|
||||
if (
|
||||
!$self->transport->is_success || # transport fault
|
||||
$@ || # not deserializible
|
||||
# fault message even if transport OK
|
||||
# or no transport error (for example, fo TCP, POP3, IO implementations)
|
||||
UNIVERSAL::isa( $result => 'SOAP::SOM' ) && $result->fault
|
||||
)
|
||||
{
|
||||
return $self->{ '_call' } = (
|
||||
$self->on_fault->(
|
||||
$self, $@ ? $@ . ( $response || '' ) : $result
|
||||
)
|
||||
|| $result
|
||||
);
|
||||
# ? # trick editors
|
||||
} ## end if ( !$self->transport...
|
||||
|
||||
return unless $response; # nothing to do for one-ways
|
||||
return $result;
|
||||
} ## end sub call
|
||||
|
||||
sub explain
|
||||
{
|
||||
my $self = shift;
|
||||
my $opt = $self->{ _WSDL }->{ explain_options };
|
||||
|
||||
return $self->{ _WSDL }->{ wsdl_definitions }->explain( $opt );
|
||||
} ## end sub explain
|
||||
|
||||
sub _load_method
|
||||
{
|
||||
my $method = shift;
|
||||
no strict "refs";
|
||||
*$method = sub {
|
||||
my $self = shift;
|
||||
return ( @_ ) ? $self->{ _WSDL }->{ $method } = shift
|
||||
: $self->{ _WSDL }->{ $method }
|
||||
};
|
||||
} ## end sub _load_method
|
||||
|
||||
&_load_method( 'no_dispatch' );
|
||||
&_load_method( 'wsdl' );
|
||||
|
||||
sub servicename
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{ _WSDL }->{ servicename } if ( not @_ );
|
||||
$self->{ _WSDL }->{ servicename } = shift;
|
||||
|
||||
my $ns = $self->{ _WSDL }->{ wsdl_definitions }->get_targetNamespace();
|
||||
|
||||
$self->{ _WSDL }->{ service } =
|
||||
$self->{ _WSDL }->{ wsdl_definitions }
|
||||
->find_service( $ns, $self->{ _WSDL }->{ servicename } )
|
||||
or die "No such service: " . $self->{ _WSDL }->{ servicename };
|
||||
} ## end sub servicename
|
||||
|
||||
sub portname
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{ _WSDL }->{ portname } if ( not @_ );
|
||||
$self->{ _WSDL }->{ portname } = shift;
|
||||
|
||||
my $ns = $self->{ _WSDL }->{ wsdl_definitions }->targetNamespace();
|
||||
|
||||
$self->{ _WSDL }->{ port } =
|
||||
$self->{ _WSDL }->{ service }
|
||||
->get_port( $ns, $self->{ _WSDL }->{ portname } )
|
||||
or die "No such port: " . $self->{ _WSDL }->{ portname };
|
||||
} ## end sub portname
|
||||
|
||||
=pod
|
||||
|
||||
=head1 Auto-Dispatching
|
||||
|
||||
SOAP::WSDL::Client does B<does not> support auto-dispatching.
|
||||
|
||||
This is on purpose: You may easily create interface classes by using
|
||||
SOAP::WSDL::Client and implementing something like
|
||||
|
||||
sub mySoapMethod {
|
||||
my $self = shift;
|
||||
$soap_wsdl_client->call( mySoapMethod, @_);
|
||||
}
|
||||
|
||||
You may even do this in a class factory - SOAP::WSDL provides the methods
|
||||
for generating such interfaces.
|
||||
|
||||
SOAP::Lite's autodispatching mechanism is - though convenient - a constant
|
||||
source of errors: Every typo in a method name gets caught by AUTOLOAD and
|
||||
may lead to unpredictable results.
|
||||
|
||||
=cut
|
||||
|
||||
sub AUTOLOAD
|
||||
{
|
||||
my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
|
||||
die "$method not found";
|
||||
}
|
||||
127
lib/SOAP/WSDL/Client/Base.pm
Normal file
127
lib/SOAP/WSDL/Client/Base.pm
Normal file
@@ -0,0 +1,127 @@
|
||||
#!/usr/bin/perl -w
|
||||
package SOAP::WSDL::Client::Base;
|
||||
|
||||
##################################################################################
|
||||
## <OWNER>Internetteam
|
||||
## <AUTHOR>Martin Kutter <martin.kutter@siemens.com>
|
||||
## <CREATIONDATE>25.10.2006
|
||||
##
|
||||
## <FUNCTION>Base client for WSDL-based SOAP access
|
||||
## Automatisch gefüllt:
|
||||
## <CVSPROJECT>$HeadURL:$
|
||||
## <REVISION>$Revision:$
|
||||
################################################################################
|
||||
|
||||
use strict;
|
||||
use Log::Log4perl;
|
||||
|
||||
use Class::Accessor;
|
||||
|
||||
use base qw/Class::Accessor/;
|
||||
|
||||
$SOAP::WSDL::Client::Base::VERSION = sprintf("0.%d", q$LastChangedRevision: 1$ =~/(\d+)/ );
|
||||
|
||||
__PACKAGE__->mk_accessors(
|
||||
qw//
|
||||
);
|
||||
|
||||
my $log = undef; # Global logger to speed up performance
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SOAP::WSDL::Client::Base - Base client for WSDL-based SOAP access
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use SOAP::WSDL::Client::Base;
|
||||
|
||||
# TODO Add more Synopsis information
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
# TODO Add Description
|
||||
|
||||
=cut
|
||||
|
||||
=pod
|
||||
|
||||
=head2 new
|
||||
|
||||
=over
|
||||
|
||||
=item SYNOPSIS
|
||||
|
||||
my $obj = ->new();
|
||||
|
||||
=item DESCRIPTION
|
||||
|
||||
Constructor.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub new
|
||||
{
|
||||
my $proto = shift;
|
||||
my $class = ref $proto || $proto;
|
||||
my $self = {
|
||||
soapBindingStyle => 'rpc',
|
||||
};
|
||||
bless $self, $class;
|
||||
$self->init(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub soapBindingStyle
|
||||
{
|
||||
my $self = shift;
|
||||
my $style = shift;
|
||||
if ($style)
|
||||
{
|
||||
die "Binding style must be one of rpc|document"
|
||||
if (not( $style=~m/^(rpc|document)$/));
|
||||
$self->{ soapBindingStyle } = $style;
|
||||
}
|
||||
return $self->{ soapBindingStyle };
|
||||
}
|
||||
|
||||
sub init
|
||||
{
|
||||
}
|
||||
|
||||
sub call
|
||||
{
|
||||
my $self = shift;
|
||||
my $method = shift;
|
||||
my $data = shift;
|
||||
my $content;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Martin Kutter <martin.kutter@siemens.com>
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
Copyright (c) 2005 SIEMENS AG. All rights reserved.
|
||||
|
||||
=head1 Repository information
|
||||
|
||||
$ID: $
|
||||
|
||||
$LastChangedDate: $
|
||||
$LastChangedRevision: $
|
||||
$LastChangedBy: $
|
||||
|
||||
$HeadURL: $
|
||||
|
||||
=cut
|
||||
62
lib/SOAP/WSDL/Definitions.pm
Normal file
62
lib/SOAP/WSDL/Definitions.pm
Normal file
@@ -0,0 +1,62 @@
|
||||
package SOAP::WSDL::Definitions;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %types_of :ATTR(:name<types> :default<[]>);
|
||||
my %message_of :ATTR(:name<message> :default<()>);
|
||||
my %portType_of :ATTR(:name<portType> :default<()>);
|
||||
my %binding_of :ATTR(:name<binding> :default<()>);
|
||||
my %service_of :ATTR(:name<service> :default<()>);
|
||||
|
||||
my %namespace_of :ATTR(:name<namespace> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
binding => \%binding_of,
|
||||
message => \%message_of,
|
||||
portType => \%portType_of,
|
||||
service => \%service_of,
|
||||
);
|
||||
|
||||
# Function factory - we could be writing this method for all %attribute
|
||||
# keys, too, but that's just C&P (eehm, Copy & Paste...)
|
||||
foreach my $method(keys %attributes_of ) {
|
||||
no strict qw/refs/;
|
||||
|
||||
# ... btw, we mean this method here...
|
||||
*{ "find_$method" } = sub {
|
||||
my ($self, @args) = @_;
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $args[0] &&
|
||||
$_->get_name() eq $args[1]
|
||||
}
|
||||
@{ $attributes_of{ $method }->{ ident $self } };
|
||||
return $found_at[0];
|
||||
};
|
||||
}
|
||||
|
||||
sub explain {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $txt = '';
|
||||
foreach my $service (@{ $self->get_service() })
|
||||
{
|
||||
$txt .= $service->explain( $opt );
|
||||
$txt .= "\n";
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
$opt->{ wsdl } ||= $self;
|
||||
$opt->{ prefix } ||= q{};
|
||||
return join "\n",
|
||||
map { $_->to_typemap( $opt ) } @{ $service_of{ ident $self } };
|
||||
}
|
||||
|
||||
1;
|
||||
66
lib/SOAP/WSDL/Envelope.pm
Normal file
66
lib/SOAP/WSDL/Envelope.pm
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/perl -w
|
||||
package SOAP::WSDL::Envelope;
|
||||
use strict;
|
||||
use base qw/SOAP::WSDL::Base/;
|
||||
|
||||
my $SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/';
|
||||
my $XML_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-instance';
|
||||
|
||||
sub serialize {
|
||||
my ($self, $name, $data, $opt) = @_;
|
||||
|
||||
if (not $opt->{ namespace }->{ $SOAP_NS })
|
||||
{
|
||||
$opt->{ namespace }->{ $SOAP_NS } = 'SOAP-ENV';
|
||||
}
|
||||
|
||||
if (not $opt->{ namespace }->{ $XML_INSTANCE_NS })
|
||||
{
|
||||
$opt->{ namespace }->{ $XML_INSTANCE_NS } = 'xsi';
|
||||
}
|
||||
|
||||
my $soap_prefix = $opt->{ namespace }->{ $SOAP_NS };
|
||||
|
||||
# envelope start with namespaces
|
||||
my $xml = "<$soap_prefix\:Envelope ";
|
||||
|
||||
while (my ($uri, $prefix) = each %{ $opt->{ namespace } })
|
||||
{
|
||||
$xml .= "\n\t" if ($opt->{'readable'});
|
||||
$xml .= "xmlns:$prefix=\"$uri\" ";
|
||||
}
|
||||
|
||||
# TODO insert encoding
|
||||
$xml.='>';
|
||||
$xml .= $self->serialize_header($name, $data, $opt);
|
||||
$xml .= $self->serialize_body($name, $data, $opt);
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
$xml .= '</' . $soap_prefix .':Envelope>';
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub serialize_header {
|
||||
my $xml = '';
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub serialize_body {
|
||||
my $self = shift;
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
my $opt = shift;
|
||||
|
||||
my $soap_prefix = $opt->{ namespace }->{ $SOAP_NS };
|
||||
|
||||
my $xml = '';
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
$xml .= "<$soap_prefix\:Body>";
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
|
||||
# include parts
|
||||
$xml .= $data if ( defined($data) );
|
||||
|
||||
$xml .= "</$soap_prefix\:Body>";
|
||||
return $xml;
|
||||
}
|
||||
9
lib/SOAP/WSDL/Message.pm
Normal file
9
lib/SOAP/WSDL/Message.pm
Normal file
@@ -0,0 +1,9 @@
|
||||
package SOAP::WSDL::Message;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %part_of :ATTR(:name<part> :default<[]>);
|
||||
|
||||
1;
|
||||
67
lib/SOAP/WSDL/OpMessage.pm
Normal file
67
lib/SOAP/WSDL/OpMessage.pm
Normal file
@@ -0,0 +1,67 @@
|
||||
package SOAP::WSDL::OpMessage;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %body_of :ATTR(:name<body> :default<()>);
|
||||
my %message_of :ATTR(:name<message> :default<()>);
|
||||
my %use_of :ATTR(:name<use> :default<()>);
|
||||
my %namespace :ATTR(:name<namespace> :default<()>);
|
||||
my %encodingStyle_of :ATTR(:name<encodingStyle> :default<()>);
|
||||
|
||||
sub explain
|
||||
{
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $name = shift;
|
||||
my $txt = '';
|
||||
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
|
||||
if ( $self->get_message() ) {
|
||||
|
||||
my ($prefix, $localname) = split /:/ , $self->get_message();
|
||||
|
||||
# TODO allow more messages && overloading by specifying name
|
||||
my $message = $opt->{ wsdl }->get_message(
|
||||
$ns_map{ $prefix }, $localname
|
||||
);
|
||||
|
||||
for my $part(@{ $message->[0]->get_part() }) {
|
||||
$opt->{ indent } .= "\t";
|
||||
$txt .= $part->explain($opt);
|
||||
$opt->{ indent } =~s/\t//;
|
||||
$txt .= $opt->{ indent } . "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($self->use())
|
||||
{
|
||||
$txt .= $opt->{ indent } . "$name use: " . $self->use(). "\n";
|
||||
}
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
|
||||
my ($self, $opt) = @_;
|
||||
my $txt = q{};
|
||||
return q{} if not ( $self->get_message() ); # we're in binding
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
my ($prefix, $localname) = split /:/ , $self->get_message();
|
||||
|
||||
# TODO allow more messages && overloading by specifying name
|
||||
my $message = $opt->{ wsdl }->find_message(
|
||||
$ns_map{ $prefix }, $localname
|
||||
);
|
||||
|
||||
for my $part(@{ $message->get_part() }) {
|
||||
$txt .= $part->to_typemap($opt);
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
1;
|
||||
18
lib/SOAP/WSDL/Operation.pm
Normal file
18
lib/SOAP/WSDL/Operation.pm
Normal file
@@ -0,0 +1,18 @@
|
||||
package SOAP::WSDL::Operation;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw/SOAP::WSDL::Base/;
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
my %input_of :ATTR(:name<input> :default<()>);
|
||||
my %output_of :ATTR(:name<output> :default<()>);
|
||||
my %fault_of :ATTR(:name<fault> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
my %style_of :ATTR(:name<style> :default<()>);
|
||||
my %transport_of :ATTR(:name<transport> :default<()>);
|
||||
my %parameterOrder_of :ATTR(:name<parameterOrder> :default<()>);
|
||||
|
||||
1;
|
||||
|
||||
|
||||
98
lib/SOAP/WSDL/Part.pm
Normal file
98
lib/SOAP/WSDL/Part.pm
Normal file
@@ -0,0 +1,98 @@
|
||||
package SOAP::WSDL::Part;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %element_of :ATTR(:name<element> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
|
||||
sub serialize
|
||||
{
|
||||
my $self = shift;
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
my $opt = shift;
|
||||
my $typelib = $opt->{ typelib } || die "No typelib";
|
||||
my %ns_map = reverse %{ $opt->{ namespace } };
|
||||
|
||||
my $item_name;
|
||||
if ($item_name = $self->get_type() )
|
||||
{
|
||||
# resolve type
|
||||
my ($prefix, $localname) = split /:/ , $item_name, 2;
|
||||
my $type = $typelib->find_type(
|
||||
$ns_map{ $prefix },
|
||||
$localname
|
||||
);
|
||||
return $type->serialize( $self->get_name(), $data, $opt );
|
||||
}
|
||||
elsif ( $item_name = $self->get_element() )
|
||||
{
|
||||
my ($prefix, $localname) = split /:/ , $item_name, 2;
|
||||
my $element = $typelib->find_element(
|
||||
$ns_map{ $prefix },
|
||||
$localname
|
||||
);
|
||||
return $element->serialize( undef, $data, $opt );
|
||||
}
|
||||
die "Neither type nor element - don't know what to do";
|
||||
}
|
||||
|
||||
sub explain {
|
||||
my ($self, $opt, $name ) = @_;
|
||||
my $typelib = $opt->{ wsdl }->first_types()
|
||||
|| die "No typelib";
|
||||
|
||||
my %ns_map = reverse %{ $opt->{ namespace } };
|
||||
my $element = $self->get_type() || $self->get_element();
|
||||
|
||||
# resolve type
|
||||
my ($prefix, $localname) = split /:/ , $element;
|
||||
my $type = $typelib->find_type(
|
||||
$ns_map{ $prefix },
|
||||
$localname
|
||||
)
|
||||
|| $typelib->find_element(
|
||||
$ns_map{ $prefix },
|
||||
$localname
|
||||
);
|
||||
|
||||
if (not $type)
|
||||
{
|
||||
warn "no type/element $element ({ $ns_map{ $prefix } }$localname) found for part " . $self->get_name();
|
||||
return q{};
|
||||
}
|
||||
return $type->explain( $opt, $self->get_name() );
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
my ($self, $opt, $name ) = @_;
|
||||
my $txt = q{};
|
||||
my $typelib = $opt->{ wsdl }->first_types()
|
||||
|| die "No typelib";
|
||||
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
my $element = $self->get_type() || $self->get_element();
|
||||
|
||||
# resolve type
|
||||
my ($prefix, $localname) = split /:/ , $element;
|
||||
my $type;
|
||||
if ($type = $typelib->find_type( $ns_map{ $prefix }, $localname ) ) {
|
||||
$txt .= "'/' => " . $type->get_name() . "\n";
|
||||
}
|
||||
else {
|
||||
$type = $typelib->find_element( $ns_map{ $prefix }, $localname );
|
||||
}
|
||||
|
||||
if (not $type) {
|
||||
warn "no type/element $element ({ $ns_map{ $prefix } }$localname) found for part " . $self->get_name();
|
||||
return q{};
|
||||
}
|
||||
$opt->{ path } = [];
|
||||
$txt .= $type->to_typemap( $opt, $self->get_name() );
|
||||
return $txt;
|
||||
}
|
||||
|
||||
1;
|
||||
46
lib/SOAP/WSDL/Port.pm
Normal file
46
lib/SOAP/WSDL/Port.pm
Normal file
@@ -0,0 +1,46 @@
|
||||
package SOAP::WSDL::Port;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %binding_of :ATTR(:name<binding> :default<()>);
|
||||
my %location_of :ATTR(:name<location> :default<()>);
|
||||
|
||||
sub explain {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $txt =
|
||||
"=head2 Port name: " . $self->get_name() . "\n\n"
|
||||
. "=over\n\n"
|
||||
. "=item * Binding: " . $self->get_binding() ."\n\n"
|
||||
. "=item * Location: " . $self->get_location() ."\n\n"
|
||||
. "=back\n\n";
|
||||
# if ( $self->location() );
|
||||
|
||||
my %ns_map = reverse %{ $opt->{ namespace } };
|
||||
|
||||
my ($prefix, $localname) = split /:/ , $self->get_binding();
|
||||
my $binding = $opt->{ wsdl }->find_binding(
|
||||
$ns_map{ $prefix }, $localname
|
||||
) or die "binding $prefix:$localname not found !";
|
||||
|
||||
$txt .= $binding->explain($opt);
|
||||
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
|
||||
my ($prefix, $localname) = split /:/ , $self->get_binding();
|
||||
my $binding = $opt->{ wsdl }->find_binding(
|
||||
$ns_map{ $prefix }, $localname
|
||||
) or die "binding $prefix:$localname not found !";
|
||||
|
||||
return $binding->to_typemap($opt);
|
||||
}
|
||||
1;
|
||||
32
lib/SOAP/WSDL/PortType.pm
Normal file
32
lib/SOAP/WSDL/PortType.pm
Normal file
@@ -0,0 +1,32 @@
|
||||
package SOAP::WSDL::PortType;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %operation_of :ATTR(:name<operation> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
operation => \%operation_of,
|
||||
);
|
||||
|
||||
# Function factory - we could be writing this method for all %attribute
|
||||
# keys, too, but that's just C&P (eehm, Copy & Paste...)
|
||||
foreach my $method(keys %attributes_of ) {
|
||||
no strict qw/refs/;
|
||||
|
||||
# ... btw, we mean this method here...
|
||||
*{ "find_$method" } = sub {
|
||||
my ($self, @args) = @_;
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $args[0] &&
|
||||
$_->get_name() eq $args[1]
|
||||
}
|
||||
@{ $attributes_of{ $method }->{ ident $self } };
|
||||
return $found_at[0];
|
||||
};
|
||||
}
|
||||
|
||||
1;
|
||||
373
lib/SOAP/WSDL/SAX/MessageHandler.pm
Normal file
373
lib/SOAP/WSDL/SAX/MessageHandler.pm
Normal file
@@ -0,0 +1,373 @@
|
||||
#!/usr/bin/perl
|
||||
package SOAP::WSDL::SAX::MessageHandler;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Scalar::Util qw(blessed);
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
|
||||
my %characters_of :ATTR(:default<()>);
|
||||
my %class_resolver_of :ATTR(:default<()> :init_attr<class_resolver>);
|
||||
my %current_of :ATTR(:default<()>);
|
||||
my %ignore_of :ATTR(:default<()>);
|
||||
my %list_of :ATTR(:default<()>);
|
||||
my %namespace_of :ATTR(:default<()>);
|
||||
my %path_of :ATTR(:default<()>);
|
||||
my %data_of :ATTR(:default<()>);
|
||||
|
||||
{
|
||||
# we have to implement our own new - we need a blessed Hash ref as $self
|
||||
# for being able to inherit from XML::SAX::Base...
|
||||
no warnings qw(redefine);
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {}; # $class->SUPER::new(@_);
|
||||
my $args = shift || {};
|
||||
|
||||
die "arguments to new must be single hash ref"
|
||||
if @_ or ! ref $args eq 'HASH';
|
||||
|
||||
# nasty, but for those who want to use XML::SAX::Base or similar
|
||||
# as parser factory
|
||||
if ($args->{base}) {
|
||||
# yup, naughty string eval
|
||||
eval "use base qw($args->{base})"; ## no critic qw(ProhibitStringyEval)
|
||||
}
|
||||
else {
|
||||
# create all those SAX methods...
|
||||
# ...we ignore em all...
|
||||
no strict qw(refs);
|
||||
foreach my $method ( qw(
|
||||
processing_instruction
|
||||
ignorable_whitespace
|
||||
set_document_locator
|
||||
start_prefix_mapping
|
||||
end_prefix_mapping
|
||||
skipped_entity
|
||||
start_cdata
|
||||
end_cdata
|
||||
comment
|
||||
entity_reference
|
||||
notation_decl
|
||||
unparsed_entity_decl
|
||||
element_decl
|
||||
attlist_decl
|
||||
doctype_decl
|
||||
xml_decl
|
||||
entity_decl
|
||||
attribute_decl
|
||||
internal_entity_decl
|
||||
external_entity_decl
|
||||
resolve_entity
|
||||
start_dtd
|
||||
end_dtd
|
||||
start_entity
|
||||
end_entity
|
||||
warning
|
||||
) ) {
|
||||
*{ "$method" } = sub {};
|
||||
}
|
||||
}
|
||||
|
||||
$class_resolver_of{ ident $self } = $args->{ class_resolver }
|
||||
or die "cannot parse message without type resolver";
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
}
|
||||
|
||||
sub start_document {
|
||||
my $ident = ident $_[0];
|
||||
$list_of{ $ident } = [];
|
||||
$current_of{ $ident } = '__STOP__'; # use as marker
|
||||
$namespace_of{ $ident } = {};
|
||||
$ignore_of{ $ident } = [ qw(Envelope Body) ]; # SOAP elements
|
||||
$path_of{ $ident } = [];
|
||||
$data_of{ $ident } = undef;
|
||||
}
|
||||
|
||||
sub start_element {
|
||||
# use $_[n] for performance
|
||||
my ($ident, $element) = (ident $_[0], $_[1]);
|
||||
my $local_name = $element->{ LocalName };
|
||||
|
||||
# ignore top level elements
|
||||
if (@{ $ignore_of{ $ident } }
|
||||
&& $local_name eq $ignore_of{ $ident }->[0]) {
|
||||
shift @{ $ignore_of{ $ident } };
|
||||
return;
|
||||
}
|
||||
|
||||
# empty characters
|
||||
$characters_of{ $ident } = q{};
|
||||
|
||||
push @{ $path_of{ $ident } }, $local_name; # step down...
|
||||
push @{ $list_of{ $ident } }, $current_of{ $ident }; # remember current
|
||||
|
||||
# resolve class of this element
|
||||
my $class = $class_resolver_of{ $ident }->get_class( $path_of{ $ident } )
|
||||
or die "Cannot resolve class for "
|
||||
. join('/', @{ $path_of{ $ident } })
|
||||
. " via "
|
||||
. $class_resolver_of{ $ident };
|
||||
|
||||
|
||||
# Check whether we have a primitive - we implement them as classes
|
||||
# TODO replace with UNIVERSAL->isa() or maybe index - could be faster
|
||||
# than m//
|
||||
# TODO
|
||||
if (not $class=~m{^SOAP::WSDL::XSD::Typelib::Builtin}xms) {
|
||||
eval "require $class"; ## no critic qw(ProhibitStringyEval)
|
||||
die $@ if $@;
|
||||
}
|
||||
# create object
|
||||
my $obj = $class->new({
|
||||
map { $_->{ Name } => $_->{ Value } }
|
||||
values %{ $element->{ Attributes } }
|
||||
});
|
||||
|
||||
# set current object
|
||||
$current_of{ $ident } = $obj;
|
||||
|
||||
# remember top level element
|
||||
$data_of{ $ident } = $obj if not defined $data_of{ $ident };
|
||||
}
|
||||
|
||||
sub characters {
|
||||
$characters_of{ ident $_[0] } .= $_[1]->{ Data };
|
||||
}
|
||||
|
||||
sub end_element {
|
||||
# $_[n] used for performance
|
||||
my ($ident, $element) = (ident $_[0], $_[1]);
|
||||
|
||||
# This one easily handles ignores for us, too...
|
||||
return if $list_of{ $ident }->[-1] eq '__STOP__';
|
||||
if ( $current_of{ $ident }
|
||||
->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType') ) {
|
||||
$current_of{ $ident }->set_value( $characters_of{ $ident } );
|
||||
}
|
||||
|
||||
# set appropriate attribute in last element
|
||||
# multiple values must be implemented in base class
|
||||
my $method = "add_$element->{ LocalName }";
|
||||
|
||||
$list_of{ $ident }->[-1]->$method( $current_of{ $ident } );
|
||||
|
||||
# step up in path
|
||||
pop @{ $path_of{ $ident } };
|
||||
|
||||
# step up in object hierarchy...
|
||||
$current_of{ $ident } = pop @{ $list_of{ $ident } };
|
||||
}
|
||||
|
||||
sub end_document {
|
||||
my $self = shift;
|
||||
my $ident = ident $self;
|
||||
|
||||
# destroy all remains except data_of
|
||||
$list_of{ $ident } = ();
|
||||
$namespace_of{ $ident } = ();
|
||||
$ignore_of{ $ident } = ();
|
||||
$path_of{ $ident } = ();
|
||||
$characters_of{ $ident } = ();
|
||||
}
|
||||
|
||||
sub get_data {
|
||||
my $self = shift;
|
||||
return $data_of{ ident $self };
|
||||
}
|
||||
|
||||
sub fatal_error {
|
||||
my $self = shift;
|
||||
die "Fatal error parsing document: " , @_;
|
||||
}
|
||||
|
||||
sub error {
|
||||
my $self = shift;
|
||||
die "Error parsing document: " , @_;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SOAP::WSDL::SAX::MessageHandler - Convert SOAP messages to custom object trees
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# this is the direct variant, recommended for performance
|
||||
use SOAP::WSDL::SAX::MessageHandler;
|
||||
use XML::LibXML;
|
||||
|
||||
my $filter = SOAP::WSDL::SAX::MessageHandler->new( {
|
||||
class_resolver => FakeResolver->new()
|
||||
), "Object creation");
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
$parser->parse_string( $soap_message );
|
||||
|
||||
my $object_tree = $filter->get_data();
|
||||
|
||||
|
||||
# This is the XML::ParserFactory variant - for those who want other
|
||||
# parsers than XML::Simple....
|
||||
use SOAP::WSDL::SAX::MessageHandler;
|
||||
use XML::SAX::ParserFactory;
|
||||
|
||||
my $filter = SOAP::WSDL::SAX::MessageHandler->new( {
|
||||
class_resolver => FakeResolver->new(),
|
||||
base => 'XML::SAX::Base',
|
||||
), "Object creation");
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
$parser->parse_string( $soap_message );
|
||||
|
||||
my $object_tree = $filter->get_data();
|
||||
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Parses a SOAP message into an object tree.
|
||||
|
||||
For every element in the SOAP message, an object is created. The class
|
||||
of the object is determined via a Resolver object which has to be passed
|
||||
to new via the class_resolver parameter.
|
||||
|
||||
=head1 Writing a class resolver
|
||||
|
||||
The class resolver must returned a method "get_class", which is passed a list
|
||||
ref of the current element's XPath (relative to Body), split by /.
|
||||
|
||||
This method must return a class name appropriate for a XML element.
|
||||
|
||||
A class resolver package might look like this:
|
||||
|
||||
package FakeResolver;
|
||||
|
||||
my %class_list = (
|
||||
'EnqueueMessage' => 'Typelib::TEnqueueMessage',
|
||||
'EnqueueMessage/MMessage' => 'Typelib::TMessage',
|
||||
'EnqueueMessage/MMessage/MRecipientURI' => 'SOAP::WSDL::XSD::Builtin::anyURI',
|
||||
'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Builtin::string',
|
||||
);
|
||||
|
||||
sub new { return bless {}, 'FakeResolver' };
|
||||
|
||||
sub get_class {
|
||||
my $name = join('/', @{ $_[1] });
|
||||
return ($class_list{ $name }) ? $class_list{ $name }
|
||||
: warn "no class found for $name";
|
||||
};
|
||||
1;
|
||||
|
||||
=head1 Writing type library classes
|
||||
|
||||
Every element must have a correspondent one in the type library.
|
||||
|
||||
Type library classes must provide the following methods:
|
||||
|
||||
Builtin types should be resolved as SOAP::WSDL::XSD::Builtin::* classes
|
||||
|
||||
=over
|
||||
|
||||
=item * new
|
||||
|
||||
Constructor
|
||||
|
||||
=item * add_FOO
|
||||
|
||||
The add_FOO method is called for every child element of the XML node.
|
||||
|
||||
Characters are regarded as child element of the last XML node.
|
||||
|
||||
=back
|
||||
|
||||
A tyelib class implemented as Inside-Out object using Class::Std::Storable
|
||||
as base class would look like this:
|
||||
|
||||
package Typelib::TEnqueueMessage;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
|
||||
my %MMessage_of :ATTR(:name<MMessage> :default<()>);
|
||||
|
||||
sub add_MMessage {
|
||||
my ($self, $value) = @_;
|
||||
my $ident = ident $self;
|
||||
|
||||
# we're the first value
|
||||
return $MMessage_of{ $ident } = $value
|
||||
if not defined $MMessage_of{ $ident };
|
||||
|
||||
# we're the second value
|
||||
return $MMessage_of{ $ident } = [
|
||||
$MMessage_of{ $ident }, $value ]
|
||||
if not ref $MMessage_of{ $ident } eq 'ARRAY';
|
||||
|
||||
# we're third or later
|
||||
push @{ $MMessage_of{ $ident } }, $value;
|
||||
return $MMessage_of{ $ident };
|
||||
}
|
||||
}
|
||||
1;
|
||||
|
||||
Of course one could use a method factory for these add_FOO methods - see
|
||||
t/lib/Typelib/Base.pm for an example.
|
||||
|
||||
=head1 Performance
|
||||
|
||||
SOAP::WSDL::SAX::MessageHandler with a raw XML::LibXML parser almost reaches
|
||||
the performance of XML::Simple with XML::Parser (and expat) as low-level
|
||||
parser.
|
||||
|
||||
And SOAP::WSDL::SAX::MessageHandler builds up a object tree, while
|
||||
XML::Simple just emits hash data structures:
|
||||
|
||||
SOAP::WSDL::SAX::MessageHandler:
|
||||
1 wallclock secs ( 1.39 usr + 0.00 sys = 1.39 CPU) @ 719.42/s (n=1000)
|
||||
|
||||
XML::Simple:
|
||||
2 wallclock secs ( 1.25 usr + 0.01 sys = 1.26 CPU) @ 790.51/s (n=1000)
|
||||
|
||||
If you know a faster way for parsing XML with a reasonable simple API than
|
||||
XML::LibXML, please let me know...
|
||||
|
||||
=head1 Bugs and Limitations
|
||||
|
||||
=over
|
||||
|
||||
=item * Ignores all namespaces
|
||||
|
||||
=item * Does not handle mixed content
|
||||
|
||||
=item * The SOAP header is ignored
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Replace the whitespace by @ for E-Mail Address.
|
||||
|
||||
Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
This module may be used under the same terms as perl itself.
|
||||
|
||||
=head1 Repository information
|
||||
|
||||
$ID: $
|
||||
|
||||
$LastChangedDate: $
|
||||
$LastChangedRevision: $
|
||||
$LastChangedBy: $
|
||||
|
||||
$HeadURL: $
|
||||
|
||||
167
lib/SOAP/WSDL/SAX/WSDLHandler.pm
Normal file
167
lib/SOAP/WSDL/SAX/WSDLHandler.pm
Normal file
@@ -0,0 +1,167 @@
|
||||
package SOAP::WSDL::SAX::WSDLHandler;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use Class::Std::Storable;
|
||||
# use base qw(XML::SAX::Base);
|
||||
use SOAP::WSDL::TypeLookup;
|
||||
|
||||
my %tree_of :ATTR(:name<tree> :default<{}>);
|
||||
my %order_of :ATTR(:name<order> :default<[]>);
|
||||
my %targetNamespace_of :ATTR(:name<targetNamespace> :default<()>);
|
||||
my %current_of :ATTR(:name<current> :default<()>);
|
||||
|
||||
{
|
||||
# we have to implement our own new - we need a blessed Hash ref as $self
|
||||
# for being able to inherit from XML::SAX::Base...
|
||||
no warnings qw(redefine);
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {}; # $class->SUPER::new(@_);
|
||||
my $args = shift || {};
|
||||
|
||||
die "arguments to new must be single hash ref"
|
||||
if @_ or ! ref $args eq 'HASH';
|
||||
|
||||
# nasty, but for those who want to use XML::SAX::Base or similar
|
||||
# as parser factory
|
||||
if ($args->{base}) {
|
||||
# yup, naughty string eval
|
||||
eval "use base qw($args->{base})"; ## no critic qw(ProhibitStringyEval)
|
||||
}
|
||||
else {
|
||||
# create all those SAX methods...
|
||||
# ...we ignore em all...
|
||||
no strict qw(refs);
|
||||
foreach my $method ( qw(
|
||||
characters
|
||||
processing_instruction
|
||||
ignorable_whitespace
|
||||
set_document_locator
|
||||
start_prefix_mapping
|
||||
end_prefix_mapping
|
||||
skipped_entity
|
||||
start_cdata
|
||||
end_cdata
|
||||
comment
|
||||
entity_reference
|
||||
notation_decl
|
||||
unparsed_entity_decl
|
||||
element_decl
|
||||
attlist_decl
|
||||
doctype_decl
|
||||
xml_decl
|
||||
entity_decl
|
||||
attribute_decl
|
||||
internal_entity_decl
|
||||
external_entity_decl
|
||||
resolve_entity
|
||||
start_dtd
|
||||
end_dtd
|
||||
start_entity
|
||||
end_entity
|
||||
warning
|
||||
error
|
||||
) ) {
|
||||
*{ "$method" } = sub {};
|
||||
}
|
||||
}
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
};
|
||||
|
||||
sub start_document {
|
||||
my ($self, $ident) = ($_[0], ident $_[0]);
|
||||
$tree_of{ $ident } = {};
|
||||
$order_of{ $ident } = [];
|
||||
$targetNamespace_of{ $ident } = undef;
|
||||
$current_of{ $ident } = undef;
|
||||
}
|
||||
|
||||
sub start_element {
|
||||
my ($self, $element) = @_;
|
||||
my $ident = ident $self;
|
||||
|
||||
my $action = SOAP::WSDL::TypeLookup->lookup(
|
||||
$element->{ NamespaceURI },
|
||||
$element->{ LocalName }
|
||||
);
|
||||
|
||||
if ($action)
|
||||
{
|
||||
if ($action->{ type } eq 'CLASS')
|
||||
{
|
||||
eval "require $action->{ class }";
|
||||
croak $@, $tree_of{ $ident } if ($@);
|
||||
|
||||
my $class = $action->{ class };
|
||||
my $obj = $class->new()->init(
|
||||
values %{ $element->{ Attributes } }
|
||||
);
|
||||
|
||||
# set element in parent
|
||||
if ($current_of{ $ident })
|
||||
{
|
||||
# inherit namespace, but don't override
|
||||
$obj->set_targetNamespace(
|
||||
$current_of{ $ident }->get_targetNamespace() )
|
||||
if not $obj->get_targetNamespace();
|
||||
|
||||
# push on name list
|
||||
my $method = "push_$element->{ LocalName }";
|
||||
no strict qw(refs);
|
||||
$current_of{ $ident }->$method( $obj );
|
||||
|
||||
# remember element for stepping back
|
||||
push @{ $order_of{ $ident } }, $current_of{ $ident };
|
||||
}
|
||||
else
|
||||
{
|
||||
$tree_of{ $ident } = $obj;
|
||||
}
|
||||
# set new element (step down)
|
||||
$current_of{ $ident } = $obj;
|
||||
}
|
||||
elsif ($action->{ type } eq 'PARENT')
|
||||
{
|
||||
$current_of{ $ident }->init( values %{ $element->{ Attributes } } );
|
||||
}
|
||||
elsif ($action->{ type } eq 'METHOD')
|
||||
{
|
||||
my $method = $action->{ method } || $element->{ LocalName };
|
||||
|
||||
no strict qw(refs);
|
||||
# call method with
|
||||
# - default value ($action->{ value } if defined,
|
||||
# dereferencing lists
|
||||
# - the values of the elements Attributes hash
|
||||
$current_of{ $ident }->$method( defined $action->{ value }
|
||||
? ref $action->{ value }
|
||||
? @{ $action->{ value } }
|
||||
: ($action->{ value })
|
||||
: values %{ $element->{ Attributes } } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub end_element {
|
||||
my ($self, $element) = @_;
|
||||
my $ident = ident $self;
|
||||
|
||||
my $action = SOAP::WSDL::TypeLookup->lookup(
|
||||
$element->{ NamespaceURI },
|
||||
$element->{ LocalName }
|
||||
) || {};
|
||||
|
||||
if ($action->{ type } && $action->{ type } eq 'CLASS' )
|
||||
{
|
||||
$current_of{ $ident } = pop @{ $order_of{ $ident } };
|
||||
}
|
||||
}
|
||||
|
||||
sub get_data {
|
||||
my $self = shift;
|
||||
return $tree_of{ ident $self };
|
||||
}
|
||||
1;
|
||||
47
lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm
Normal file
47
lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm
Normal file
@@ -0,0 +1,47 @@
|
||||
package SOAP::WSDL::SOAP::Typelib::Fault11;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use Data::Dumper;
|
||||
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType
|
||||
);
|
||||
|
||||
my %faultcode_of :ATTR(:get<faultcode>);
|
||||
my %faultstring_of :ATTR(:get<faultstring>);
|
||||
my %faultactor_of :ATTR(:get<faultactor>);
|
||||
my %detail_of :ATTR(:get<faultdetail>);
|
||||
|
||||
# always return false in boolean context - a fault is never true...
|
||||
sub as_bool :BOOLIFY { return; }
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw(faultcode faultstring faultactor faultdetail) ],
|
||||
{
|
||||
faultcode => \%faultcode_of,
|
||||
faultstring => \%faultstring_of,
|
||||
faultactor => \%faultactor_of,
|
||||
detail => \%detail_of,
|
||||
},
|
||||
{
|
||||
faultcode => 'SOAP::WSDL::XSD::Typelib::Builtin::qName',
|
||||
faultstring => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
faultactor => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||
detail => 'SOAP::WSDL::XSD::Typelib::Builtin::anyType',
|
||||
}
|
||||
);
|
||||
|
||||
sub get_xmlns { return 'http://schemas.xmlsoap.org/soap/envelope/' };
|
||||
|
||||
__PACKAGE__->__set_name('Fault');
|
||||
__PACKAGE__->__set_nillable();
|
||||
__PACKAGE__->__set_minOccurs();
|
||||
__PACKAGE__->__set_maxOccurs();
|
||||
__PACKAGE__->__set_ref('');
|
||||
|
||||
1;
|
||||
27
lib/SOAP/WSDL/Service.pm
Normal file
27
lib/SOAP/WSDL/Service.pm
Normal file
@@ -0,0 +1,27 @@
|
||||
package SOAP::WSDL::Service;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %port_of :ATTR(:name<port> :default<()>);
|
||||
|
||||
sub explain {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $txt ="=head1 Service name\n\n" . $self->get_name() . "\n\n";
|
||||
foreach my $port (@{ $self->get_port() } )
|
||||
{
|
||||
$txt .= $port->explain( $opt );
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
return join "\n",
|
||||
map { $_->to_typemap( $opt ) } @{ $port_of{ ident $self } };
|
||||
}
|
||||
|
||||
1;
|
||||
23
lib/SOAP/WSDL/SoapOperation.pm
Normal file
23
lib/SOAP/WSDL/SoapOperation.pm
Normal file
@@ -0,0 +1,23 @@
|
||||
package SOAP::WSDL::SoapOperation;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %input_of :ATTR(:name<input> :default<()>);
|
||||
my %output_of :ATTR(:name<output> :default<()>);
|
||||
my %fault_of :ATTR(:name<fault> :default<()>);
|
||||
my %style_of :ATTR(:name<style> :default<()>);
|
||||
my %soapAction_of :ATTR(:name<soapAction> :default<()>);
|
||||
|
||||
sub explain {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $txt = '';
|
||||
$opt->{ indent } ||= '';
|
||||
|
||||
$txt .= $opt->{ indent } . "soapAction: " . $self->soapAction() . "\n"
|
||||
if ( $self->soapAction() );
|
||||
|
||||
return $txt;
|
||||
}
|
||||
|
||||
1;
|
||||
152
lib/SOAP/WSDL/TypeLookup.pm
Normal file
152
lib/SOAP/WSDL/TypeLookup.pm
Normal file
@@ -0,0 +1,152 @@
|
||||
package SOAP::WSDL::TypeLookup;
|
||||
|
||||
my %TYPES = (
|
||||
# wsdl:
|
||||
'http://schemas.xmlsoap.org/wsdl/' => {
|
||||
binding => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Binding',
|
||||
},
|
||||
definitions => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Definitions',
|
||||
},
|
||||
portType => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::PortType',
|
||||
},
|
||||
types => {
|
||||
type => 'SKIP',
|
||||
},
|
||||
message => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Message',
|
||||
},
|
||||
part => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Part',
|
||||
},
|
||||
service => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Service',
|
||||
},
|
||||
port => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Port',
|
||||
},
|
||||
operation => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Operation',
|
||||
},
|
||||
input => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::OpMessage',
|
||||
},
|
||||
output => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::OpMessage',
|
||||
},
|
||||
fault => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::OpMessage',
|
||||
},
|
||||
types => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::Types',
|
||||
}
|
||||
},
|
||||
# soap:
|
||||
'http://schemas.xmlsoap.org/wsdl/soap/' => {
|
||||
operation => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::SoapOperation',
|
||||
},
|
||||
binding => {
|
||||
type => 'PARENT',
|
||||
},
|
||||
body => {
|
||||
type => 'PARENT',
|
||||
},
|
||||
address => {
|
||||
type => 'PARENT',
|
||||
}
|
||||
},
|
||||
'http://www.w3c.org/2001/XMLSchema' => {
|
||||
schema => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::XSD::Schema',
|
||||
},
|
||||
element => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::XSD::Element',
|
||||
},
|
||||
simpleType => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::XSD::SimpleType',
|
||||
},
|
||||
complexType => {
|
||||
type => 'CLASS',
|
||||
class => 'SOAP::WSDL::XSD::ComplexType',
|
||||
},
|
||||
simpleContent => {
|
||||
type => 'METHOD',
|
||||
method => 'set_contentModel',
|
||||
value => 'simpleContent'
|
||||
},
|
||||
complexContent => {
|
||||
type => 'METHOD',
|
||||
method => 'set_contentModel',
|
||||
value => 'complexContent'
|
||||
},
|
||||
restriction => {
|
||||
type => 'METHOD',
|
||||
method => 'set_restriction',
|
||||
},
|
||||
list => {
|
||||
type => 'METHOD',
|
||||
method => 'set_list',
|
||||
},
|
||||
union => {
|
||||
type => 'METHOD',
|
||||
method => 'set_union',
|
||||
},
|
||||
enumeration => {
|
||||
type => 'METHOD',
|
||||
method => 'push_enumeration',
|
||||
},
|
||||
group => {
|
||||
type => 'METHOD',
|
||||
method => 'set_flavor',
|
||||
value => 'all',
|
||||
},
|
||||
all => {
|
||||
type => 'METHOD',
|
||||
method => 'set_flavor',
|
||||
value => 'all',
|
||||
},
|
||||
choice => {
|
||||
type => 'METHOD',
|
||||
method => 'set_flavor',
|
||||
value => 'choice',
|
||||
},
|
||||
sequence => {
|
||||
type => 'METHOD',
|
||||
method => 'set_flavor',
|
||||
value => 'sequence',
|
||||
},
|
||||
|
||||
},
|
||||
);
|
||||
|
||||
# thei're equal (typo ?)
|
||||
$TYPES{ 'http://www.w3.org/2001/XMLSchema' } = $TYPES{
|
||||
'http://www.w3c.org/2001/XMLSchema'
|
||||
};
|
||||
|
||||
|
||||
sub lookup {
|
||||
my $self = shift;
|
||||
my $namespace = shift || 'http://schemas.xmlsoap.org/wsdl/';
|
||||
my $name = shift;
|
||||
return $TYPES{ $namespace }->{ $name };
|
||||
}
|
||||
37
lib/SOAP/WSDL/Types.pm
Normal file
37
lib/SOAP/WSDL/Types.pm
Normal file
@@ -0,0 +1,37 @@
|
||||
package SOAP::WSDL::Types;
|
||||
use strict;
|
||||
use warnings;
|
||||
use SOAP::WSDL::XSD::Schema::Builtin;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
|
||||
my %schema_of :ATTR(:name<schema> :default<[]>);
|
||||
|
||||
sub START {
|
||||
my ($self, $ident, $args_of) = @_;
|
||||
$self->push_schema( SOAP::WSDL::XSD::Schema::Builtin->new() );
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub find_type {
|
||||
my ($self, $ns, $name) = @_;
|
||||
|
||||
foreach my $schema (@{ $schema_of{ ident $self } }) {
|
||||
my $type = $schema->find_type($ns, $name);
|
||||
return $type if $type;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sub find_element {
|
||||
my ($self, $ns, $name) = @_;
|
||||
|
||||
foreach my $schema (@{ $schema_of{ ident $self } }) {
|
||||
my $type = $schema->find_element($ns, $name);
|
||||
return $type if $type;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
254
lib/SOAP/WSDL/XSD/ComplexType.pm
Normal file
254
lib/SOAP/WSDL/XSD/ComplexType.pm
Normal file
@@ -0,0 +1,254 @@
|
||||
package SOAP::WSDL::XSD::ComplexType;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use Class::Std::Storable;
|
||||
use Scalar::Util qw(blessed);
|
||||
use base qw/SOAP::WSDL::Base/;
|
||||
|
||||
my %annotation_of :ATTR(:name<annotation> :default<()>);
|
||||
my %element_of :ATTR(:name<element> :default<()>);
|
||||
my %flavor_of :ATTR(:name<flavor> :default<()>);
|
||||
my %base_of :ATTR(:name<base> :default<()>);
|
||||
my %itemType_of :ATTR(:name<itemType> :default<()>);
|
||||
my %enumeration_of :ATTR(:name<enumeration> :default<()>);
|
||||
my %abstract_of :ATTR(:name<abstract> :default<()>);
|
||||
# is set to simpleContent/complexContent
|
||||
my %content_Model_of :ATTR(:name<contentModel> :default<()>);
|
||||
|
||||
sub find_element {
|
||||
my ($self, @args) = @_;
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $args[0] &&
|
||||
$_->get_name() eq $args[1]
|
||||
}
|
||||
@{ $element_of{ ident $self } };
|
||||
return $found_at[0];
|
||||
}
|
||||
|
||||
sub push_element {
|
||||
my $self = shift;
|
||||
my $element = shift;
|
||||
if ($flavor_of{ ident $self } eq 'all')
|
||||
{
|
||||
$element->set_minOccurs(0) if not defined ($element->get_minOccurs);
|
||||
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
||||
}
|
||||
elsif ($flavor_of{ ident $self } eq 'sequence')
|
||||
{
|
||||
$element->set_minOccurs(1) if not defined ($element->get_minOccurs);
|
||||
$element->set_maxOccurs(1) if not defined ($element->get_maxOccurs);
|
||||
}
|
||||
push @{ $element_of{ ident $self } }, $element;
|
||||
}
|
||||
|
||||
sub set_restriction {
|
||||
my $self = shift;
|
||||
my $element = shift;
|
||||
$flavor_of{ ident $self } = 'restriction';
|
||||
$base_of{ ident $self } = $element->{ Value };
|
||||
}
|
||||
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
$self->SUPER::init( @args );
|
||||
}
|
||||
|
||||
sub serialize
|
||||
{
|
||||
my ($self, $name, $value, $opt) = @_;
|
||||
|
||||
$opt->{ indent } ||= q{};
|
||||
my $flavor = $self->get_flavor();
|
||||
my $xml = '';
|
||||
|
||||
$xml .= $opt->{ indent } if ($opt->{ readable }); # add indentation
|
||||
$xml .= "<$name";
|
||||
if ( $opt->{ autotype })
|
||||
{
|
||||
my $ns = $self->get_targetNamespace();
|
||||
my $prefix = $opt->{ namespace }->{ $ns }
|
||||
|| die 'No prefix found for namespace '. $ns;
|
||||
$xml .= join q{}, " type=\"$prefix:", $self->get_name(), '"'
|
||||
if ($self->get_name() );
|
||||
}
|
||||
$xml .= '>';
|
||||
$xml .= "\n" if ( $opt->{ readable } ); # add linebreak
|
||||
if ( ($flavor eq "sequence") or ($flavor eq "all") )
|
||||
{
|
||||
$opt->{ indent } .= "\t";
|
||||
for my $element (@{ $self->get_element() })
|
||||
{
|
||||
# might be list - listify
|
||||
$value = [ $value ] if not ref $value eq 'ARRAY';
|
||||
|
||||
for my $single_value (@{ $value }) {
|
||||
my $element_value;
|
||||
if (blessed $single_value) {
|
||||
my $method = 'get_' . $element->get_name();
|
||||
$element_value = $single_value->$method();
|
||||
}
|
||||
else {
|
||||
$element_value = $single_value->{ $element->get_name() }
|
||||
}
|
||||
$element_value = [ $element_value ]
|
||||
if not ref $element_value eq 'ARRAY';
|
||||
|
||||
$xml .= join q{}
|
||||
, map { $element->serialize( undef, $_, $opt ) }
|
||||
@{ $element_value };
|
||||
}
|
||||
}
|
||||
$opt->{ indent } =~s/\t$//;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "sorry, we just handle all and sequence types yet...";
|
||||
}
|
||||
$xml .= $opt->{ indent } if ( $opt->{ readable } ); # add indentation
|
||||
$xml .= '</' . $name . '>';
|
||||
$xml .= "\n" if ($opt->{ readable } ); # add linebreak
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub explain
|
||||
{
|
||||
my ($self, $opt, $name ) = @_;
|
||||
my $flavor = $self->get_flavor();
|
||||
my $xml = '';
|
||||
$xml .= $opt->{ indent } if ($opt->{ readable }); # add indentation
|
||||
$xml .= q{'} . $name . q{' => };
|
||||
|
||||
return q{} if not $flavor; # empty complexType
|
||||
|
||||
if ( ($flavor eq "sequence") or ($flavor eq "all") )
|
||||
{
|
||||
$xml .= "{\n";
|
||||
$opt->{ indent } .= "\t";
|
||||
$xml .= join q{}, map { $_->explain( $opt ) }
|
||||
@{ $self->get_element() };
|
||||
$opt->{ indent } =~s/\t$//; # step back
|
||||
$xml .= $opt->{ indent } . "},\n";
|
||||
}
|
||||
elsif ($flavor eq "complexContent")
|
||||
{
|
||||
|
||||
}
|
||||
elsif ($flavor eq "simpleContent")
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
warn "unknown complexType definition $flavor";
|
||||
}
|
||||
$xml .= "\n" if ($opt->{ readable } ); # add linebreak
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
my ($self, $opt, $name ) = @_;
|
||||
my $flavor = $self->get_flavor();
|
||||
my $txt;
|
||||
return q{} if not $flavor; # empty complexType
|
||||
|
||||
my %nsmap = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
|
||||
if ( ($flavor eq "sequence") or ($flavor eq "all") )
|
||||
{
|
||||
for my $element (@{ $self->get_element() }) {
|
||||
$txt .= $element->to_typemap( $opt );
|
||||
}
|
||||
}
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub toClass {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
|
||||
my $template = <<'EOT';
|
||||
package [% class_prefix %]::[% self.get_name %];
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType
|
||||
);
|
||||
|
||||
[% FOREACH element=self.get_element -%]
|
||||
my %[% element.get_name %]_of :ATTR(:get<[% element.get_name %]>);
|
||||
[% END %]
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw([% FOREACH element=self.get_element -%]
|
||||
[% element.get_name %]
|
||||
[% END %]) ],
|
||||
{
|
||||
[% FOREACH element=self.get_element %] [% element.get_name %] => \%[% element.get_name %]_of,
|
||||
[% END %]
|
||||
},
|
||||
{
|
||||
[%- FOREACH element=self.get_element;
|
||||
split_name = element.get_type.split(':');
|
||||
prefix = split_name.0;
|
||||
localname = split_name.1;
|
||||
IF nsmap.$prefix == 'http://www.w3.org/2001/XMLSchema' -%]
|
||||
[% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% localname %]',
|
||||
[% ELSE %]
|
||||
[% element.get_name %] => '[% class_prefix %]::[% localname %]',
|
||||
[%- END;
|
||||
END %]
|
||||
}
|
||||
);
|
||||
|
||||
sub get_xmlns { '[% self.get_targetNamespace %]' }
|
||||
|
||||
1;
|
||||
EOT
|
||||
|
||||
$opt->{ base_path } ||= '.';
|
||||
|
||||
require Template;
|
||||
my $tt = Template->new(
|
||||
RELATIVE => 1,
|
||||
);
|
||||
my $code = $tt->process( \$template, {
|
||||
class_prefix => $opt->{ prefix },
|
||||
self => $self,
|
||||
nsmap => { reverse %{ $opt->{ wsdl }->get_xmlns() } },
|
||||
},
|
||||
$opt->{ output },
|
||||
) or die $tt->error();
|
||||
}
|
||||
|
||||
sub _check_value {
|
||||
my $self = shift;
|
||||
}
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 Bugs and limitations
|
||||
|
||||
=over
|
||||
|
||||
=item * attribute definitions
|
||||
|
||||
Attribute definitions are ignored
|
||||
|
||||
=item * abstract, block, final, mixed
|
||||
|
||||
Handling of these attribute is not implemented yet.
|
||||
|
||||
=item * simpleContent, complexContent, extension, restriction, group, choice
|
||||
|
||||
Handling of these child elements is not implemented yet
|
||||
|
||||
=item * explain may produce erroneous results
|
||||
|
||||
=over
|
||||
|
||||
=cut
|
||||
348
lib/SOAP/WSDL/XSD/Element.pm
Normal file
348
lib/SOAP/WSDL/XSD/Element.pm
Normal file
@@ -0,0 +1,348 @@
|
||||
package SOAP::WSDL::XSD::Element;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %simpleType_of :ATTR(:name<simpleType> :default<()>);
|
||||
my %complexType_of :ATTR(:name<complexType> :default<()>);
|
||||
my %facet_of :ATTR(:name<facet> :default<()>);
|
||||
my %type_of :ATTR(:name<type> :default<()>);
|
||||
my %abstract_of :ATTR(:name<abstract> :default<()>);
|
||||
my %block_of :ATTR(:name<block> :default<()>);
|
||||
my %default_of :ATTR(:name<default> :default<()>);
|
||||
my %final_of :ATTR(:name<final> :default<()>);
|
||||
my %fixed_of :ATTR(:name<fixed> :default<()>);
|
||||
my %form_of :ATTR(:name<form> :default<()>);
|
||||
my %maxOccurs_of :ATTR(:name<maxOccurs> :default<()>);
|
||||
my %minOccurs_of :ATTR(:name<minOccurs> :default<()>);
|
||||
my %nillable_of :ATTR(:name<nillable> :default<()>);
|
||||
my %ref_of :ATTR(:name<ref> :default<()>);
|
||||
my %substitutionGroup_of :ATTR(:name<substitutionGroup> :default<()>);
|
||||
|
||||
sub first_type {
|
||||
my $result_ref = $complexType_of{ ident shift };
|
||||
return if not $result_ref;
|
||||
return $result_ref if (not ref $result_ref eq 'ARRAY');
|
||||
return $result_ref->[0];
|
||||
}
|
||||
|
||||
sub first_simpleType {
|
||||
my $result_ref = $simpleType_of{ ident shift };
|
||||
return if not $result_ref;
|
||||
return $result_ref if (not ref $result_ref eq 'ARRAY');
|
||||
return $result_ref->[0];
|
||||
}
|
||||
|
||||
sub first_complexType {
|
||||
my $result_ref = $complexType_of{ ident shift };
|
||||
return if not $result_ref;
|
||||
return $result_ref if (not ref $result_ref eq 'ARRAY');
|
||||
return $result_ref->[0];
|
||||
}
|
||||
|
||||
# serialize type instead...
|
||||
sub serialize
|
||||
{
|
||||
my ($self, $name, $value, $opt) = @_;
|
||||
my $type;
|
||||
my $typelib = $opt->{ typelib };
|
||||
my %ns_map = reverse %{ $opt->{ namespace } };
|
||||
my $ident = ident $self;
|
||||
|
||||
# abstract elements may only be serialized via ref - and then we have a
|
||||
# name...
|
||||
die "cannot serialize abstract element" if $abstract_of{ $ident }
|
||||
and not $name;
|
||||
|
||||
# TODO: implement final and substitutionGroup - maybe never implement
|
||||
# substitutionGroup ?
|
||||
|
||||
$name ||= $self->get_name();
|
||||
|
||||
# set default and fixed - fixed overrides everything,
|
||||
# default only empty (undefined) values
|
||||
if (not defined $value) {
|
||||
$value = $default_of{ ident $self } if $default_of{ ident $self };
|
||||
}
|
||||
$value = $fixed_of{ ident $self } if $fixed_of{ ident $self };
|
||||
|
||||
# TODO check nillable and serialize empty data correctly
|
||||
|
||||
# return if minOccurs is 0 and we have no value
|
||||
if (defined $minOccurs_of{ ident $self }
|
||||
and $minOccurs_of{ ident $self } == 0) {
|
||||
return q{} if not defined $value;
|
||||
}
|
||||
|
||||
# handle direct simpleType and complexType here
|
||||
if ($type = $self->first_simpleType() ) { # simpleType
|
||||
return $type->serialize( $name, $value, $opt );
|
||||
}
|
||||
elsif ($type = $self->first_complexType() ) { # complexType
|
||||
return $type->serialize( $name, $value, $opt );
|
||||
}
|
||||
elsif (my $ref_name = $ref_of{ $ident }) { # ref
|
||||
my ($prefix, $localname) = split /:/ , $ref_name;
|
||||
my $ns = $ns_map{ $prefix };
|
||||
$type = $typelib->find_type( $ns, $localname );
|
||||
die "no type for $prefix:$localname" if (not $type);
|
||||
return $type->serialize( $self->get_name(), $value, $opt );
|
||||
}
|
||||
|
||||
# lookup type
|
||||
my ($prefix, $localname) = split /:/ , $self->get_type();
|
||||
my $ns = $ns_map{ $prefix };
|
||||
$type = $typelib->find_type(
|
||||
$ns, $localname
|
||||
);
|
||||
|
||||
# safety check
|
||||
die "no type for $prefix:$localname $ns_map{$prefix}" if (not $type);
|
||||
|
||||
return $type->serialize( $self->get_name(), $value, $opt );
|
||||
}
|
||||
|
||||
sub explain
|
||||
{
|
||||
my ($self, $opt, $name) = @_;
|
||||
my $type;
|
||||
my $text = q{};
|
||||
|
||||
# if we have a simple / complexType, explain right here
|
||||
if ($type = $self->first_simpleType() )
|
||||
{
|
||||
$text .= $type->explain( $opt, $self->get_name() );
|
||||
}
|
||||
elsif ($type = $self->first_complexType() )
|
||||
{
|
||||
$text .= $type->explain( $opt, $self->get_name() )
|
||||
}
|
||||
|
||||
# return if it's not a derived type - we don't handle
|
||||
# other stuff yet.
|
||||
return $text if (not $self->get_type() );
|
||||
|
||||
# if we have a derived type, fetch type and explain
|
||||
my ($prefix, $localname) = split /:/ , $self->get_type();
|
||||
my %ns_map = reverse %{ $opt->{ namespace } };
|
||||
my $ns = $ns_map{ $prefix };
|
||||
|
||||
$type = $opt->{ wsdl }->first_types()->find_type(
|
||||
$ns, $localname
|
||||
);
|
||||
|
||||
die "no type for $prefix:$localname ($ns)" if (not $type);
|
||||
|
||||
return $text .= $type->explain( $opt, $self->get_name() );
|
||||
return 'ERROR: '. $@;
|
||||
}
|
||||
|
||||
sub to_typemap {
|
||||
|
||||
my ($self, $opt) = @_;
|
||||
my $txt = q{};
|
||||
|
||||
my %nsmap = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
|
||||
my $type;
|
||||
push @{ $opt->{path} }, $self->get_name();
|
||||
if ( my $typename = $self->get_type() ) {
|
||||
my ($prefix, $localname) = split /:/, $self->get_type();
|
||||
my $ns = $nsmap{ $prefix };
|
||||
my $typeclass;
|
||||
|
||||
# builtin type
|
||||
if ( $nsmap{ $prefix } eq 'http://www.w3.org/2001/XMLSchema') {
|
||||
$typeclass = "SOAP::WSDL::XSD::Typelib::Builtin::$localname";
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = $opt->{ wsdl }->first_types()->find_type( $ns, $localname );
|
||||
$typeclass = $opt->{ prefix } . $type->get_name();
|
||||
$txt .= $type->to_typemap($opt);
|
||||
}
|
||||
$txt .= q{'} . join( q{/}, @{ $opt->{path} } ) . "' => '$typeclass',\n";
|
||||
}
|
||||
elsif ($type = $self->first_simpleType() ) {
|
||||
my $flavor = $type->get_flavor();
|
||||
if ( $flavor eq 'sequence' ) {
|
||||
$txt .= "# atomic simple type (sequence)\n";
|
||||
$txt .= $type->to_typemap($opt). "\n";
|
||||
$txt .= "# end atomic simple type (sequence)\n";
|
||||
}
|
||||
elsif ( $flavor eq 'all' ) {
|
||||
$txt .= "# atomic simple type (all)\n";
|
||||
$txt .= $type->to_typemap($opt). "\n";
|
||||
$txt .= "# end atomic simple type (all)\n";
|
||||
}
|
||||
|
||||
}
|
||||
elsif ($type = $self->first_complexType() ) {
|
||||
my $typeclass = $opt->{ prefix } . $self->get_name();
|
||||
$txt .= q{'} . join( q{/}, @{ $opt->{path} } ) . "' => '$typeclass',\n";
|
||||
my $flavor = $type->get_flavor();
|
||||
if ( $flavor eq 'sequence' ) {
|
||||
$txt .= "# atomic complex type (sequence)\n";
|
||||
$txt .= $type->to_typemap($opt). "\n";;
|
||||
$txt .= "# end atomic complex type (sequence)\n";
|
||||
}
|
||||
elsif ( $flavor eq 'all' ) {
|
||||
$txt .= "# atomic complex type (all)\n";
|
||||
$txt .= $type->to_typemap($opt). "\n";
|
||||
$txt .= "# end atomic complex type (all)\n";
|
||||
}
|
||||
}
|
||||
pop @{ $opt->{ path } };
|
||||
|
||||
return $txt;
|
||||
}
|
||||
|
||||
sub toClass {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
|
||||
my $template = <<'EOT';
|
||||
package [% class_prefix %]::[% self.get_name %];
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
[% IF (type = self.first_simpleType) %]
|
||||
# <element name="[% self.get_name %]"><simpleType> definition
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType
|
||||
[% type.flavor_class %]
|
||||
[% type.base_class($class_prefix) %]
|
||||
);
|
||||
[% ELSIF (type = self.first_complexType) %]
|
||||
# <element name="[% self.get_name %]"><complexType> definition
|
||||
use SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
SOAP::WSDL::XSD::Typelib::ComplexType
|
||||
);
|
||||
|
||||
[% FOREACH element = type.get_element %]
|
||||
my %[% element.get_name %]_of :ATTR(get:<[% element.get_name %]>);
|
||||
[% END %]
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw([% FOREACH element = type.get_element %]
|
||||
[% element.get_name %]
|
||||
[% END %]) ],
|
||||
{
|
||||
[% FOREACH element = type.get_element %] [% element.get_name %] => \%[% element.get_name %]_of,
|
||||
[% END %]
|
||||
},
|
||||
{
|
||||
[% FOREACH element = type.get_element;
|
||||
split_name = element.get_type.split(':');
|
||||
prefix = split_name.0;
|
||||
localname = split_name.1;
|
||||
IF nsmap.$prefix == 'http://www.w3.org/2001/XMLSchema' %]
|
||||
[% element.get_name %] => 'SOAP::WSDL::XSD::Typelib::Builtin::[% localname %]',
|
||||
[% ELSE %]
|
||||
[% element.get_name %] => '[% class_prefix %]::[% localname %]',
|
||||
[% END %]
|
||||
[% END %]
|
||||
}
|
||||
);
|
||||
[%# END complexType %]
|
||||
[% ELSIF (type = self.get_type) %]
|
||||
# <element name="[% self.get_name %]" type="[% self.get_type %]"/> definition
|
||||
[% (typename = self.get_type);
|
||||
split_name = element.type.split(':');
|
||||
prefix = split_name.0;
|
||||
localname = split_name.1;
|
||||
-%]
|
||||
[% IF (nsmap.$prefix == 'http://www.w3.org/2001/XMLSchema');
|
||||
base_class = 'SOAP::WSDL::XSD::Typelib::Builtin::' _ localname ;
|
||||
ELSE;
|
||||
base_class = class_prefix _ '::' _ localname;
|
||||
-%]
|
||||
|
||||
use [% base_class %];
|
||||
[% END %]
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Element
|
||||
[% base_class %]
|
||||
);
|
||||
[% ELSIF (element = self.get_ref)
|
||||
%]
|
||||
# element ref"element" definition
|
||||
# Sorry, we don't handle this yet...
|
||||
[% END %]
|
||||
|
||||
sub get_xmlns { '[% self.get_targetNamespace %]' }
|
||||
|
||||
__PACKAGE__->__set_name('[% self.get_name %]');
|
||||
__PACKAGE__->__set_nillable([% self.get_nillable %]);
|
||||
__PACKAGE__->__set_minOccurs([% self.get_minOccurs %]);
|
||||
__PACKAGE__->__set_maxOccurs([% self.get_maxOccurs %]);
|
||||
__PACKAGE__->__set_ref('[% self.get_ref %]');
|
||||
|
||||
1;
|
||||
EOT
|
||||
|
||||
require Template;
|
||||
my $tt = Template->new(
|
||||
RELATIVE => 1,
|
||||
);
|
||||
my $code = $tt->process( \$template, {
|
||||
class_prefix => $opt->{ prefix },
|
||||
self => $self,
|
||||
nsmap => { reverse %{ $opt->{ wsdl }->get_xmlns() } },
|
||||
},
|
||||
$opt->{ output },
|
||||
)
|
||||
or die $tt->error();
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SOAP::WSDL::XSD::Element - XSD Element representation
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Represents a XML Schema Definition's Element element for serializing into
|
||||
various forms.
|
||||
|
||||
=head1 Bugs and limitations
|
||||
|
||||
=over
|
||||
|
||||
=item * block
|
||||
|
||||
Handling of the block attribute is not implemented yet.
|
||||
|
||||
=item * final
|
||||
|
||||
Handling of the final attribute is not implemented yet.
|
||||
|
||||
=item * substitutionGroup
|
||||
|
||||
Handling of the substitutionGroup attribute is not implemented yet
|
||||
|
||||
=item * explain may produce erroneous results
|
||||
|
||||
=over
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
This module is part of SOAP-WSDL. See SOAP::WSDL for license.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Insert @ instead of whitespace into e-mail.
|
||||
|
||||
Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
|
||||
|
||||
=cut
|
||||
53
lib/SOAP/WSDL/XSD/Primitive.pm
Normal file
53
lib/SOAP/WSDL/XSD/Primitive.pm
Normal file
@@ -0,0 +1,53 @@
|
||||
package SOAP::WSDL::XSD::Primitive;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
use Data::Dumper;
|
||||
|
||||
sub serialize
|
||||
{
|
||||
my ($self, $name, $value, $opt) = @_;
|
||||
my $xml;
|
||||
$opt->{ indent } ||= "";
|
||||
$xml .= $opt->{ indent } if ($opt->{ readable });
|
||||
$xml .= '<' . $name;
|
||||
if ( $opt->{ autotype })
|
||||
{
|
||||
my $ns = $self->get_targetNamespace();
|
||||
my $prefix = $opt->{ namespace }->{ $ns }
|
||||
|| die 'No prefix found for namespace '. $ns;
|
||||
$xml .= ' type="' . $prefix . ':'
|
||||
. $self->get_name() . '"' if ($self->get_name() );
|
||||
}
|
||||
|
||||
if (defined $value)
|
||||
{
|
||||
$xml .= '>';
|
||||
$xml .= "$value";
|
||||
$xml .= '</' . $name . '>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= '/>';
|
||||
}
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub explain
|
||||
{
|
||||
my ($self, $opt, $name ) = @_;
|
||||
my $perl;
|
||||
$opt->{ indent } ||= "";
|
||||
$perl .= $opt->{ indent } if ($opt->{ readable });
|
||||
|
||||
$perl .= q{'} . $name . q{' => $someValue };
|
||||
$perl .= "\n" if ($opt->{ readable });
|
||||
return $perl;
|
||||
}
|
||||
|
||||
sub toClass {
|
||||
warn "# primitive";
|
||||
}
|
||||
1;
|
||||
72
lib/SOAP/WSDL/XSD/Schema.pm
Normal file
72
lib/SOAP/WSDL/XSD/Schema.pm
Normal file
@@ -0,0 +1,72 @@
|
||||
package SOAP::WSDL::XSD::Schema;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
# child elements
|
||||
my %type_of :ATTR(:name<type> :default<[]>);
|
||||
my %element_of :ATTR(:name<element> :default<[]>);
|
||||
|
||||
# attributes
|
||||
my %attributeFormDefault_of :ATTR(:name<attributeFormDefault> :default<()>);
|
||||
my %blockDefault_of :ATTR(:name<blockDefault> :default<()>);
|
||||
my %elementFormDefault_of :ATTR(:name<elementFormDefault> :default<()>);
|
||||
my %finalDefault_of :ATTR(:name<finalDefault> :default<()>);
|
||||
my %version_of :ATTR(:name<version> :default<()>);
|
||||
|
||||
# id
|
||||
# name
|
||||
# targetNamespace inherited from Base
|
||||
# xmlns
|
||||
|
||||
#
|
||||
# attributeFormDefault = (qualified | unqualified) : unqualified
|
||||
# blockDefault = (#all | List of (extension | restriction | substitution)) : ''
|
||||
# elementFormDefault = (qualified | unqualified) : unqualified
|
||||
# finalDefault = (#all | List of (extension | restriction | list | union)) : ''
|
||||
# id = ID
|
||||
# targetNamespace = anyURI
|
||||
# version = token
|
||||
# xml:lang = language
|
||||
#
|
||||
#
|
||||
# alias type with all variants
|
||||
# AUTOMETHOD is WAY too slow..
|
||||
{
|
||||
no strict qw/refs/;
|
||||
for my $name (qw(simpleType complexType) ) {
|
||||
*{ "set_$name" } = \&set_type;
|
||||
*{ "get_$name" } = \&get_type;
|
||||
*{ "push_$name" } = \&push_type;
|
||||
*{ "find_$name" } = \&find_type;
|
||||
}
|
||||
}
|
||||
|
||||
sub push_type {
|
||||
# use $_[n] for performance -
|
||||
# we're called on each and every type inside WSDL
|
||||
push @{ $type_of{ ident $_[0]} }, $_[1];
|
||||
}
|
||||
|
||||
sub find_element {
|
||||
my ($self, @args) = @_;
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $args[0] &&
|
||||
$_->get_name() eq $args[1]
|
||||
}
|
||||
@{ $element_of{ ident $self } };
|
||||
return $found_at[0];
|
||||
}
|
||||
|
||||
sub find_type {
|
||||
my ($self, @args) = @_;
|
||||
my @found_at = grep {
|
||||
$_->get_targetNamespace() eq $args[0] &&
|
||||
$_->get_name() eq $args[1]
|
||||
}
|
||||
@{ $type_of{ ident $self } };
|
||||
return $found_at[0];
|
||||
}
|
||||
|
||||
1;
|
||||
64
lib/SOAP/WSDL/XSD/Schema/Builtin.pm
Normal file
64
lib/SOAP/WSDL/XSD/Schema/Builtin.pm
Normal file
@@ -0,0 +1,64 @@
|
||||
package SOAP::WSDL::XSD::Schema::Builtin;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Schema;
|
||||
use SOAP::WSDL::XSD::Primitive;
|
||||
use base qw(SOAP::WSDL::XSD::Schema);
|
||||
|
||||
# all builtin types - add validation (e.g. content restrictions) later...
|
||||
my %PRIMITIVES = (
|
||||
'string' => {},
|
||||
'boolean' => {},
|
||||
'decimal' => {},
|
||||
'dateTime' => {},
|
||||
'float' => {},
|
||||
'double' => {},
|
||||
'duration' => {},
|
||||
'time' => {},
|
||||
'date' => {},
|
||||
'gYearMonth' => {},
|
||||
'gYear' => {},
|
||||
'gMonthDay' => {},
|
||||
'gDay' => {},
|
||||
'gMonth' => {},
|
||||
'hexBinary' => {},
|
||||
'base64Binary' => {},
|
||||
'anyURI' => {},
|
||||
'QName' => {},
|
||||
'NOTATION' => {},
|
||||
'integer' => {},
|
||||
'non-positive-integer' => {},
|
||||
'non-negative-integer' => {},
|
||||
'positiveInteger' => {},
|
||||
'negativeInteger' => {},
|
||||
'long' => {},
|
||||
'int' => {},
|
||||
'unsignedInt' => {},
|
||||
'short' => {},
|
||||
'unsignedShort' => {},
|
||||
'byte' => {},
|
||||
'unsignedByte' => {},
|
||||
'normalizedString' => {},
|
||||
'token' => {},
|
||||
'NMTOKEN' => {},
|
||||
);
|
||||
|
||||
# TODO place into appropriate schema and push on schema definitions list
|
||||
# in types
|
||||
sub START {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
|
||||
while (my ($name, $value) = each %PRIMITIVES )
|
||||
{
|
||||
$self->push_type( SOAP::WSDL::XSD::Primitive->new({
|
||||
name => $name,
|
||||
targetNamespace => 'http://www.w3.org/2001/XMLSchema',
|
||||
} )
|
||||
);
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
1;
|
||||
178
lib/SOAP/WSDL/XSD/SimpleType.pm
Normal file
178
lib/SOAP/WSDL/XSD/SimpleType.pm
Normal file
@@ -0,0 +1,178 @@
|
||||
package SOAP::WSDL::XSD::SimpleType;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::Base);
|
||||
|
||||
my %base_of :ATTR(:name<base> :default<()>);
|
||||
my %flavor_of :ATTR(:name<flavor> :default<()>);
|
||||
my %itemType_of :ATTR(:name<itemType> :default<()>);
|
||||
my %enumeration_of :ATTR(:name<enumeration> :default<()>);
|
||||
# is set to simpleContent/complexContent
|
||||
my %content_Model_of :ATTR(:name<contentModel> :default<()>);
|
||||
|
||||
sub set_restriction {
|
||||
my $self = shift;
|
||||
my @attributes = @_;
|
||||
$self->set_flavor( 'restriction' );
|
||||
foreach my $attr (@attributes)
|
||||
{
|
||||
next if (not $attr->{ LocalName } eq 'restriction');
|
||||
$self->base( $attr->{ Value } );
|
||||
}
|
||||
}
|
||||
|
||||
sub set_list {
|
||||
my $self = shift;
|
||||
my @attributes = @_;
|
||||
$self->set_flavor( 'list' );
|
||||
foreach my $attr (@attributes)
|
||||
{
|
||||
next if (not $attr->{ LocalName } eq 'list');
|
||||
$self->set_base( $attr->{ Value } );
|
||||
}
|
||||
}
|
||||
|
||||
sub set_union {
|
||||
my $self = shift;
|
||||
my @attributes = @_;
|
||||
$self->set_flavor( 'union' );
|
||||
foreach my $attr (@attributes)
|
||||
{
|
||||
next if (not $attr->{ LocalName } eq 'memberTypes');
|
||||
$self->set_base( [ split /\s/, $attr->{ Value } ] );
|
||||
}
|
||||
}
|
||||
|
||||
sub push_enumeration
|
||||
{
|
||||
my $self = shift;
|
||||
my @attr = @_;
|
||||
my @attributes = @_;
|
||||
$self->set_flavor( 'enumeration' );
|
||||
foreach my $attr (@attributes)
|
||||
{
|
||||
next if (not $attr->{ LocalName } eq 'value');
|
||||
push @{ $enumeration_of{ ident $self } }, $attr->{ 'Value' };
|
||||
}
|
||||
}
|
||||
|
||||
sub serialize
|
||||
{
|
||||
my $self = shift;
|
||||
my $name = shift;
|
||||
my $value = shift;
|
||||
my $opt = shift;
|
||||
my $ident = ident $self;
|
||||
$self->_check_value( $value );
|
||||
|
||||
return $self->_serialize_single($name, $value , $opt)
|
||||
if ( $flavor_of{ $ident } eq 'restriction'
|
||||
or $flavor_of{ $ident } eq 'union'
|
||||
or $flavor_of{ $ident } eq 'enumeration');
|
||||
|
||||
if ($flavor_of{ $ident } eq 'list' )
|
||||
{
|
||||
$value ||= [];
|
||||
$value = [ $value ] if ( ref( $value) ne 'ARRAY' );
|
||||
return $self->_serialize_single($name, join( q{ }, @{ $value } ), $opt);
|
||||
}
|
||||
}
|
||||
|
||||
sub _serialize_single
|
||||
{
|
||||
my ($self, $name, $value, $opt) = @_;
|
||||
my $xml = '';
|
||||
$xml .= $opt->{ indent } if ($opt->{ readable }); # add indentation
|
||||
$xml .= '<' . $name;
|
||||
if ( $opt->{ autotype })
|
||||
{
|
||||
my $ns = $self->get_targetNamespace();
|
||||
my $prefix = $opt->{ namespace }->{ $ns }
|
||||
|| die 'No prefix found for namespace '. $ns;
|
||||
$xml .= ' type="' . $prefix . ':'
|
||||
. $self->get_name() .'"';
|
||||
}
|
||||
$xml .= '>';
|
||||
$xml .= $value;
|
||||
$xml .= '</' . $name . '>' ;
|
||||
$xml .= "\n" if ($opt->{ readable });
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub explain
|
||||
{
|
||||
my ($self, $opt, $name) = @_;
|
||||
my $perl;
|
||||
$opt->{ indent } ||= "";
|
||||
$perl .= $opt->{ indent } if ($opt->{ readable });
|
||||
$perl .= q{'} . $name . q{' => $someValue };
|
||||
$perl .= "\n" if ($opt->{ readable });
|
||||
return $perl;
|
||||
}
|
||||
|
||||
sub _check_value {
|
||||
my $self = shift;
|
||||
}
|
||||
|
||||
sub toClass {
|
||||
my $self = shift;
|
||||
my $opt = shift;
|
||||
my $class_prefix = $opt->{ prefix };
|
||||
my $name = $opt->{name} || $self->get_name();
|
||||
my $flavor = $self->get_flavor() eq 'list'
|
||||
? 'SOAP::WSDL::XSD::Typelib::Builtin::list'
|
||||
: $self->get_flavor() eq 'restriction'
|
||||
? 'SOAP::WSDL::XSD::Typelib::SimpleType::restriction'
|
||||
: q{};
|
||||
my $base = $self->get_base();
|
||||
my $targetNamespace = $self->get_targetNamespace;
|
||||
my ($prefix, $localname) = split /:/, $base;
|
||||
my %ns_map = reverse %{ $opt->{ wsdl }->get_xmlns() };
|
||||
$base = ($ns_map{ $prefix} eq 'http://www.w3.org/2001/XMLSchema')
|
||||
? "SOAP::WSDL::XSD::Typelib::Builtin::$localname"
|
||||
: "$opt->{prefix}::$localname";
|
||||
|
||||
my $code =<<"EOT";
|
||||
package $class_prefix::$name;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType
|
||||
$flavor
|
||||
$base
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
sub get_xmlns { '$targetNamespace' }
|
||||
|
||||
EOT
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 Bugs and limitations
|
||||
|
||||
=over
|
||||
|
||||
=item * simpleContent, complexContent
|
||||
|
||||
These child elements are not implemented yet
|
||||
|
||||
=item * union
|
||||
|
||||
union simpleType definitions probalbly serialize wrong
|
||||
|
||||
=item * explain may produce erroneous results
|
||||
|
||||
=over
|
||||
|
||||
=cut
|
||||
514
lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
Normal file
514
lib/SOAP/WSDL/XSD/Typelib/Builtin.pm
Normal file
@@ -0,0 +1,514 @@
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
|
||||
# derivation classes first...
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::list;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
|
||||
sub serialize {
|
||||
my ($self, $opt) = @_;
|
||||
my $value = $self->get_value();
|
||||
return $self->start_tag({ %$opt, nil => 1 }) if not defined $value;
|
||||
$value = [ $value ] if not ref $value;
|
||||
return join q{}, $self->start_tag($opt, $value)
|
||||
, join( q{ }, @{ $value } )
|
||||
, $self->end_tag($opt, $value);
|
||||
}
|
||||
|
||||
# Builtin classes
|
||||
# Every XML schema type inherits from anyType...
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::anyType;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
|
||||
sub start_tag {
|
||||
my ($self, $opt) = @_;
|
||||
$opt ||= {};
|
||||
return '<' . $opt->{name} . ' >' if $opt->{ name };
|
||||
return q{}
|
||||
}
|
||||
sub end_tag {
|
||||
my ($self, $opt) = @_;
|
||||
$opt ||= {};
|
||||
return '</' . $opt->{name} . ' >' if $opt->{ name };
|
||||
return q{}
|
||||
};
|
||||
|
||||
sub serialize_qualified :STRINGIFY {
|
||||
return $_[0]->serialize( { qualified => 1 } );
|
||||
}
|
||||
|
||||
# All builtin and all simpleType types inherit from anySimpleType
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
||||
|
||||
my %value_of :ATTR(:name<value> :default<()>);
|
||||
|
||||
sub serialize {
|
||||
my ($self, $opt) = @_;
|
||||
my $ident = ident $self;
|
||||
$opt ||= {};
|
||||
return $self->start_tag({ %$opt, nil => 1})
|
||||
if not defined $value_of{ $ident };
|
||||
return join q{}, $self->start_tag($opt, $value_of{ $ident })
|
||||
, $value_of{ $ident }
|
||||
, $self->end_tag($opt);
|
||||
}
|
||||
|
||||
sub as_bool :BOOLIFY {
|
||||
return $value_of { ident $_[0] };
|
||||
}
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::dateTime;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::duration;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::date;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::time;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::gYear;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::gMonth;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::gDay;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::boolean;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
sub serialize {
|
||||
my ($self, $opt) = @_;
|
||||
my $ident = ident $self;
|
||||
$opt ||= {};
|
||||
return $self->start_tag({ %$opt, nil => 1})
|
||||
if not defined $value_of{ $ident };
|
||||
return join q{}
|
||||
, $self->start_tag($opt)
|
||||
, $value_of{ $ident } ? 'true' : 'false'
|
||||
, $self->end_tag($opt);
|
||||
}
|
||||
|
||||
sub as_num :NUMERIFY {
|
||||
return $_[0]->get_value();
|
||||
}
|
||||
|
||||
sub set_value {
|
||||
my ($self, $value) = @_;
|
||||
$value_of{ ident $self } = defined $value
|
||||
? ($value ne 'false' or ($value))
|
||||
? 1 : 0
|
||||
: 0;
|
||||
}
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::string;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::normalizedString;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::string);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::token;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::normalizedString);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::language;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::Name;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::NCName;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::Name);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::ID;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::NCName);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::IDREF;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::ID);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::IDREFS;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::IDREF);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::ENTITY;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::NCName);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::token);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::decimal;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
sub as_num :NUMERIFY :BOOLIFY {
|
||||
return $_[0]->get_value();
|
||||
}
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::base64Binary;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::hex64Binary;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::float;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
sub as_num :NUMERIFY {
|
||||
return $_[0]->get_value();
|
||||
}
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::double;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
sub as_num :NUMERIFY {
|
||||
return $_[0]->get_value();
|
||||
}
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::anyURI;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::qName;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::NOTATION;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::integer;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::decimal);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::long;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::integer);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::int;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::long);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::short;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::int);
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::Builtin::byte;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Class::Std::Storable;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::short);
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::Builtin - Built-in XML Schema datatypes
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module implements all builtin Types from the XML schema specification.
|
||||
|
||||
Objects of a class may be filled with values and serialize correctly.
|
||||
|
||||
These basic type classes are most useful when used as element or simpleType
|
||||
base classes.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
my $bool = SOAP::WSDL::XSD::Typelib::Builtin::bool->new({ value => 0} );
|
||||
print $bool; # prints "true"
|
||||
|
||||
# implements <simpleType name="MySimpleType">
|
||||
# <list itemType="xsd:string" />
|
||||
# </simpleType>
|
||||
package MySimpleType;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::SimpleType
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::string
|
||||
);
|
||||
1;
|
||||
|
||||
# somewhere else
|
||||
my $list = MySimpleType->new({ value => [ 'You', 'shall', 'overcome' ] });
|
||||
print $list; # prints "You shall overcome"
|
||||
|
||||
=head1 CLASS HIERARCHY
|
||||
|
||||
This is the inheritance graph for builtin types.
|
||||
|
||||
Types with [] marker describe types derived via the item in [] in the XML
|
||||
Schema specs.
|
||||
|
||||
Derivation is implemented via multiple inheritance with the derivation method
|
||||
as first item in the base class list.
|
||||
|
||||
anyType
|
||||
- anySimpleType
|
||||
- duration
|
||||
- dateTime
|
||||
- date
|
||||
- time
|
||||
- gYearMonth
|
||||
- gYear
|
||||
- gMonthDay
|
||||
- gDay
|
||||
- gMonth
|
||||
- boolean
|
||||
- base64Binary
|
||||
- hexBinary
|
||||
- float
|
||||
- decimal
|
||||
- integer
|
||||
- nonPositiveInteger
|
||||
- negativeInteger
|
||||
- nonNegativeInteger
|
||||
- positiveInteger
|
||||
- unsignedLong
|
||||
- unsignedInt
|
||||
- unsignedShort
|
||||
- unsignedByte
|
||||
- long
|
||||
- int
|
||||
- short
|
||||
- byte
|
||||
- double
|
||||
- anyURI
|
||||
- string
|
||||
- normalizedString
|
||||
- language
|
||||
- Name
|
||||
- NCName
|
||||
- ID
|
||||
- IDREF
|
||||
- IDREFS [list]
|
||||
- ENTITY
|
||||
- NMTOKEN
|
||||
- NMTOKENS [list]
|
||||
|
||||
=head1 OVERLOADED OPERATORS
|
||||
|
||||
Overloading is implemented via Class::Std's trait mechanism.
|
||||
|
||||
The following behaviours apply:
|
||||
|
||||
=over
|
||||
|
||||
=item * string context
|
||||
|
||||
All classes use the C<serialize> method for stringification.
|
||||
|
||||
=item * bool context
|
||||
|
||||
All classes derived from anySimpleType return their value in bool context
|
||||
|
||||
=item * numeric context
|
||||
|
||||
The boolean class returns 0 or 1 in numeric context.
|
||||
|
||||
decimal, float and double (and derived classes) return their value in
|
||||
numeric context.
|
||||
|
||||
=back
|
||||
|
||||
=head1 BUGS AND LIMITATIONS
|
||||
|
||||
=over
|
||||
|
||||
=item * Thread safety
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::Builtin uses Class::Std::Storable which uses
|
||||
Class::Std. Class::Std is not thread safe, so
|
||||
SOAP::WSDL::XSD::Typelib::Builtin is neither.
|
||||
|
||||
=item * XML Schema facets
|
||||
|
||||
No facets are implemented yet.
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Replace whitespace by @ in e-mail address.
|
||||
|
||||
Martin Kutter E<gt>martin.kutter fen-net.deE<lt>
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
This library is free software, you may distribute/modify it under the
|
||||
same terms as perl itself
|
||||
|
||||
=cut
|
||||
184
lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
Normal file
184
lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm
Normal file
@@ -0,0 +1,184 @@
|
||||
#!/usr/bin/perl
|
||||
package SOAP::WSDL::XSD::Typelib::ComplexType;
|
||||
use strict;
|
||||
use Carp;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use Scalar::Util qw(blessed);
|
||||
use Class::Std::Storable;
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
|
||||
|
||||
my %ELEMENTS_FROM;
|
||||
my %ATTRIBUTES_OF;
|
||||
my %CLASSES_OF;
|
||||
|
||||
# we store per-class elements.
|
||||
# call as __PACKAGE__->_factory
|
||||
sub _factory {
|
||||
my $class = shift;
|
||||
$ELEMENTS_FROM{ $class } = shift;
|
||||
$ATTRIBUTES_OF{ $class } = shift;
|
||||
$CLASSES_OF{ $class } = shift;
|
||||
|
||||
no strict qw(refs);
|
||||
while (my ($name, $attribute_ref) = each %{ $ATTRIBUTES_OF{ $class } } )
|
||||
{
|
||||
my $type = $CLASSES_OF{ $class }->{ $name }
|
||||
or die "No class given for $name";
|
||||
eval "require $type" if not eval { $type->isa('UNIVERSAL') };
|
||||
croak $@ if $@;
|
||||
|
||||
*{ "$class\::set_$name" } = sub {
|
||||
my ($self, $value) = @_;
|
||||
# set to a) value if it's an object
|
||||
# b) New object with value for simple vlues
|
||||
# c) New object with value for list values and list type
|
||||
# d) List ref of new objects with value for list values and non-list type
|
||||
$attribute_ref->{ ident $self } = (blessed $value)
|
||||
? $value
|
||||
: (ref $value && ref $value eq 'ARRAY')
|
||||
? $type->isa('SOAP::WSDL::XSD::Typelib::Builtin::list')
|
||||
? $type->new({ value => $value })
|
||||
: [ map { $type->new({ value => $_ }) } @{ $value } ]
|
||||
: $type->new({ value => $value });
|
||||
};
|
||||
|
||||
*{ "$class\::add_$name" } = sub {
|
||||
my ($self, $value) = @_;
|
||||
my $ident = ident $self;
|
||||
if (not defined $value) {
|
||||
warn "attempting to add empty value to " . ref $self;
|
||||
}
|
||||
|
||||
return $attribute_ref->{ $ident } = $value
|
||||
if not defined $attribute_ref->{ $ident };
|
||||
|
||||
# listify previous value if it's no list
|
||||
$attribute_ref->{ $ident } = [ $attribute_ref->{ $ident } ]
|
||||
if not ref $attribute_ref->{ $ident } eq 'ARRAY';
|
||||
|
||||
# add to list
|
||||
return push @{ $attribute_ref->{ $ident } }, $value;
|
||||
};
|
||||
}
|
||||
|
||||
# we need our own destructor - on the fly generated classes
|
||||
# don't necessarily go through Clas::Std::Storable's DEMOLISH
|
||||
# calls.
|
||||
# my $destructor_ref = *{ "$class\::DESTROY" };
|
||||
# no warnings qw(redefine);
|
||||
# *{ "$class\::DESTROY" } = sub {
|
||||
# my $self = shift;
|
||||
# my $class = shift;
|
||||
# for (@{ $ELEMENTS_FROM{ $class } }) {
|
||||
# delete $_->{ ident $self };
|
||||
# }
|
||||
# call original destructor.
|
||||
# $destructor_ref->( $self, @_) if ref ($destructor_ref);
|
||||
# };
|
||||
#
|
||||
}
|
||||
|
||||
sub START {
|
||||
my ($self, $ident, $args_of) = @_;
|
||||
my $class = ref $self;
|
||||
for my $name (keys %{ $ATTRIBUTES_OF{ $class } } ) {
|
||||
my $method = "set_$name";
|
||||
$self->$method( $args_of->{ $name } )
|
||||
if $args_of->{ $name };
|
||||
}
|
||||
}
|
||||
|
||||
sub _get_elements {
|
||||
my $self = shift;
|
||||
my $class = ref $self;
|
||||
my $ident = ident $self;
|
||||
return map { $_->{ $ident } } @{ $ELEMENTS_FROM{ $class } };
|
||||
}
|
||||
|
||||
# this serialize method works fine for <all> and <sequence>
|
||||
# complextypes, as well as for <restriction><all> or
|
||||
# <restriction><sequence>.
|
||||
# But what about choice, group, extension ?
|
||||
#
|
||||
sub _serialize {
|
||||
my $self = shift;
|
||||
my $ident = ident $self;
|
||||
my $class = ref $self;
|
||||
|
||||
# return concatenated return value of serialize call of all
|
||||
# elements retrieved from get_elements expanding list refs.
|
||||
# get_elements is inlined for performance.
|
||||
return join q{} , map {
|
||||
my $element = $ATTRIBUTES_OF{ $class }->{ $_ }->{$ident };
|
||||
$element = [ $element ]
|
||||
if not ref $element eq 'ARRAY';
|
||||
my $name = $_;
|
||||
|
||||
map {
|
||||
# skip empty elements - complexTypes may have empty elements
|
||||
# (minOccurs 0).
|
||||
if (not $_) {
|
||||
q{}
|
||||
}
|
||||
# serialize element elements with their own serializer
|
||||
# but name them like they're named here.
|
||||
elsif ( $_->isa( 'SOAP::WSDL::XSD::Typelib::Element' ) ) {
|
||||
$_->serialize( { name => $_ } );
|
||||
}
|
||||
# serialize complextype elments (of other types) with their
|
||||
# serializer, but add element tags around.
|
||||
else {
|
||||
join q{}, $_->start_tag({ name => $name })
|
||||
, $_->serialize()
|
||||
, $_->end_tag({ name => $name });
|
||||
}
|
||||
} @{ $element }
|
||||
} (@{ $ELEMENTS_FROM{ $class } });
|
||||
}
|
||||
|
||||
sub serialize {
|
||||
my ($self, $opt) = @_;
|
||||
my $class = ref $self;
|
||||
$opt ||= {};
|
||||
# do we have a empty element ?
|
||||
return $self->start_tag({ %$opt, empty => 1 })
|
||||
if not @{ $ELEMENTS_FROM{ $class } };
|
||||
return join q{}, $self->start_tag($opt),
|
||||
$self->_serialize(), $self->end_tag();
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 Bugs and limitations
|
||||
|
||||
=over
|
||||
|
||||
=item * Thread safety
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::Builtin uses Class::Std::Storable which uses
|
||||
Class::Std. Class::Std is not thread safe, so
|
||||
SOAP::WSDL::XSD::Typelib::Builtin is neither.
|
||||
|
||||
=item * XML Schema facets
|
||||
|
||||
No facets are implemented yet.
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Replace whitespace by @ in e-mail address.
|
||||
|
||||
Martin Kutter E<gt>martin.kutter fen-net.deE<lt>
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
This library is free software, you may distribute/modify it under the
|
||||
same terms as perl itself
|
||||
|
||||
=cut
|
||||
101
lib/SOAP/WSDL/XSD/Typelib/Element.pm
Normal file
101
lib/SOAP/WSDL/XSD/Typelib/Element.pm
Normal file
@@ -0,0 +1,101 @@
|
||||
#!/usr/bin/perl
|
||||
package SOAP::WSDL::XSD::Typelib::Element;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use Data::Dumper;
|
||||
|
||||
my %NAME;
|
||||
my %NILLABLE;
|
||||
my %REF;
|
||||
my %MIN_OCCURS;
|
||||
my %MAX_OCCURS;
|
||||
|
||||
# Class data - remember, we're the base class for a class factory or for
|
||||
# generated code...
|
||||
# use BLOCK: for scoping
|
||||
BLOCK: {
|
||||
my %method_lookup = (
|
||||
_name => \%NAME,
|
||||
_nillable => \%NILLABLE,
|
||||
_ref => \%REF,
|
||||
_minOccurs => \%MIN_OCCURS,
|
||||
_maxOccurs => \%MAX_OCCURS,
|
||||
);
|
||||
|
||||
no strict qw(refs);
|
||||
while (my ($name, $value) = each %method_lookup ) {
|
||||
*{ "__set$name" } = sub {
|
||||
my $class = ref $_[0] || $_[0];
|
||||
$value->{ $class } = $_[1];
|
||||
};
|
||||
*{ "__get$name" } = sub {
|
||||
my $class = ref $_[0] || $_[0];
|
||||
return $value->{ $class };
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
sub start_tag {
|
||||
my ($self, $opt, $value) = @_;
|
||||
my $class = ref $self;
|
||||
my $ending = '>';
|
||||
my @attr_from = ();
|
||||
|
||||
$ending = '/>' if ($opt->{ empty });
|
||||
|
||||
if ($opt->{qualified}) {
|
||||
push @attr_from, 'xmlns="' . $self->get_xmlns . '"';
|
||||
}
|
||||
if ($opt->{ nil }) {
|
||||
return q{} if not $NILLABLE{ $class };
|
||||
push @attr_from, 'xsi:nil="true"';
|
||||
$ending = '/>';
|
||||
}
|
||||
return join q{ }, "<$NAME{$class}" , @attr_from , $ending;
|
||||
}
|
||||
|
||||
sub end_tag {
|
||||
my ($self, $class) = ($_[0], ref $_[0]);
|
||||
return "</$NAME{$class}>";
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
package MyElement;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use base (
|
||||
'SOAP::WSDL::XSD::Typelib::Element',
|
||||
);
|
||||
|
||||
__PACKAGE__->__set_name('MyElementName');
|
||||
__PACKAGE__->__set_nillable(1);
|
||||
__PACKAGE__->__set_minOccurs(1);
|
||||
__PACKAGE__->__set_maxOccurs(1);
|
||||
__PACKAGE__->__set_ref(1);
|
||||
|
||||
=head1 BUGS AND LIMITATIONS
|
||||
|
||||
=over
|
||||
|
||||
=item * minOccurs maxOccurs ref not implemented
|
||||
|
||||
These attributes are not yet supported, though they may be set as class
|
||||
properties via __PACKAGE__->__set_FOO methods.
|
||||
|
||||
=item * 'http://www.w3.org/2001/XMLSchema-instance prefix is hardcoded
|
||||
|
||||
The prefix for 'http://www.w3.org/2001/XMLSchema-instance (used as namespace
|
||||
for the {http://www.w3.org/2001/XMLSchema-instance}nil="true" attribute
|
||||
is hardcoded as 'xsi'.
|
||||
|
||||
You should definitly provide your XML envelope generator with the same prefix
|
||||
namespace combination (Default for SOAP::WSDL::Envelope).
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
130
lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm
Normal file
130
lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm
Normal file
@@ -0,0 +1,130 @@
|
||||
#!/usr/bin/perl
|
||||
package SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
|
||||
package SOAP::WSDL::XSD::Typelib::SimpleType::restriction;
|
||||
use strict;
|
||||
use Class::Std::Storable;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::SimpleType);
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType - simple type base class
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module implements a base class for designing simple type classes
|
||||
modelling XML Schema simpleType definitions.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# example simpleType derived by restriction
|
||||
# XSD would be:
|
||||
# <simpleType name="MySimpleType">
|
||||
# <restriction base="xsd:string" />
|
||||
# </simpleType>
|
||||
package MySimpleType;
|
||||
use Class::Std::Storable;
|
||||
# restriction base implemented via inheritance
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use SOAP::WSDL::XSD::Typelib::SimpleType;
|
||||
use base qw(
|
||||
# derive by restriction
|
||||
'SOAP::WSDL::XSD::Typelib::SimpleType::restriction',
|
||||
# restriction base
|
||||
'SOAP::WSDL::XSD::Typelib::Builtin::string'
|
||||
);
|
||||
|
||||
# example simpleType derived by list.
|
||||
# XSD would be:
|
||||
# <simpleType name="MySimpleListType">
|
||||
# <list itemTipe="xsd:string" />
|
||||
# </simpleType>
|
||||
package MySimpleListType;
|
||||
use Class::Std::Storable;
|
||||
# restriction base implemented via inheritance
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
use base ('SOAP::WSDL::XSD::Typelib::SimpleType',
|
||||
'SOAP::WSDL::XSD::Typelib::Builtin::list', # derive by list
|
||||
'SOAP::WSDL::XSD::Typelib::Builtin::string' # list itemType
|
||||
);
|
||||
|
||||
=head1 How to write your own simple type
|
||||
|
||||
Writing a simple type class is easy - all you have to do is setting up the
|
||||
base classes correctly.
|
||||
|
||||
The following rules apply:
|
||||
|
||||
=over
|
||||
|
||||
=item * simpleType derived via list
|
||||
|
||||
simpleType classes derived via list must inherit from these classes in
|
||||
exactly this order:
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType
|
||||
SOAP::WSDL::XSD::Typelib::Builtin::list # derive by list
|
||||
The::List::ItemType::Class # list itemType
|
||||
|
||||
The::List::ItemType::Class can either be a builtin class (see
|
||||
SOAP::WSDL::XSD::Builtin) or another simpleType class (any other class
|
||||
implementing the right methods is supported too, but not for the
|
||||
faint of heart).
|
||||
|
||||
=item * simpleType derived via restriction
|
||||
|
||||
simpleType classes derived via restriction must inherit from these classes in
|
||||
exactly this order:
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType # you may leave out this
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType::restriction # derive by retriction
|
||||
The::Restriction::Base::Class # resytriction base
|
||||
|
||||
The::Restriction::Base::Class can either be a builtin class (see
|
||||
SOAP::WSDL::XSD::Builtin) or another simpleType class.
|
||||
|
||||
The slight inconsistency between the these variants is caused by the
|
||||
restriction element, which has different meanings for simpleType and
|
||||
complexType definitions.
|
||||
|
||||
=head1 Bugs and limitations
|
||||
|
||||
=over *
|
||||
|
||||
=item * Thread safety
|
||||
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType uses Class::Std::Storable which uses
|
||||
Class::Std. Class::Std is not thread safe, so
|
||||
SOAP::WSDL::XSD::Typelib::SimpleType is neither.
|
||||
|
||||
=item * union
|
||||
|
||||
union simple types are not supported yet.
|
||||
|
||||
=item * XML Schema facets
|
||||
|
||||
No facets are implemented yet.
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Replace whitespace by @ in e-mail address.
|
||||
|
||||
Martin Kutter E<gt>martin.kutter fen-net.deE<lt>
|
||||
|
||||
=head1 COPYING
|
||||
|
||||
This library is free software, you may distribute/modify it under the
|
||||
same terms as perl itself
|
||||
|
||||
=cut
|
||||
30
t/001_use.t
Normal file
30
t/001_use.t
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use lib '../lib';
|
||||
chdir 't/' if (-d 't/');
|
||||
|
||||
my @modules = qw(
|
||||
SOAP::WSDL::Definitions
|
||||
SOAP::WSDL::Message
|
||||
SOAP::WSDL::Operation
|
||||
SOAP::WSDL::OpMessage
|
||||
SOAP::WSDL::SoapOperation
|
||||
SOAP::WSDL::Binding
|
||||
SOAP::WSDL::Port
|
||||
SOAP::WSDL::PortType
|
||||
SOAP::WSDL::Types
|
||||
SOAP::WSDL::SAX::WSDLHandler
|
||||
SOAP::WSDL::XSD::Primitive
|
||||
SOAP::WSDL::XSD::ComplexType
|
||||
SOAP::WSDL::XSD::SimpleType
|
||||
SOAP::WSDL::XSD::Element
|
||||
SOAP::WSDL::XSD::Schema
|
||||
);
|
||||
|
||||
for my $module (@modules)
|
||||
{
|
||||
use_ok($module);
|
||||
ok($module->new(), "Object creation");
|
||||
}
|
||||
336
t/002_sax.t
Normal file
336
t/002_sax.t
Normal file
@@ -0,0 +1,336 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
use Test::More tests => 17; # qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::SAX::ParserFactory;
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML;
|
||||
};
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(
|
||||
{ base => 'XML::SAX::Base' }
|
||||
), "Object creation");
|
||||
|
||||
my $parser = XML::SAX::ParserFactory->parser(
|
||||
Handler => $filter
|
||||
);
|
||||
|
||||
$parser->parse_string( xml() );
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
# print Dumper $wsdl;
|
||||
|
||||
my $types = $wsdl->first_types();
|
||||
|
||||
my $serializer_options = {
|
||||
readable => 1,
|
||||
autotype => 1,
|
||||
namespace => { 'urn:myNamespace' => 'tns',
|
||||
"http://www.w3.org/2001/XMLSchema" => 'xsd' },
|
||||
typelib => $wsdl->first_types(),
|
||||
indent => "\t",
|
||||
};
|
||||
|
||||
my $xml;
|
||||
my $type = $types->find_type( 'urn:myNamespace', 'testSimpleType1' );
|
||||
|
||||
|
||||
ok($xml = $type->serialize( 'test', 1 , $serializer_options ),
|
||||
"serialize simple Type"
|
||||
);
|
||||
|
||||
# print $xml;
|
||||
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, '<test type="tns:testSimpleType1">1</test>',
|
||||
"content compare" );
|
||||
};
|
||||
|
||||
$type = $types->find_type( 'urn:myNamespace', 'testSimpleList' );
|
||||
ok($xml = $type->serialize( 'testList', [ 1, 2, 3 ] , $serializer_options ),
|
||||
"serialize simple list type"
|
||||
);
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, '<testList type="tns:testSimpleList">1 2 3</testList>',
|
||||
"content compare" );
|
||||
};
|
||||
|
||||
$type = $types->find_element( 'urn:myNamespace', 'TestElement' );
|
||||
|
||||
ok($xml = $type->serialize( undef, 1 , $serializer_options ),
|
||||
"serialize simple element");
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, '<TestElement type="xsd:int">1</TestElement>',
|
||||
"content compare" );
|
||||
};
|
||||
|
||||
ok( $xml = $types->find_type( 'urn:myNamespace', 'length3')->serialize(
|
||||
'TestComplex', { size => -13, unit => 'BLA' } ,
|
||||
$serializer_options
|
||||
),
|
||||
"serialize complex type");
|
||||
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, q{
|
||||
<TestComplex type="tns:length3">
|
||||
<size type="xsd:non-positive-integer">-13</size>
|
||||
<unit type="xsd:NMTOKEN">BLA</unit>
|
||||
</TestComplex>},
|
||||
"content compare" );
|
||||
};
|
||||
|
||||
ok($xml = $types->find_element( 'urn:myNamespace', 'TestElementComplexType')
|
||||
->serialize(
|
||||
undef, { size => -13, unit => 'BLA' } , $serializer_options ),
|
||||
"serialize element with complex type"
|
||||
);
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, q{
|
||||
<TestElementComplexType type="tns:length3">
|
||||
<size type="xsd:non-positive-integer">-13</size>
|
||||
<unit type="xsd:NMTOKEN">BLA</unit>
|
||||
</TestElementComplexType>
|
||||
},
|
||||
"content compare" );
|
||||
};
|
||||
|
||||
|
||||
ok($xml = $types->find_type( 'urn:myNamespace', 'complex')->serialize(
|
||||
'complexComplex',
|
||||
{ 'length' => { size => -13, unit => 'BLA' }, 'int' => 1 },
|
||||
$serializer_options ),
|
||||
"serialize complex type with complex content"
|
||||
);
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, q{
|
||||
<complexComplex type="tns:complex">
|
||||
<length type="tns:length3">
|
||||
<size type="xsd:non-positive-integer">-13</size>
|
||||
<unit type="xsd:NMTOKEN">BLA</unit>
|
||||
</length>
|
||||
<int type="xsd:int">1</int>
|
||||
</complexComplex>
|
||||
},
|
||||
"content compare" );
|
||||
}
|
||||
ok($xml = $wsdl->find_message('urn:myNamespace', 'testRequest')
|
||||
->get_part()->[0]->serialize(
|
||||
undef, { length => { size => -13, unit => 'BLA' } , int => 3 },
|
||||
$serializer_options ),
|
||||
"serialize part"
|
||||
);
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $xml, q{
|
||||
<test type="tns:complex">
|
||||
<length type="tns:length3">
|
||||
<size type="xsd:non-positive-integer">-13</size>
|
||||
<unit type="xsd:NMTOKEN">BLA</unit>
|
||||
</length>
|
||||
<int type="xsd:int">3</int>
|
||||
</test>
|
||||
},
|
||||
"content compare")
|
||||
};
|
||||
|
||||
my $opt = {
|
||||
typelib => $types,
|
||||
readable => 1,
|
||||
autotype => 0,
|
||||
namespace => { 'urn:myNamespace' => 'tns',
|
||||
'http://www.w3.org/2001/XMLSchema' => 'xsd',
|
||||
'http://schemas.xmlsoap.org/wsdl/' => 'wsdl',
|
||||
},
|
||||
indent => "",
|
||||
wsdl => $wsdl,
|
||||
};
|
||||
|
||||
# ok $wsdl->explain($opt) =~ m/#optional/m;
|
||||
|
||||
sub skip_without_test_xml {
|
||||
skip("Test::XML not available", 1) if (not $Test::XML::VERSION);
|
||||
}
|
||||
|
||||
sub xml
|
||||
{
|
||||
return q{<?xml version="1.0"?>
|
||||
<definitions name="simpleType"
|
||||
targetNamespace="urn:myNamespace"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="urn:myNamespace"
|
||||
xmlns:xsd="http://www.w3c.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:myNamespace">
|
||||
<xsd:complexType name="length3">
|
||||
<xsd:all>
|
||||
<xsd:element name="size" type="xsd:non-positive-integer"/>
|
||||
<xsd:element name="unit" type="xsd:NMTOKEN"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="complex">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="length" type="tns:length3"/>
|
||||
<xsd:element name="int" type="xsd:int"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="TestElement" type="xsd:int"/>
|
||||
<xsd:element name="TestElementComplexType" type="tns:length3"/>
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:restriction base="int">
|
||||
<xsd:enumeration value="1"/>
|
||||
<xsd:enumeration value="2"/>
|
||||
<xsd:enumeration value="3"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testSimpleList">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:list itemType="int">
|
||||
</xsd:list>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="testSimpleUnion">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType Union test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="int float">
|
||||
</xsd:union>
|
||||
</xsd:simpleType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="test" type="tns:complex"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testRequest2">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse2">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
<operation name="test2">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest2"/>
|
||||
<output message="tns:testResponse2"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort3">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<operation name="test">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<binding type="tns:testPort2" name="testBinding2">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<binding type="tns:testPort3" name="testBinding3">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
<port name="testPort2" binding="tns:testBinding2">
|
||||
<soap:address location="http://127.0.0.1/testPort2" />
|
||||
</port>
|
||||
</service>
|
||||
<service name="testService2">
|
||||
<port name="testPort3" binding="tns:testBinding3">
|
||||
<soap:address location="http://127.0.0.1/testPort3" />
|
||||
</port>
|
||||
|
||||
</service>
|
||||
</definitions>
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
289
t/003_sax_serializer.t
Normal file
289
t/003_sax_serializer.t
Normal file
@@ -0,0 +1,289 @@
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use Benchmark;
|
||||
use XML::LibXML;
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(), "Object creation");
|
||||
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
|
||||
my $schema = $wsdl->first_types();
|
||||
|
||||
my $opt = {
|
||||
readable => 0,
|
||||
autotype => 1,
|
||||
namespace => $wsdl->get_xmlns(),
|
||||
indent => "\t",
|
||||
typelib => $schema,
|
||||
};
|
||||
|
||||
is( $schema->find_type( 'myNamespace', 'testSimpleType1' )->serialize(
|
||||
'test', 1 , $opt ),
|
||||
q{<test type="tns:testSimpleType1">1</test>} , "serialize simple type");
|
||||
|
||||
is( $schema->find_type( 'myNamespace', 'testSimpleList' )->serialize(
|
||||
'testList', [ 1, 2, 3 ] , $opt),
|
||||
q{<testList type="tns:testSimpleList">1 2 3</testList>},
|
||||
"serialize simple list type"
|
||||
);
|
||||
|
||||
is( $schema->find_element( 'myNamespace', 'TestElement' )->serialize(
|
||||
undef, 1 , $opt),
|
||||
q{<TestElement type="xsd:int">1</TestElement>}, "Serialize element"
|
||||
);
|
||||
|
||||
$opt->{ readable } = 0;
|
||||
|
||||
is( $schema->find_type( 'myNamespace', 'length3')->serialize(
|
||||
'TestComplex', { size => -13, unit => 'BLA' } ,
|
||||
$opt ),
|
||||
q{<TestComplex type="tns:length3">}
|
||||
. q{<size type="xsd:non-positive-integer">-13</size>}
|
||||
. q{<unit type="xsd:NMTOKEN">BLA</unit></TestComplex>}
|
||||
, "serialize complex type" );
|
||||
|
||||
is( $schema->find_element( 'myNamespace', 'TestElementComplexType')->serialize(
|
||||
undef, { size => -13, unit => 'BLA' } ,
|
||||
$opt ),
|
||||
q{<TestElementComplexType type="tns:length3">}
|
||||
. q{<size type="xsd:non-positive-integer">-13</size>}
|
||||
. q{<unit type="xsd:NMTOKEN">BLA</unit></TestElementComplexType>},
|
||||
"element with complex type"
|
||||
);
|
||||
|
||||
is( $schema->find_type( 'myNamespace', 'complex')->serialize(
|
||||
'complexComplex',
|
||||
{ 'length' => { size => -13, unit => 'BLA' }, 'int' => 1 },
|
||||
$opt ),
|
||||
q{<complexComplex type="tns:complex">}
|
||||
. q{<length type="tns:length3">}
|
||||
. q{<size type="xsd:non-positive-integer">-13</size>}
|
||||
. q{<unit type="xsd:NMTOKEN">BLA</unit></length>}
|
||||
. q{<int type="xsd:int">1</int></complexComplex>},
|
||||
"nested complex type"
|
||||
);
|
||||
|
||||
is( $wsdl->find_message('myNamespace', 'testRequest')->first_part()->serialize(
|
||||
undef, { length => { size => -13, unit => 'BLA' } , int => 3 },
|
||||
$opt ),
|
||||
q{<test type="tns:complex">}
|
||||
. q{<length type="tns:length3">}
|
||||
. q{<size type="xsd:non-positive-integer">-13</size>}
|
||||
. q{<unit type="xsd:NMTOKEN">BLA</unit>}
|
||||
. q{</length><int type="xsd:int">3</int></test>}
|
||||
, "Message part"
|
||||
);
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
foreach my $service (@{ $wsdl->service() })
|
||||
{
|
||||
print "Service: ", $service->name(), "\n";
|
||||
|
||||
foreach my $port( @{ $service->port() })
|
||||
{
|
||||
print " ", "port name: ", $port->name, "\n";
|
||||
print " ", "binding: ", $port->binding(), "\n";
|
||||
print " ", "location: ", $port->location,"\n";
|
||||
my $portType = $wsdl->get_portType(
|
||||
$wsdl->get_binding( $port->binding() )->type()
|
||||
);
|
||||
foreach my $operation ( @{ $portType->operation() } )
|
||||
{
|
||||
print " ", "Operation name: ", $operation->name(), "\n";
|
||||
print " ", "Input message: ",
|
||||
$operation->input()->message(), "\n"
|
||||
if ($operation->input());
|
||||
my $input = $wsdl->get_message( $operation->input()->message() );
|
||||
print " ", "Type: ", $input->name(), "\n";
|
||||
|
||||
print " ", "Output message: ",
|
||||
$operation->output()->message(), "\n"
|
||||
if ($operation->output());
|
||||
my $output = $wsdl->get_message( $operation->output()->message() );
|
||||
print " ", "Type: ", $output->name(), "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub xml
|
||||
{
|
||||
return q{<?xml version="1.0"?>
|
||||
<definitions name="simpleType"
|
||||
targetNamespace="myNamespace"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="myNamespace"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="myNamespace">
|
||||
<xsd:complexType name="length3">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="size" type="xsd:non-positive-integer"/>
|
||||
<xsd:element name="unit" type="xsd:NMTOKEN"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="complex">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="length" type="tns:length3"/>
|
||||
<xsd:element name="int" type="xsd:int"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="TestElement" type="xsd:int"/>
|
||||
<xsd:element name="TestElementComplexType" type="tns:length3"/>
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:restriction base="int">
|
||||
<xsd:enumeration value="1"/>
|
||||
<xsd:enumeration value="2"/>
|
||||
<xsd:enumeration value="3"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testSimpleList">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:list itemType="int">
|
||||
</xsd:list>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="testSimpleUnion">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType Union test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="int float">
|
||||
</xsd:union>
|
||||
</xsd:simpleType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="test" type="tns:complex"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testRequest2">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse2">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
<operation name="test2">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest2"/>
|
||||
<output message="testResponse2"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort3">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="testPort2" name="testBinding2">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="testPort3" name="testBinding3">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
<port name="testPort2" binding="testBinding2">
|
||||
<soap:address location="http://127.0.0.1/testPort2" />
|
||||
</port>
|
||||
<port name="testPort3" binding="testBinding3">
|
||||
<soap:address location="http://127.0.0.1/testPort3" />
|
||||
</port>
|
||||
|
||||
</service>
|
||||
</definitions>
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
413
t/004_sax_wsdl.t
Normal file
413
t/004_sax_wsdl.t
Normal file
@@ -0,0 +1,413 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
# use Devel::Profiler;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::SAX::ParserFactory;
|
||||
use Benchmark;
|
||||
|
||||
use diagnostics;
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML;
|
||||
};
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(), "Object creation");
|
||||
|
||||
#my $parser = XML::SAX::ParserFactory->parser(
|
||||
# Handler => $filter
|
||||
#);
|
||||
|
||||
use XML::LibXML;
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
#timethis 10, sub { $parser->parse_string( xml() ) };
|
||||
#__END__
|
||||
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
my $schema = $wsdl->get_types()->[0]->get_schema()->[0] || die "No schema !";
|
||||
|
||||
my $opt = {
|
||||
typelib => $wsdl->first_types,
|
||||
readable => 1,
|
||||
autotype => 0,
|
||||
namespace => { 'http://www.example.org/MessageGateway2/' => 'tns',
|
||||
'http://www.w3.org/2001/XMLSchema' => 'xsd',
|
||||
'http://schemas.xmlsoap.org/wsdl/' => 'wsdl',
|
||||
},
|
||||
indent => "",
|
||||
};
|
||||
|
||||
my $data = {
|
||||
MMessage => {
|
||||
MRecipientURI => 'anyURI',
|
||||
MSenderAddress => 'a string',
|
||||
MMessageContent => 'a string',
|
||||
MSubject => 'a string',
|
||||
MDeliveryReportRecipientURI => 'anyURI',
|
||||
MKeepalive => {
|
||||
MKeepaliveTimeout => 1234567,
|
||||
MKeepaliveErrorPolicy => ' ( suppress | report ) ',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SKIP: { skip_without_test_xml();
|
||||
is_xml( $wsdl->find_message(
|
||||
"http://www.example.org/MessageGateway2/" ,'EnqueueMessageRequest'
|
||||
)->first_part()->serialize( 'test', $data, $opt ),
|
||||
xml_message()
|
||||
, "Serialized message part"
|
||||
);
|
||||
}
|
||||
|
||||
sub skip_without_test_xml {
|
||||
skip("Test::XML not available", 1) if (not $Test::XML::VERSION);
|
||||
}
|
||||
|
||||
sub xml_message {
|
||||
return
|
||||
q{<EnqueueMessage>
|
||||
<MMessage>
|
||||
<MRecipientURI>anyURI</MRecipientURI>
|
||||
<MSenderAddress>a string</MSenderAddress>
|
||||
<MMessageContent>a string</MMessageContent>
|
||||
<MSubject>a string</MSubject>
|
||||
<MDeliveryReportRecipientURI>anyURI</MDeliveryReportRecipientURI>
|
||||
<MKeepalive>
|
||||
<MKeepaliveTimeout>1234567</MKeepaliveTimeout>
|
||||
<MKeepaliveErrorPolicy> ( suppress | report ) </MKeepaliveErrorPolicy>
|
||||
</MKeepalive>
|
||||
</MMessage>
|
||||
</EnqueueMessage>
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
sub xml {
|
||||
return q{<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="MessageGateway"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/">
|
||||
|
||||
<xsd:element name="EnqueueMessage" type="tns:TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A type containing all elements of a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MRecipientURI" type="xsd:anyURI" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
The recipient in URI notaitions. Valid URI schemas are: mailto:, sms:,
|
||||
phone:. Not all URI schemas need to be implemented at the current
|
||||
implementation stage.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSenderAddress" type="xsd:string" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
E-Mail sender address. Ignored for all but mailto: recipient URIs.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MMessageContent" type="xsd:string" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Message Content.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSubject" type="xsd:string" minOccurs="0" maxOccurs="1">
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Message Subject. Ignored for all but mailto: URIs
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MDeliveryReportRecipientURI" type="xsd:anyURI" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
URI to send a delivery report to. May be of one of the following schemes:
|
||||
mailto:, http:, https:. Reports to mailto: URIs are sent as plaintext,
|
||||
reports to http(s) URIs are sent as SOAP requests following the
|
||||
MessageGatewayClient service definition.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepalive" type="tns:TKeepalive" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Container for keepalive information. May be missing.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepalive">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing keeplive information.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
|
||||
<xsd:element name="MKeepaliveTimeout" type="xsd:double">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Keepalive timeout. The keepalive timeout spezifies how long the sending of
|
||||
a message will be delayed waiting for keepalive updates. If a keepalive
|
||||
update is received during this period, the timeout will be reset. If not,
|
||||
the message will be sent after the timeout has expired.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepaliveErrorPolicy" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
Policy to comply to in case of system errors. Valid values are "suppress"
|
||||
and "report". If the policy is set to "suppress", keepalive messages will
|
||||
not be sent to their recipients in case of partial system failure, even if
|
||||
the keepalive has expired. This may result in "false negatives", i.e.
|
||||
messages may not be sent, even though their keepalive has expired. If the
|
||||
value is "report", keepalive messages will be sent from any cluster node.
|
||||
This may result in "false positive" alerts.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="suppress"></xsd:enumeration>
|
||||
<xsd:enumeration value="report"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing a message ID.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Type containing all elements of a keppalive update / remove request.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The ID for the message to update / remove
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="MAction" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The action to perform. Valid values are: "remove", "update". On "remove",
|
||||
the message with the ID specified will be removed from the queue, thus it
|
||||
will never be sent, even if it's timeout expires. On "update" the
|
||||
keepalive timeout of the corresponding message will be reset.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="remove"></xsd:enumeration>
|
||||
<xsd:enumeration value="update"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="KeepaliveMessage" type="tns:TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Keepalive message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="KeepaliveMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Response element for a keepalive request</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="EnqueueMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message response element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:complexType name="TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessage" type="tns:TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The keepalive message to process.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MKeepaliveMessage" type="tns:TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a keepalive message to process.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="EnqueueMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessage">
|
||||
<wsdl:documentation>inputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name="EnqueueMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessageResponse">
|
||||
<wsdl:documentation>outputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessage">
|
||||
|
||||
<wsdl:documentation>input parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessageResponse">
|
||||
<wsdl:documentation>output parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="MGWPortType">
|
||||
<wsdl:documentation>
|
||||
generic port type for all methods required for sending messages over the mosaic
|
||||
message gatewa
|
||||
</wsdl:documentation>
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to enqueue a normal (immediate send) or a delayed message with
|
||||
keepalive functionality.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:EnqueueMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:EnqueueMessageResponse"></wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to update or remove a
|
||||
keepalive message.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:KeepaliveMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:KeepaliveMessageResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="MGWBinding" type="tns:MGWPortType">
|
||||
<wsdl:documentation>Generic binding for all (SOAP) port</wsdl:documentation>
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<soap:operation soapAction="http://www.example.org/MessageGateway2/EnqueueMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/MessageGateway2/KeepaliveMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="MessageGateway">
|
||||
<wsdl:documentation>
|
||||
Web Service for sending messages over the mosaic message gatewa
|
||||
</wsdl:documentation>
|
||||
|
||||
<wsdl:port name="HTTPPort" binding="tns:MGWBinding">
|
||||
<wsdl:documentation>HTTP(S) port for the mosaic message gatewa</wsdl:documentation>
|
||||
<soap:address location="https://www.example.org/MessageGateway/" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>};
|
||||
}
|
||||
257
t/005_sax_contributed_wsdl.t
Normal file
257
t/005_sax_contributed_wsdl.t
Normal file
@@ -0,0 +1,257 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::LibXML;
|
||||
use Benchmark;
|
||||
|
||||
use diagnostics;
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(), "Object creation");
|
||||
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
my $opt = {
|
||||
namespace => $wsdl->get_xmlns(),
|
||||
style => 'perl',
|
||||
wsdl => $wsdl,
|
||||
readable => 1,
|
||||
};
|
||||
|
||||
my $txt;
|
||||
ok( $txt = $wsdl->explain( $opt ) , "explain WSDL" );
|
||||
|
||||
# print $txt;
|
||||
|
||||
sub xml {
|
||||
return q{<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://example.com/soap/services/ETest/impl"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:apachesoap="http://xml.apache.org/xml-soap"
|
||||
xmlns:impl="http://example.com/soap/services/ETest/impl"
|
||||
xmlns:intf="http://example.com/soap/services/ETest"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tns1="urn:ETest"
|
||||
xmlns:tns2="urn:acquisition"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<wsdl:types>
|
||||
<schema targetNamespace="urn:ETest" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="CreationBaseData">
|
||||
<sequence>
|
||||
<element name="createdBy" nillable="true" type="xsd:long" />
|
||||
<element name="creationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateCenter" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateLocal" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updatedBy" nillable="true" type="xsd:long" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="CreationData">
|
||||
<complexContent>
|
||||
<extension base="tns1:CreationBaseData">
|
||||
<sequence>
|
||||
<element name="creatorFullName" nillable="true" type="xsd:string" />
|
||||
<element name="modifierFullName" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</extension>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
<complexType abstract="true" name="EProductData">
|
||||
<sequence>
|
||||
<element name="EStatus" nillable="true" type="xsd:string" />
|
||||
<element name="EStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="SFXID" nillable="true" type="xsd:string" />
|
||||
<element name="activationFromDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activationToDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="canEditSFXID" type="xsd:boolean" />
|
||||
<element name="concurrentNumberOfUsers" nillable="true" type="xsd:int" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="deleteable" type="xsd:boolean" />
|
||||
<element name="ETestCode" nillable="true" type="xsd:string" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="mainContact" nillable="true" type="xsd:string" />
|
||||
<element name="metaLibID" nillable="true" type="xsd:string" />
|
||||
<element name="otherID" nillable="true" type="xsd:string" />
|
||||
<element name="otherSource" nillable="true" type="xsd:string" />
|
||||
<element name="privateNote" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatus" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatusUpdateDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="procurementStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="sourceInstanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryName" nillable="true" type="xsd:string" />
|
||||
<element name="updateTarget" nillable="true" type="xsd:string" />
|
||||
<element name="workExpressionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="EProductInformation">
|
||||
<sequence>
|
||||
<element name="acquisitions" nillable="true"
|
||||
type="impl:ArrayOf_tns2_AcquisitionData" />
|
||||
<element name="data" nillable="true" type="tns1:EProductData" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="urn:acquisition" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="AcquisitionCommonData">
|
||||
<sequence>
|
||||
<element name="budgets" nillable="true" type="xsd:string" />
|
||||
<element name="campusCode" nillable="true" type="xsd:string" />
|
||||
<element name="concurrentUsersNote" nillable="true" type="xsd:string" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instituteCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="AcquisitionData">
|
||||
<sequence>
|
||||
<element name="ILSSubscriptionNo" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCode" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCommonData" nillable="true"
|
||||
type="tns2:AcquisitionCommonData" />
|
||||
<element name="acquisitionMethod" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionNumber" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatus" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatusDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="advanceNoticeDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="autoRenewal" nillable="true" type="xsd:boolean" />
|
||||
<element name="consortialAgreement" type="xsd:boolean" />
|
||||
<element name="discountOnPrice" nillable="true" type="xsd:int" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="materialType" nillable="true" type="xsd:string" />
|
||||
<element name="noteForILS" nillable="true" type="xsd:string" />
|
||||
<element name="noteForVendor" nillable="true" type="xsd:string" />
|
||||
<element name="noticePeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="numberOfCopies" nillable="true" type="xsd:int" />
|
||||
<element name="orderDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="orderForm" nillable="true" type="xsd:string" />
|
||||
<element name="orderSendMethod" nillable="true" type="xsd:string" />
|
||||
<element name="pooledConcurrentUsers" nillable="true" type="xsd:int" />
|
||||
<element name="price" nillable="true" type="xsd:double" />
|
||||
<element name="pricingCap" nillable="true" type="xsd:int" />
|
||||
<element name="pricingCapFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingCapTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingModel" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationNote" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationRestriction" type="xsd:boolean" />
|
||||
<element name="printPurchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="purchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="renewallOrCancellationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="renewallOrCancellationDescisionNote" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForILS" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForVendor" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="subscriptionNotification" nillable="true" type="xsd:int" />
|
||||
<element name="subscriptionPeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionType" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionTypeNote" nillable="true" type="xsd:string" />
|
||||
<element name="vendorAdvancedNotice" nillable="true" type="xsd:int" />
|
||||
<element name="vendorAdvancedNoticeVal" nillable="true" type="xsd:string" />
|
||||
<element name="vendorCode" nillable="true" type="xsd:string" />
|
||||
<element name="vendorName" nillable="true" type="xsd:string" />
|
||||
<element name="vendorSubscriptionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="http://example.com/soap/services/ETest/impl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="ArrayOf_tns2_AcquisitionData">
|
||||
<complexContent>
|
||||
<restriction base="soapenc:Array">
|
||||
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:AcquisitionData[]" />
|
||||
</restriction>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
</schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="getETestResponse">
|
||||
<wsdl:part name="getETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestResponse">
|
||||
<wsdl:part name="getFixedETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestRequest"></wsdl:message>
|
||||
<wsdl:message name="getETestRequest">
|
||||
<wsdl:part name="indexName" type="xsd:string" />
|
||||
<wsdl:part name="indexValue" type="xsd:string" />
|
||||
<wsdl:part name="withStatus" type="xsd:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="ETestWeb">
|
||||
<wsdl:operation name="getETest" parameterOrder="indexName indexValue withStatus">
|
||||
<wsdl:input message="impl:getETestRequest" name="getETestRequest" />
|
||||
<wsdl:output message="impl:getETestResponse" name="getETestResponse" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdl:input message="impl:getFixedETestRequest" name="getFixedETestRequest" />
|
||||
<wsdl:output message="impl:getFixedETestResponse"
|
||||
name="getFixedETestResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="ETestSoapBinding" type="impl:ETestWeb">
|
||||
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="getETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getFixedETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getFixedETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="ETestWebService">
|
||||
<wsdl:port binding="impl:ETestSoapBinding" name="ETest">
|
||||
<wsdlsoap:address location="http://example.com/soap/services/ETest" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
};
|
||||
}
|
||||
70
t/006_client.t
Normal file
70
t/006_client.t
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Pod::Simple::Text;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::SAX::ParserFactory;
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML
|
||||
};
|
||||
|
||||
use diagnostics;
|
||||
|
||||
use Cwd;
|
||||
|
||||
my $path = cwd;
|
||||
$path =~s|\/t\/?$||; # allow running from t/ and above (Build test)
|
||||
|
||||
use_ok(qw/SOAP::WSDL::Client/);
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new(
|
||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
||||
)->wsdlinit();
|
||||
|
||||
$soap->servicename('MessageGateway');
|
||||
|
||||
ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" );
|
||||
ok( $soap->readable( 1 ) , "Set readable");
|
||||
ok( $soap->explain() );
|
||||
|
||||
|
||||
my $pod = Pod::Simple::Text->new();
|
||||
my $output;
|
||||
$pod->output_string( \$output );
|
||||
$pod->parse_string_document( $soap->explain() );
|
||||
|
||||
# print $output;
|
||||
|
||||
SKIP: {
|
||||
skip_without_test_xml();
|
||||
is_xml( $soap->call( 'EnqueueMessage' ,
|
||||
'MMessage' => {
|
||||
'MRecipientURI' => 'mailto:test@example.com' ,
|
||||
'MMessageContent' => 'TestContent for Message' ,
|
||||
}
|
||||
)
|
||||
, q{<SOAP-ENV:Envelope
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
<SOAP-ENV:Body ><EnqueueMessage><MMessage>
|
||||
<MRecipientURI>mailto:test@example.com</MRecipientURI>
|
||||
<MMessageContent>TestContent for Message</MMessageContent>
|
||||
</MMessage></EnqueueMessage></SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
||||
, "content comparison with optional elements");
|
||||
}
|
||||
|
||||
sub skip_without_test_xml {
|
||||
my $number = shift || 1;
|
||||
skip("Test::XML not available", $number) if (not $Test::XML::VERSION);
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
36
t/007_envelope.t
Normal file
36
t/007_envelope.t
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More qw/no_plan/;
|
||||
use lib '../lib';
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML;
|
||||
};
|
||||
|
||||
use_ok qw/SOAP::WSDL::Envelope/;
|
||||
|
||||
my $opt = {
|
||||
readable => 1,
|
||||
namespace => {
|
||||
},
|
||||
};
|
||||
my $xml;
|
||||
ok( $xml = SOAP::WSDL::Envelope->serialize(
|
||||
undef, undef, $opt
|
||||
),
|
||||
"serialize empty envelope"
|
||||
);
|
||||
|
||||
SKIP: {
|
||||
skip 'Cannot test XML content without Test::XML', 1
|
||||
if (not $Test::XML::VERSION);
|
||||
is_xml( $xml, q{<SOAP-ENV:Envelope
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
<SOAP-ENV:Body >
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>}
|
||||
, 'Content comparison' );
|
||||
}
|
||||
31
t/008_client_wsdl_complexType.t
Normal file
31
t/008_client_wsdl_complexType.t
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use lib '../lib';
|
||||
use diagnostics;
|
||||
|
||||
use Cwd;
|
||||
|
||||
my $path = cwd;
|
||||
$path =~s|\/t\/?$||; # allow running from t/ and above (Build test)
|
||||
|
||||
use_ok(qw/SOAP::WSDL::Client/);
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new(
|
||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/008_complexType.wsdl'
|
||||
)->wsdlinit();
|
||||
|
||||
my $wsdl = $soap->{ _WSDL }->{ wsdl_definitions };
|
||||
my $schema = $wsdl->first_types();
|
||||
my $type = $schema->find_type('Test' , 'testComplexTypeAll');
|
||||
my $element = $type->get_element()->[0];
|
||||
|
||||
is $element->get_minOccurs() , 0, "minOccurs default for all";
|
||||
is $element->get_maxOccurs() , 1, "maxOccurs default for all";
|
||||
|
||||
$type = $schema->find_type('Test' , 'testComplexTypeSequence');
|
||||
$element = $type->get_element()->[0];
|
||||
|
||||
is $element->get_minOccurs() , 1, "minOccurs default for sequence";
|
||||
is $element->get_maxOccurs() , 1, "maxOccurs default for sequence";
|
||||
111
t/009_data_classes.t
Normal file
111
t/009_data_classes.t
Normal file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/perl -w
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
#use Devel::Profiler bad_pkgs => [
|
||||
# qw(UNIVERSAL Time::HiRes B Carp Exporter Cwd Config CORE DynaLoader
|
||||
# XSLoader AutoLoader
|
||||
# Class::Std SOAP::Lite) ];
|
||||
|
||||
use Scalar::Util;
|
||||
use strict;
|
||||
use Test::Differences;
|
||||
use lib 't/lib';
|
||||
use lib '../lib';
|
||||
use lib 'lib';
|
||||
use Benchmark;
|
||||
use XML::Simple;
|
||||
use SOAP::WSDL::SAX::WSDLHandler;
|
||||
use Cwd;
|
||||
use XML::LibXML::SAX;
|
||||
use_ok(qw/SOAP::WSDL::SAX::MessageHandler/);
|
||||
|
||||
use SOAP::WSDL::Client;
|
||||
use SOAP::WSDL::XSD::Typelib::Builtin;
|
||||
my $path = cwd;
|
||||
$path =~s|\/t\/?$||; # allow running from t/ and above (Build test)
|
||||
|
||||
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
|
||||
|
||||
my $filter;
|
||||
ok($filter = SOAP::WSDL::SAX::MessageHandler->new( {
|
||||
class_resolver => FakeResolver->new(),
|
||||
} ), "Object creation");
|
||||
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
$parser->parse_string( xml() );
|
||||
|
||||
# print $filter->get_data();
|
||||
# print $filter->get_data()->get_MMessage()->_DUMP();
|
||||
|
||||
if($filter->get_data()->get_MMessage()->get_MDeliveryReportRecipientURI()) {
|
||||
pass "bool context overloading";
|
||||
}
|
||||
else
|
||||
{
|
||||
fail "bool context overloading"
|
||||
}
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new(
|
||||
wsdl => 'file:///' . $path .'/t/acceptance/wsdl/006_sax_client.wsdl',
|
||||
)->wsdlinit();
|
||||
|
||||
$soap->servicename('MessageGateway');
|
||||
|
||||
ok( $soap->no_dispatch( 1 ) , "Set no_dispatch" );
|
||||
ok( $soap->readable( 0 ) , "Set readable");
|
||||
|
||||
# print $soap->call( 'EnqueueMessage'
|
||||
# , MMessage => $filter->get_data()->get_MMessage() );
|
||||
|
||||
timethese 1000, {
|
||||
'ClassParser' => sub { $parser->parse_string( xml() ); },
|
||||
# 'HashParser' => sub { $hash_parser->parse_string( xml() ); },
|
||||
'XML::Simple' => sub { return XMLin( xml() ) },
|
||||
# 'SOAP::WSDL::Client->call' => sub {
|
||||
# $soap->call( 'EnqueueMessage'
|
||||
# , MMessage => $filter->get_data()->get_MMessage() );
|
||||
# }
|
||||
};
|
||||
|
||||
sub xml {
|
||||
q{<SOAP-ENV:Envelope
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
<SOAP-ENV:Body ><EnqueueMessage><MMessage>
|
||||
<MRecipientURI>mailto:test@example.com</MRecipientURI>
|
||||
<MMessageContent>TestContent for Message</MMessageContent>
|
||||
<MMessageContent>TestContent for Message 2</MMessageContent>
|
||||
<MSenderAddress>martin.kutter@example.com</MSenderAddress>
|
||||
<MDeliveryReportRecipientURI>mailto:test@example.com</MDeliveryReportRecipientURI>
|
||||
</MMessage></EnqueueMessage></SOAP-ENV:Body></SOAP-ENV:Envelope>};
|
||||
}
|
||||
|
||||
# data classes reside in t/lib/Typelib/
|
||||
BEGIN {
|
||||
package FakeResolver;
|
||||
{
|
||||
my %class_list = (
|
||||
'EnqueueMessage' => 'Typelib::TEnqueueMessage',
|
||||
'EnqueueMessage/MMessage' => 'Typelib::TMessage',
|
||||
'EnqueueMessage/MMessage/MRecipientURI' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||
'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'EnqueueMessage/MMessage/MSenderAddress' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'EnqueueMessage/MMessage/MMessageContent' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
'EnqueueMessage/MMessage/MDeliveryReportRecipientURI' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI',
|
||||
);
|
||||
|
||||
sub new { return bless {}, 'FakeResolver' };
|
||||
|
||||
sub get_class {
|
||||
my $name = join('/', @{ $_[1] });
|
||||
return ($class_list{ $name }) ? $class_list{ $name }
|
||||
: warn "no class found for $name";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
36
t/011_simpleType.t
Normal file
36
t/011_simpleType.t
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/perl
|
||||
use Test::More qw(no_plan);
|
||||
use strict;
|
||||
use lib 'lib/';
|
||||
use lib 't/lib/';
|
||||
use lib '../lib/';
|
||||
|
||||
use_ok qw(MySimpleType);
|
||||
|
||||
# simple type derived from builtin via restriction
|
||||
my $obj = MySimpleType->new({ value => 'test'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
|
||||
, 'inherited class';
|
||||
is $obj, 'test', 'stringification';
|
||||
|
||||
# simple type derived from builtin via list
|
||||
$obj = MySimpleListType->new({ value => [ 'test', 'test2' ]});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
|
||||
, 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::list')
|
||||
, 'inherited class';
|
||||
is $obj, 'test test2', 'stringification';
|
||||
|
||||
# simple type derived from atomic simple type (restriction)
|
||||
$obj = MyAtomicSimpleType->new({ value => 'test' });
|
||||
ok $obj->isa('MySimpleType') , 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
|
||||
, 'inherited class';
|
||||
is $obj, 'test', 'stringification';
|
||||
|
||||
# simple type derived from atomic simple type (list)
|
||||
$obj = MyAtomicSimpleListType->new({ value => [ 'test', 'test2' ] });
|
||||
ok $obj->isa('MySimpleListType') , 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
|
||||
, 'inherited class';
|
||||
is $obj, 'test test2', 'stringification';
|
||||
51
t/012_element.t
Normal file
51
t/012_element.t
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/perl
|
||||
use Test::More qw(no_plan);
|
||||
use strict;
|
||||
use lib 'lib/';
|
||||
use lib '../lib/';
|
||||
use lib 't/lib';
|
||||
|
||||
use_ok qw(SOAP::WSDL::XSD::Typelib::Element);
|
||||
use_ok qw( MyElement );
|
||||
# simple type derived from builtin via restriction
|
||||
my $obj = MyElement->new({ value => 'test'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
|
||||
, 'inherited class';
|
||||
is $obj, '<MyElementName xmlns="urn:Test" >test</MyElementName>', 'stringification';
|
||||
|
||||
$obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => 'Test2'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
, 'inherited class';
|
||||
|
||||
ok $obj->get_test->isa('SOAP::WSDL::XSD::Typelib::Builtin::string')
|
||||
, 'element isa';
|
||||
|
||||
is $obj, '<MyAtomicComplexTypeElement xmlns="urn:Test" ><MyTestElement >Test</MyTestElement>'
|
||||
. '<MyTestElement2 >Test2</MyTestElement2></MyAtomicComplexTypeElement>'
|
||||
, 'stringification';
|
||||
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
# simple type derived from builtin via list
|
||||
$obj = MySimpleListType->new({ value => [ 'test', 'test2' ]});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
|
||||
, 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::list')
|
||||
, 'inherited class';
|
||||
is $obj, 'test test2', 'stringification';
|
||||
|
||||
# simple type derived from atomic simple type (restriction)
|
||||
$obj = MyAtomicSimpleType->new({ value => 'test' });
|
||||
ok $obj->isa('MySimpleType') , 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
|
||||
, 'inherited class';
|
||||
is $obj, 'test', 'stringification';
|
||||
|
||||
# simple type derived from atomic simple type (list)
|
||||
$obj = MyAtomicSimpleListType->new({ value => [ 'test', 'test2' ] });
|
||||
ok $obj->isa('MySimpleListType') , 'inherited class';
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
|
||||
, 'inherited class';
|
||||
is $obj, 'test test2', 'stringification';
|
||||
45
t/013_complexType.t
Normal file
45
t/013_complexType.t
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/perl
|
||||
use Test::More qw(no_plan);
|
||||
use strict;
|
||||
use lib 'lib/';
|
||||
use lib '../lib/';
|
||||
use lib 't/lib';
|
||||
use Data::Dumper;
|
||||
|
||||
use_ok qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
use_ok qw( MyComplexType );
|
||||
# simple type derived from builtin via restriction
|
||||
my $obj = MyComplexType->new({ MyTestName => 'test' });
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
, 'inherited class';
|
||||
is $obj, '<MyElementName >test</MyElementName>', 'stringification';
|
||||
|
||||
$obj = MyComplexType->new({ MyTestName => [ 'test', 'test2' ] });
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
, 'inherited class';
|
||||
is $obj, '<MyElementName >test</MyElementName><MyElementName >test2</MyElementName>',
|
||||
'stringification';
|
||||
|
||||
# try on the fly factory
|
||||
@MyComplexType2::ISA = ('SOAP::WSDL::XSD::Typelib::ComplexType');
|
||||
{
|
||||
use Class::Std::Storable;
|
||||
my %MyTestName_of;
|
||||
|
||||
MyComplexType2->_factory(
|
||||
[ qw(MyTestName) ], # order
|
||||
{ MyTestName => \%MyTestName_of }, # attribute lookup map
|
||||
{ MyTestName => 'MyElement' } # class name lookup map
|
||||
);
|
||||
}
|
||||
|
||||
$obj = MyComplexType2->new({ MyTestName => [ 'test', 'test2' ] });
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
, 'inherited class (on the fly-factory object)';
|
||||
is $obj, '<MyElementName >test</MyElementName><MyElementName >test2</MyElementName>',
|
||||
'stringification (on the fly-factory object)';
|
||||
# print Dumper $obj->get_MyTestName();
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
366
t/014_sax_typelib.t
Normal file
366
t/014_sax_typelib.t
Normal file
@@ -0,0 +1,366 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
# use Devel::Profiler;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::SAX::ParserFactory;
|
||||
use Benchmark;
|
||||
|
||||
use diagnostics;
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML;
|
||||
};
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(), "Object creation");
|
||||
|
||||
use XML::LibXML;
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
for my $element (@{ $wsdl->first_types()->get_schema()->[1]->get_type() } ) {
|
||||
# print Dumper $element;
|
||||
my $output;
|
||||
$element->toClass({ prefix => 'MessageGateway', wsdl => $wsdl,
|
||||
output => \$output
|
||||
});
|
||||
eval "$output";
|
||||
}
|
||||
|
||||
if ($@) {
|
||||
fail "evalling generated class";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass "evalling generated class";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
sub xml {
|
||||
return q{<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="MessageGateway"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/">
|
||||
|
||||
<xsd:element name="EnqueueMessage" type="tns:TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A type containing all elements of a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MRecipientURI" type="xsd:anyURI" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
The recipient in URI notaitions. Valid URI schemas are: mailto:, sms:,
|
||||
phone:. Not all URI schemas need to be implemented at the current
|
||||
implementation stage.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSenderAddress" type="xsd:string" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
E-Mail sender address. Ignored for all but mailto: recipient URIs.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MMessageContent" type="xsd:string" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Message Content.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSubject" type="xsd:string" minOccurs="0" maxOccurs="1">
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Message Subject. Ignored for all but mailto: URIs
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MDeliveryReportRecipientURI" type="xsd:anyURI" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
URI to send a delivery report to. May be of one of the following schemes:
|
||||
mailto:, http:, https:. Reports to mailto: URIs are sent as plaintext,
|
||||
reports to http(s) URIs are sent as SOAP requests following the
|
||||
MessageGatewayClient service definition.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepalive" type="tns:TKeepalive" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Container for keepalive information. May be missing.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepalive">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing keeplive information.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
|
||||
<xsd:element name="MKeepaliveTimeout" type="xsd:double">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Keepalive timeout. The keepalive timeout spezifies how long the sending of
|
||||
a message will be delayed waiting for keepalive updates. If a keepalive
|
||||
update is received during this period, the timeout will be reset. If not,
|
||||
the message will be sent after the timeout has expired.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepaliveErrorPolicy" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
Policy to comply to in case of system errors. Valid values are "suppress"
|
||||
and "report". If the policy is set to "suppress", keepalive messages will
|
||||
not be sent to their recipients in case of partial system failure, even if
|
||||
the keepalive has expired. This may result in "false negatives", i.e.
|
||||
messages may not be sent, even though their keepalive has expired. If the
|
||||
value is "report", keepalive messages will be sent from any cluster node.
|
||||
This may result in "false positive" alerts.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="suppress"></xsd:enumeration>
|
||||
<xsd:enumeration value="report"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing a message ID.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Type containing all elements of a keppalive update / remove request.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The ID for the message to update / remove
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="MAction" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The action to perform. Valid values are: "remove", "update". On "remove",
|
||||
the message with the ID specified will be removed from the queue, thus it
|
||||
will never be sent, even if it's timeout expires. On "update" the
|
||||
keepalive timeout of the corresponding message will be reset.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="remove"></xsd:enumeration>
|
||||
<xsd:enumeration value="update"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="KeepaliveMessage" type="tns:TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Keepalive message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="KeepaliveMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Response element for a keepalive request</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="EnqueueMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message response element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:complexType name="TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessage" type="tns:TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The keepalive message to process.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MKeepaliveMessage" type="tns:TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a keepalive message to process.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="EnqueueMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessage">
|
||||
<wsdl:documentation>inputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name="EnqueueMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessageResponse">
|
||||
<wsdl:documentation>outputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessage">
|
||||
|
||||
<wsdl:documentation>input parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessageResponse">
|
||||
<wsdl:documentation>output parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="MGWPortType">
|
||||
<wsdl:documentation>
|
||||
generic port type for all methods required for sending messages over the mosaic
|
||||
message gatewa
|
||||
</wsdl:documentation>
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to enqueue a normal (immediate send) or a delayed message with
|
||||
keepalive functionality.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:EnqueueMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:EnqueueMessageResponse"></wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to update or remove a
|
||||
keepalive message.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:KeepaliveMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:KeepaliveMessageResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="MGWBinding" type="tns:MGWPortType">
|
||||
<wsdl:documentation>Generic binding for all (SOAP) port</wsdl:documentation>
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<soap:operation soapAction="http://www.example.org/MessageGateway2/EnqueueMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/MessageGateway2/KeepaliveMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="MessageGateway">
|
||||
<wsdl:documentation>
|
||||
Web Service for sending messages over the mosaic message gatewa
|
||||
</wsdl:documentation>
|
||||
|
||||
<wsdl:port name="HTTPPort" binding="tns:MGWBinding">
|
||||
<wsdl:documentation>HTTP(S) port for the mosaic message gatewa</wsdl:documentation>
|
||||
<soap:address location="https://www.example.org/MessageGateway/" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>};
|
||||
}
|
||||
350
t/015_to_typemap.t
Normal file
350
t/015_to_typemap.t
Normal file
@@ -0,0 +1,350 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More qw/no_plan/; # TODO: change to tests => N;
|
||||
use Test::Differences;
|
||||
# use Devel::Profiler;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
use XML::SAX::ParserFactory;
|
||||
use Benchmark;
|
||||
|
||||
use diagnostics;
|
||||
|
||||
eval {
|
||||
require Test::XML;
|
||||
import Test::XML;
|
||||
};
|
||||
|
||||
use_ok(qw/SOAP::WSDL::SAX::WSDLHandler/);
|
||||
|
||||
my $filter;
|
||||
|
||||
ok($filter = SOAP::WSDL::SAX::WSDLHandler->new(), "Object creation");
|
||||
|
||||
use XML::LibXML;
|
||||
my $parser = XML::LibXML->new();
|
||||
$parser->set_handler( $filter );
|
||||
|
||||
eval { $parser->parse_string( xml() ) };
|
||||
if ($@)
|
||||
{
|
||||
fail("parsing WSDL");
|
||||
die "Can't test without parsed WSDL: $@";
|
||||
}
|
||||
else
|
||||
{
|
||||
pass("parsing XML");
|
||||
}
|
||||
|
||||
my $wsdl;
|
||||
ok( $wsdl = $filter->get_data() , "get object tree");
|
||||
|
||||
ok $wsdl->to_typemap( { prefix => 'CP::EAI::Typelib::' } ), 'typemap';
|
||||
exit;
|
||||
|
||||
sub xml {
|
||||
return q{<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="MessageGateway"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/">
|
||||
|
||||
<xsd:element name="EnqueueMessage" type="tns:TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A type containing all elements of a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MRecipientURI" type="xsd:anyURI" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
The recipient in URI notaitions. Valid URI schemas are: mailto:, sms:,
|
||||
phone:. Not all URI schemas need to be implemented at the current
|
||||
implementation stage.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSenderAddress" type="xsd:string" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
E-Mail sender address. Ignored for all but mailto: recipient URIs.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MMessageContent" type="xsd:string" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Message Content.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSubject" type="xsd:string" minOccurs="0" maxOccurs="1">
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Message Subject. Ignored for all but mailto: URIs
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MDeliveryReportRecipientURI" type="xsd:anyURI" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
URI to send a delivery report to. May be of one of the following schemes:
|
||||
mailto:, http:, https:. Reports to mailto: URIs are sent as plaintext,
|
||||
reports to http(s) URIs are sent as SOAP requests following the
|
||||
MessageGatewayClient service definition.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepalive" type="tns:TKeepalive" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Container for keepalive information. May be missing.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepalive">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing keeplive information.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
|
||||
<xsd:element name="MKeepaliveTimeout" type="xsd:double">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Keepalive timeout. The keepalive timeout spezifies how long the sending of
|
||||
a message will be delayed waiting for keepalive updates. If a keepalive
|
||||
update is received during this period, the timeout will be reset. If not,
|
||||
the message will be sent after the timeout has expired.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepaliveErrorPolicy" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
Policy to comply to in case of system errors. Valid values are "suppress"
|
||||
and "report". If the policy is set to "suppress", keepalive messages will
|
||||
not be sent to their recipients in case of partial system failure, even if
|
||||
the keepalive has expired. This may result in "false negatives", i.e.
|
||||
messages may not be sent, even though their keepalive has expired. If the
|
||||
value is "report", keepalive messages will be sent from any cluster node.
|
||||
This may result in "false positive" alerts.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="suppress"></xsd:enumeration>
|
||||
<xsd:enumeration value="report"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing a message ID.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Type containing all elements of a keppalive update / remove request.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The ID for the message to update / remove
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="MAction" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The action to perform. Valid values are: "remove", "update". On "remove",
|
||||
the message with the ID specified will be removed from the queue, thus it
|
||||
will never be sent, even if it's timeout expires. On "update" the
|
||||
keepalive timeout of the corresponding message will be reset.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="remove"></xsd:enumeration>
|
||||
<xsd:enumeration value="update"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="KeepaliveMessage" type="tns:TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Keepalive message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="KeepaliveMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Response element for a keepalive request</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="EnqueueMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message response element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:complexType name="TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessage" type="tns:TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The keepalive message to process.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MKeepaliveMessage" type="tns:TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a keepalive message to process.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="EnqueueMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessage">
|
||||
<wsdl:documentation>inputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name="EnqueueMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessageResponse">
|
||||
<wsdl:documentation>outputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessage">
|
||||
|
||||
<wsdl:documentation>input parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessageResponse">
|
||||
<wsdl:documentation>output parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="MGWPortType">
|
||||
<wsdl:documentation>
|
||||
generic port type for all methods required for sending messages over the mosaic
|
||||
message gatewa
|
||||
</wsdl:documentation>
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to enqueue a normal (immediate send) or a delayed message with
|
||||
keepalive functionality.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:EnqueueMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:EnqueueMessageResponse"></wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to update or remove a
|
||||
keepalive message.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:KeepaliveMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:KeepaliveMessageResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="MGWBinding" type="tns:MGWPortType">
|
||||
<wsdl:documentation>Generic binding for all (SOAP) port</wsdl:documentation>
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<soap:operation soapAction="http://www.example.org/MessageGateway2/EnqueueMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/MessageGateway2/KeepaliveMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="MessageGateway">
|
||||
<wsdl:documentation>
|
||||
Web Service for sending messages over the mosaic message gatewa
|
||||
</wsdl:documentation>
|
||||
|
||||
<wsdl:port name="HTTPPort" binding="tns:MGWBinding">
|
||||
<wsdl:documentation>HTTP(S) port for the mosaic message gatewa</wsdl:documentation>
|
||||
<soap:address location="https://www.example.org/MessageGateway/" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>};
|
||||
}
|
||||
35
t/016_client_object.t
Normal file
35
t/016_client_object.t
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl
|
||||
use Test::More qw(no_plan);
|
||||
use strict;
|
||||
use lib 'lib/';
|
||||
use lib '../lib/';
|
||||
use lib 't/lib';
|
||||
|
||||
use_ok qw(SOAP::WSDL::XSD::Typelib::Element);
|
||||
use_ok qw( MyElement );
|
||||
use_ok qw( SOAP::WSDL::Client );
|
||||
# simple type derived from builtin via restriction
|
||||
|
||||
my $obj = MyAtomicComplexTypeElement->new({ test=> 'Test', test2 => 'Test2'});
|
||||
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType')
|
||||
, 'inherited class';
|
||||
|
||||
ok $obj->get_test->isa('SOAP::WSDL::XSD::Typelib::Builtin::string')
|
||||
, 'element isa';
|
||||
|
||||
is $obj, '<MyAtomicComplexTypeElement xmlns="urn:Test" ><MyTestElement >Test</MyTestElement>'
|
||||
. '<MyTestElement2 >Test2</MyTestElement2></MyAtomicComplexTypeElement>'
|
||||
, 'stringification';
|
||||
|
||||
my $soap = SOAP::WSDL::Client->new();
|
||||
$soap->proxy('http://bla');
|
||||
$soap->no_dispatch(1);
|
||||
|
||||
is $soap->call('Test', $obj), q{<SOAP-ENV:Envelope }
|
||||
. q{xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" }
|
||||
. q{xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >}
|
||||
. q{<SOAP-ENV:Body><MyAtomicComplexTypeElement xmlns="urn:Test" >}
|
||||
. q{<MyTestElement >Test</MyTestElement>}
|
||||
. q{<MyTestElement2 >Test2</MyTestElement2>}
|
||||
. q{</MyAtomicComplexTypeElement></SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
||||
, 'SOAP Envelope generation with objects';
|
||||
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Test;
|
||||
plan tests=> 11;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../lib';
|
||||
use Data::Dumper;
|
||||
use Cwd;
|
||||
|
||||
use SOAP::WSDL;
|
||||
|
||||
ok 1; # if we made it this far, we're ok
|
||||
### test vars END
|
||||
|
||||
print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
print "# Performance test with WSDL file\n";
|
||||
|
||||
my $data = { name => 'Mein Name',
|
||||
givenName => 'Vorname' };
|
||||
|
||||
my $dir = cwd;
|
||||
|
||||
# chomp /t/ to allow running the script from t/ directory
|
||||
$dir=~s|/t/?||;
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
|
||||
{
|
||||
ok( my $soap=SOAP::WSDL->new(
|
||||
wsdl => "file://$dir/t/acceptance/helloworld.asmx.xml",
|
||||
no_dispatch => 1
|
||||
) );
|
||||
|
||||
print "# Test with NO caching\n";
|
||||
print "# Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."ms)\n" ;
|
||||
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
eval{ $soap->wsdlinit(caching => 0) };
|
||||
unless ($@) {
|
||||
ok(1);
|
||||
} else {
|
||||
ok 0;
|
||||
print STDERR $@;
|
||||
}
|
||||
print "# wsdl file init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;;
|
||||
|
||||
$soap->readable(1);
|
||||
$soap->wsdl_cache_store();
|
||||
$soap->servicename("Service1");
|
||||
$soap->portname("Service1Soap");
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok( $soap->call("sayHello" , %{ $data }));
|
||||
print "# NO cache first call: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok($soap->call(sayHello => %{ $data }) );
|
||||
print "# NO cache second call (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
for (1..10) {
|
||||
$soap->call(sayHello => %{ $data });
|
||||
}
|
||||
ok(1);
|
||||
print "# NO cache: 10 x call (".tv_interval ( $t0, [gettimeofday]) ."s)\n";
|
||||
}
|
||||
{
|
||||
print "# Test with caching ENABLED\n";
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok(my $soap=SOAP::WSDL->new(
|
||||
wsdl => "file://$dir/t/acceptance/helloworld.asmx.xml",
|
||||
no_dispatch => 1
|
||||
) );
|
||||
print "# Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."ms)\n" ;
|
||||
-e "$dir/t/cache" or mkdir "$dir/t/cache";
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
eval{ $soap->wsdlinit(caching => 1,cache_directory =>"$dir/t/cache") };
|
||||
unless ($@) {
|
||||
ok(1);
|
||||
} else {
|
||||
ok 0;
|
||||
print STDERR $@;
|
||||
}
|
||||
print "# wsdl file init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;;
|
||||
$soap->readable(1);
|
||||
$soap->servicename("Service1");
|
||||
$soap->portname("Service1Soap");
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok( $soap->call("sayHello" , %{ $data }));
|
||||
print "# CACHE first call (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok($soap->call(sayHello => %{ $data }) );
|
||||
print "# CACHE second call: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
for (1..10) {
|
||||
$soap->call(sayHello => %{ $data });
|
||||
}
|
||||
ok(1);
|
||||
print "# CACHE: 10 x call (".tv_interval ( $t0, [gettimeofday]) ."s)\n";
|
||||
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#######################################################################################
|
||||
#
|
||||
# 2_helloworld.t
|
||||
#
|
||||
# Acceptance test for message encoding, based on .NET wsdl and example code.
|
||||
# SOAP::WSDL's encoding doesn't I<exactly> match the .NET example, because
|
||||
# .NET doesn't always specify types (SOAP::WSDL does), and the namespace
|
||||
# prefixes chosen are different (maybe the encoding style, too ? this would be a bug !)
|
||||
#
|
||||
########################################################################################
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
use Test;
|
||||
plan tests => 5;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../lib';
|
||||
use Cwd;
|
||||
use SOAP::WSDL;
|
||||
ok 1; # if we made it this far, we're ok
|
||||
### test vars END
|
||||
print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
print "# Acceptance test against sample output with simple WSDL\n";
|
||||
|
||||
my $data = {
|
||||
name => 'test',
|
||||
givenName => 'GIVENNAME',
|
||||
test => {
|
||||
name => 'TESTNAME',
|
||||
givenName => 'GIVENNAME',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
my $dir= cwd;
|
||||
$dir=~s/\/t\/?//;
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
ok( my $soap=SOAP::WSDL->new(wsdl => 'file:///'.$dir.'/t/acceptance/test.wsdl.xml',
|
||||
no_dispatch => 1 ) );
|
||||
|
||||
print "# Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
eval{ $soap->wsdlinit() };
|
||||
unless ($@) {
|
||||
ok(1);
|
||||
} else {
|
||||
ok 0;
|
||||
print STDERR $@;
|
||||
}
|
||||
|
||||
print "# WSDL init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
$soap->servicename("Service1");
|
||||
$soap->portname("Service1Soap");
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
|
||||
open (FILE, "acceptance/helloworld.xml")
|
||||
|| open (FILE, "t/acceptance/helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml_test=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
if ( ($xml) && ($xml eq $xml_test) ) {
|
||||
ok 1;
|
||||
print "# Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)\n"
|
||||
} else {
|
||||
ok 0;
|
||||
print "# Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
print "$xml\n$xml_test\n"; };
|
||||
};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
|
||||
open (FILE, "acceptance/helloworld.xml")
|
||||
|| open FILE, ("t/acceptance/helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml_test=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
if ( ($xml) && ($xml eq $xml_test) ) {
|
||||
ok 1;
|
||||
print "# Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)\n";
|
||||
} else {
|
||||
ok 0;
|
||||
print "# Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
print "$xml\n$xml_test\n";
|
||||
};
|
||||
};
|
||||
|
||||
109
t/3_various.t
109
t/3_various.t
@@ -1,109 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
use Test::More tests=> 9;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../lib';
|
||||
use Data::Dumper;
|
||||
use Cwd;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
print "# Various Features Test with WSDL file \n";
|
||||
|
||||
my $data = {name => 'Mein Name',
|
||||
givenName => 'Vorname'};
|
||||
|
||||
my $dir = cwd;
|
||||
|
||||
# chomp /t/ to allow running the script from t/ directory
|
||||
$dir=~s|/t/?||;
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
ok( my $soap=SOAP::WSDL->new(wsdl => "file://$dir/t/acceptance/helloworld.asmx.xml",
|
||||
no_dispatch => 1
|
||||
));
|
||||
|
||||
print "# Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."ms)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
eval{ $soap->wsdlinit(caching => 0) };
|
||||
if ($@) {
|
||||
fail("wsdlinit");
|
||||
print STDERR $@;
|
||||
} else {
|
||||
pass("wsdlinit");
|
||||
}
|
||||
print "# wsdl file init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;;
|
||||
|
||||
$soap->readable(1);
|
||||
$soap->servicename("Service1");
|
||||
$soap->portname("Service1Soap");
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok( $soap->call("sayHello" , %{ $data }), "call sayHello");
|
||||
print "# Normal Call: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$soap->servicename("Service2");
|
||||
is( $soap->portname("Service2Soap"), 'Service2Soap' );
|
||||
|
||||
$data = {name => 'Mein Name',
|
||||
givenName => 'Vorname'};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok($soap->call(sayGoodBye => %{ $data }), "Multiple Services/Port Call" );
|
||||
print "# Multiple Services/Port Call: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$soap->servicename("Service2");
|
||||
$soap->portname("Service2Soap");
|
||||
$data = {name => 'Mein Name',
|
||||
givenName => 'Vorname',
|
||||
wsdl_input_name => 'firstOverload'
|
||||
};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
|
||||
my $xml = $soap->serializer->method( $soap->call(sayGoodByeOverload => %{ $data }) );
|
||||
like($xml , qr/<name/, 'serialized overloaded method');
|
||||
|
||||
$data = {
|
||||
name => 'Mein Name',
|
||||
givenName => 'Vorname',
|
||||
wsdl_input_name => 'secondOverload'
|
||||
};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
$xml = $soap->serializer->method( $soap->call(sayGoodByeOverload => %{ $data }) );
|
||||
unlike($xml , qr/<name/ , 'Overloaded calls');
|
||||
|
||||
print "# Overloaded Calls: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$soap->servicename("Service2");
|
||||
$soap->portname("Service2Soap");
|
||||
$data = { name => 'Mein Name',
|
||||
'recipients' => [
|
||||
{user_name => 'Adam', last_name => "Eden"},
|
||||
{user_name => 'Eve',last_name => 'Apple'},
|
||||
],
|
||||
wsdl_input_name => 'thirdOverload'
|
||||
};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
$xml = $soap->serializer->method( $soap->call(sayGoodByeOverload => %{ $data }) );
|
||||
|
||||
my $xpath = new XML::XPath->new(xml=>$xml);
|
||||
|
||||
my @recipients = $xpath->findnodes('//recipients');
|
||||
if($recipients[0]->findvalue("user_name") eq "Adam" and
|
||||
$recipients[0]->findvalue("last_name") eq "Eden" and
|
||||
$recipients[1]->findvalue("user_name") eq "Eve" and
|
||||
$recipients[1]->findvalue("last_name") eq "Apple"){
|
||||
ok(1);
|
||||
}else{
|
||||
ok(0);
|
||||
}
|
||||
print "# Restricted Arrays: (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
print "#End\n";
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#######################################################################################
|
||||
#
|
||||
# 2_helloworld.t
|
||||
#
|
||||
# Acceptance test for message encoding, based on .NET wsdl and example code.
|
||||
# SOAP::WSDL's encoding doesn't I<exactly> match the .NET example, because
|
||||
# .NET doesn't always specify types (SOAP::WSDL does), and the namespace
|
||||
# prefixes chosen are different (maybe the encoding style, too ? this would be a bug !)
|
||||
#
|
||||
########################################################################################
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
use Test::More tests => 6;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../lib';
|
||||
use Cwd;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
### test vars END
|
||||
print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
print "# Acceptance test against sample output with simple WSDL\n";
|
||||
|
||||
my $data = {
|
||||
name => 'test',
|
||||
givenName => 'GIVENNAME',
|
||||
test => {
|
||||
name => 'TESTNAME',
|
||||
givenName => 'GIVENNAME',
|
||||
},
|
||||
};
|
||||
|
||||
my $dir= cwd;
|
||||
$dir=~s/\/t\/?//;
|
||||
|
||||
# print $dir;
|
||||
my $url = $dir . '/t/acceptance/test.wsdl.xml';
|
||||
die "no wsdl found" if (not -e $url);
|
||||
ok( my $soap=SOAP::WSDL->new( wsdl => 'file:///'. $url ), "Create SOAP::WSDL object");
|
||||
$soap->no_dispatch( 1 );
|
||||
|
||||
eval{ $soap->wsdlinit() };
|
||||
unless ($@) {
|
||||
pass "wsdlinit";
|
||||
} else {
|
||||
fail "wsdlinit - $@";
|
||||
}
|
||||
|
||||
|
||||
ok( $soap->call(sayHello => %{ $data }) , "SOAP call");
|
||||
|
||||
is( $soap->servicename() , 'Service1', "Auto-detected servicename");
|
||||
is( $soap->portname() , 'Service1Soap', "Auto-detected portname");
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
<?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:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld">
|
||||
<s:element name="sayHello">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
|
||||
<s:element name="sayGoodBye">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</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:element name="sayGoodByeResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="sayGoodByeResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:complexType name="contact_detail_list">
|
||||
<s:complexContent>
|
||||
<s:restriction base="soapenc:Array">
|
||||
<s:attribute ref="soapenc:arrayType" wsdl:arrayType="s0:person_detail[]"/>
|
||||
</s:restriction>
|
||||
</s:complexContent>
|
||||
</s:complexType>
|
||||
<s:complexType name="person_detail">
|
||||
<s:all>
|
||||
<s:element name="email_address" type="s:string"/>
|
||||
<s:element name="user_name" type="s:string"/>
|
||||
<s:element name="first_name" type="s:string"/>
|
||||
<s:element name="last_name" type="s:string"/>
|
||||
<s:element name="department" type="s:string"/>
|
||||
<s:element name="id" type="s:string"/>
|
||||
<s:element name="title" type="s:string"/>
|
||||
</s:all>
|
||||
</s:complexType>
|
||||
</s:schema>
|
||||
</types>
|
||||
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<message name="sayGoodByeSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
</message>
|
||||
|
||||
<message name="sayGoodByeSoapInSecond">
|
||||
</message>
|
||||
|
||||
<message name="sayGoodByeSoapInThird">
|
||||
<part name="name" type="s:string" />
|
||||
<part name="recipients" type="s0:contact_detail_list" />
|
||||
</message>
|
||||
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
<part name="parameters" element="s0:sayGoodByeResponse" />
|
||||
</message>
|
||||
|
||||
<message name="sayGoodByeSoapOut">
|
||||
<part name="parameters" element="s0:sayGoodByeResponse" />
|
||||
</message>
|
||||
|
||||
<portType name="Service1Soap">
|
||||
<operation name="sayHello">
|
||||
<input message="s0:sayHelloSoapIn" />
|
||||
|
||||
<output message="s0:sayHelloSoapOut" />
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
|
||||
<portType name="Service2Soap">
|
||||
|
||||
<operation name="sayGoodBye">
|
||||
<input message="s0:sayGoodByeSoapIn" />
|
||||
<output message="s0:sayGoodByeSoapOut" />
|
||||
</operation>
|
||||
|
||||
<operation name="sayGoodByeOverload">
|
||||
<input message="s0:sayGoodByeSoapIn" name="firstOverload" />
|
||||
<output message="s0:sayGoodByeSoapOut" />
|
||||
</operation>
|
||||
|
||||
<operation name="sayGoodByeOverload">
|
||||
<input message="s0:sayGoodByeSoapInSecond" name="secondOverload" />
|
||||
<output message="s0:sayGoodByeSoapOut" />
|
||||
</operation>
|
||||
|
||||
<operation name="sayGoodByeOverload">
|
||||
<input message="s0:sayGoodByeSoapInThird" name="thirdOverload" />
|
||||
<output message="s0:sayGoodByeSoapOut" />
|
||||
</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" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<binding name="Service2Soap" type="s0:Service2Soap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
||||
style="document" />
|
||||
<operation name="sayGoodBye">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayGoodBye" style="document" />
|
||||
<input>
|
||||
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="sayGoodByeOverload">
|
||||
<soap:operation soapAction="urn:HelloWorld#sayGoodBye" style="document" />
|
||||
<input>
|
||||
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
</input>
|
||||
|
||||
<output>
|
||||
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="Service1">
|
||||
<port name="Service1Soap" binding="s0:Service1Soap">
|
||||
<soap:address
|
||||
location="http://helloworld/helloworld.asmx" />
|
||||
</port>
|
||||
</service>
|
||||
<service name="Service2">
|
||||
<port name="Service2Soap" binding="s0:Service2Soap">
|
||||
<soap:address
|
||||
location="http://helloworld/helloworld.asmx" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
1
t/acceptance/results/03_complexType-all.xml
Normal file
1
t/acceptance/results/03_complexType-all.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="tns:testComplexType1"><Test1 xsi:type="xsd:string">Test 1</Test1><Test2 xsi:type="xsd:string">Test 2</Test2></testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/03_complexType-sequence.xml
Normal file
1
t/acceptance/results/03_complexType-sequence.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testSequence xsi:type="tns:testComplexType1"><Test1 xsi:type="xsd:string">Test 1</Test1><Test2 xsi:type="xsd:string">Test 2</Test2></testSequence></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/04_element-simpleType.xml
Normal file
1
t/acceptance/results/04_element-simpleType.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="xsd:string">Test</testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/04_element.xml
Normal file
1
t/acceptance/results/04_element.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="xsd:string">Test</testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/05_simpleType-list.xml
Normal file
1
t/acceptance/results/05_simpleType-list.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="tns:testSimpleType1">1 2</testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/05_simpleType-restriction.xml
Normal file
1
t/acceptance/results/05_simpleType-restriction.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="tns:testSimpleType1">1</testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
1
t/acceptance/results/05_simpleType-union.xml
Normal file
1
t/acceptance/results/05_simpleType-union.xml
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd-WSDL="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><test xmlns="Test"><testAll xsi:type="tns:testSimpleType1">1</testAll></test></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><sayHello xmlns="urn:HelloWorld"><name xsi:type="xsd:string">test</name><givenName xsi:type="xsd:string">GIVENNAME</givenName><test><name xsi:type="xsd:string">TESTNAME</name><givenName xsi:type="xsd:string">GIVENNAME</givenName></test></sayHello></soap:Body></soap:Envelope>
|
||||
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><sayHello xmlns="urn:HelloWorld"><name xsi:type="xsd:string">test</name><givenName xsi:type="xsd:string">test</givenName></sayHello></soap:Body></soap:Envelope>
|
||||
304
t/acceptance/wsdl/006_sax_client.wsdl
Normal file
304
t/acceptance/wsdl/006_sax_client.wsdl
Normal file
@@ -0,0 +1,304 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions name="MessageGateway"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="http://www.example.org/MessageGateway2/"
|
||||
targetNamespace="http://www.example.org/MessageGateway2/">
|
||||
|
||||
<xsd:element name="EnqueueMessage" type="tns:TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A type containing all elements of a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MRecipientURI" type="xsd:anyURI" minOccurs="1"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
The recipient in URI notaitions. Valid URI schemas are: mailto:, sms:,
|
||||
phone:. Not all URI schemas need to be implemented at the current
|
||||
implementation stage.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSenderAddress" type="xsd:string" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
E-Mail sender address. Ignored for all but mailto: recipient URIs.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MMessageContent" type="xsd:string" minOccurs="1"
|
||||
maxOccurs="3">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Message Content.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MSubject" type="xsd:string" minOccurs="0" maxOccurs="1">
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Message Subject. Ignored for all but mailto: URIs
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MDeliveryReportRecipientURI" type="xsd:anyURI" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
URI to send a delivery report to. May be of one of the following schemes:
|
||||
mailto:, http:, https:. Reports to mailto: URIs are sent as plaintext,
|
||||
reports to http(s) URIs are sent as SOAP requests following the
|
||||
MessageGatewayClient service definition.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepalive" type="tns:TKeepalive" minOccurs="0"
|
||||
maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Container for keepalive information. May be missing.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepalive">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing keeplive information.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
|
||||
<xsd:element name="MKeepaliveTimeout" type="xsd:double">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Keepalive timeout. The keepalive timeout spezifies how long the sending of
|
||||
a message will be delayed waiting for keepalive updates. If a keepalive
|
||||
update is received during this period, the timeout will be reset. If not,
|
||||
the message will be sent after the timeout has expired.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="MKeepaliveErrorPolicy" minOccurs="0"
|
||||
maxOccurs="1" default="suppress">
|
||||
<xsd:annotation>
|
||||
|
||||
<xsd:documentation>
|
||||
Policy to comply to in case of system errors. Valid values are "suppress"
|
||||
and "report". If the policy is set to "suppress", keepalive messages will
|
||||
not be sent to their recipients in case of partial system failure, even if
|
||||
the keepalive has expired. This may result in "false negatives", i.e.
|
||||
messages may not be sent, even though their keepalive has expired. If the
|
||||
value is "report", keepalive messages will be sent from any cluster node.
|
||||
This may result in "false positive" alerts.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="suppress"></xsd:enumeration>
|
||||
<xsd:enumeration value="report"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Type containing a message ID.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Type containing all elements of a keppalive update / remove request.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessageID" type="xsd:string" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The ID for the message to update / remove
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="MAction" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The action to perform. Valid values are: "remove", "update". On "remove",
|
||||
the message with the ID specified will be removed from the queue, thus it
|
||||
will never be sent, even if it's timeout expires. On "update" the
|
||||
keepalive timeout of the corresponding message will be reset.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="remove"></xsd:enumeration>
|
||||
<xsd:enumeration value="update"></xsd:enumeration>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="KeepaliveMessage" type="tns:TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Keepalive message request element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="KeepaliveMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Response element for a keepalive request</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="EnqueueMessageResponse" type="tns:TMessageID">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Enqueue message response element</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:complexType name="TEnqueueMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MMessage" type="tns:TMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a message to enqueue.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="TKeepaliveMessageRequest">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A complex type containing one element: The keepalive message to process.
|
||||
</xsd:documentation>
|
||||
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="MKeepaliveMessage" type="tns:TKeepliveMessage">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Element containing a keepalive message to process.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="EnqueueMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessage">
|
||||
<wsdl:documentation>inputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name="EnqueueMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:EnqueueMessageResponse">
|
||||
<wsdl:documentation>outputparameters for EnqueueMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageRequest">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessage">
|
||||
|
||||
<wsdl:documentation>input parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KeepaliveMessageResponse">
|
||||
<wsdl:part name="parameters" element="tns:KeepaliveMessageResponse">
|
||||
<wsdl:documentation>output parameters for KeepaliveMessag</wsdl:documentation>
|
||||
</wsdl:part>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="MGWPortType">
|
||||
<wsdl:documentation>
|
||||
generic port type for all methods required for sending messages over the mosaic
|
||||
message gatewa
|
||||
</wsdl:documentation>
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to enqueue a normal (immediate send) or a delayed message with
|
||||
keepalive functionality.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:EnqueueMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:EnqueueMessageResponse"></wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<wsdl:documentation>
|
||||
This method is used to update or remove a
|
||||
keepalive message.
|
||||
</wsdl:documentation>
|
||||
<wsdl:input message="tns:KeepaliveMessageRequest"></wsdl:input>
|
||||
<wsdl:output message="tns:KeepaliveMessageResponse"></wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="MGWBinding" type="tns:MGWPortType">
|
||||
<wsdl:documentation>Generic binding for all (SOAP) port</wsdl:documentation>
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="EnqueueMessage">
|
||||
<soap:operation soapAction="http://www.example.org/MessageGateway2/EnqueueMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" namespace="http://www.example.org/" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KeepaliveMessage">
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/MessageGateway2/KeepaliveMessage" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="MessageGateway">
|
||||
<wsdl:documentation>
|
||||
Web Service for sending messages over the mosaic message gatewa
|
||||
</wsdl:documentation>
|
||||
|
||||
<wsdl:port name="HTTPPort" binding="tns:MGWBinding">
|
||||
<wsdl:documentation>HTTP(S) port for the mosaic message gatewa</wsdl:documentation>
|
||||
<soap:address location="https://inousses.erlm.siemens.de/MessageGateway/" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
72
t/acceptance/wsdl/008_complexType.wsdl
Normal file
72
t/acceptance/wsdl/008_complexType.wsdl
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:complexType name="testComplexTypeAll">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
<xsd:element name="Test1" type="xsd:string"/>
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequence">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testComplexTypeAll"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexTypeSequence"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
105
t/acceptance/wsdl/02_port.wsdl
Normal file
105
t/acceptance/wsdl/02_port.wsdl
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="simpleType"
|
||||
targetNamespace="simpleType"
|
||||
xmlns:tns="simpleType"
|
||||
xmlns:wsd="http://www.w3c.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="simpleType">
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:restriction base="int">
|
||||
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="test" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="testPort2" name="testBinding2">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="testPort3" name="testBinding3">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
<port name="testPort2" binding="testBinding2">
|
||||
<soap:address location="http://127.0.0.1/testPort2" />
|
||||
</port>
|
||||
<port name="testPort3" binding="testBinding3">
|
||||
<soap:address location="http://127.0.0.1/testPort3" />
|
||||
</port>
|
||||
|
||||
</service>
|
||||
</definitions>
|
||||
72
t/acceptance/wsdl/03_complexType-all.wsdl
Normal file
72
t/acceptance/wsdl/03_complexType-all.wsdl
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:complexType name="testComplexTypeAll">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:all>
|
||||
<xsd:element name="Test1" type="xsd:string"/>
|
||||
<xsd:element name="Test2" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="testComplexTypeSequence">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test">
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
99
t/acceptance/wsdl/03_complexType-sequence.wsdl
Normal file
99
t/acceptance/wsdl/03_complexType-sequence.wsdl
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:complexType name="testComplexType1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ComplexType Test
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Test1" type="xsd:string" minOccurs="1"/>
|
||||
<xsd:element name="Test2" type="xsd:string" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testSequence" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testSequence" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="tns:testRequest"/>
|
||||
<output message="tns:testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<portType name="testPort2">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="tns:testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="tns:testPort2" name="testBinding2">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<binding type="tns:testPort3" name="testBinding3">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="tns:testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
56
t/acceptance/wsdl/04_element-simpleType.wsdl
Normal file
56
t/acceptance/wsdl/04_element-simpleType.wsdl
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:element name="testElement1">
|
||||
<xsd:simpleType>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation> SimpleType: Integer between 1 and 9
|
||||
(Inclusive constraints) </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:restriction base="xsd:int" minInclusive="1"
|
||||
maxInclusive="9"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" element="tns:testElement1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testElement1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
48
t/acceptance/wsdl/04_element.wsdl
Normal file
48
t/acceptance/wsdl/04_element.wsdl
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:element name="testElement1" type="xsd:string" />
|
||||
<xsd:element name="testElement2" type="xsd:int" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" element="tns:testElement1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testElement1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
68
t/acceptance/wsdl/05_simpleType-list.wsdl
Normal file
68
t/acceptance/wsdl/05_simpleType-list.wsdl
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer (length 2-4)
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:list itemType="xsd:int">
|
||||
<xsd:minLength value="2"/>
|
||||
<xsd:maxLength value="4"/>
|
||||
</xsd:list>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="testSimpleType1" itemType="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer (length 2)
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:list itemType="xsd:int">
|
||||
<xsd:length value="2"/>
|
||||
</xsd:list>
|
||||
</xsd:simpleType>
|
||||
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
57
t/acceptance/wsdl/05_simpleType-restriction.wsdl
Normal file
57
t/acceptance/wsdl/05_simpleType-restriction.wsdl
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: Integer between 1 and 9 (Exclusive constrains)
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minExclusive value="0"/>
|
||||
<xsd:maxExclusive value="10"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
99
t/acceptance/wsdl/05_simpleType-union.wsdl
Normal file
99
t/acceptance/wsdl/05_simpleType-union.wsdl
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="Test"
|
||||
targetNamespace="Test"
|
||||
xmlns:tns="Test"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="Test">
|
||||
<xsd:simpleType name="testSimpleType1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="xsd:int xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="testSimpleType2">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
SimpleType: List with an integer and a string
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:union>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:int">
|
||||
<xsd:minInclusive value="1"/>
|
||||
<xsd:maxInclusive value="3"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="union"/>
|
||||
<xsd:enumeration value="test"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:union>
|
||||
</xsd:simpleType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="testRequest">
|
||||
<part name="testAll" type="tns:testSimpleType1"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexType1"/>
|
||||
</message>
|
||||
<message name="testRequest2">
|
||||
<part name="testAll" type="tns:testSimpleType2"/>
|
||||
</message>
|
||||
<message name="testResponse">
|
||||
<part name="testAll" type="tns:testComplexType2"/>
|
||||
</message>
|
||||
|
||||
<portType name="testPort">
|
||||
<operation name="test">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest"/>
|
||||
<output message="testResponse"/>
|
||||
</operation>
|
||||
<operation name="test2">
|
||||
<documentation>
|
||||
Test-Methode
|
||||
</documentation>
|
||||
|
||||
<input message="testRequest2"/>
|
||||
<output message="testResponse2"/>
|
||||
</operation>
|
||||
|
||||
</portType>
|
||||
|
||||
<binding type="testPort" name="testBinding">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="test">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
<soap:operation soapAction="test2">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="testService">
|
||||
<port name="testPort" binding="testBinding">
|
||||
<soap:address location="http://127.0.0.1/testPort" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
75
t/acceptance/wsdl/10_helloworld.asmx.xml
Normal file
75
t/acceptance/wsdl/10_helloworld.asmx.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?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 elementFormDefault="qualified"
|
||||
targetNamespace="urn:HelloWorld">
|
||||
<s:element name="sayHello">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="name"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</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>
|
||||
</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://helloworld/helloworld.asmx" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
|
||||
@@ -18,10 +18,10 @@ xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
type="s:string" />
|
||||
|
||||
<s:element minOccurs="0" maxOccurs="1" name="givenName"
|
||||
type="s:string" />
|
||||
type="s:string" nillable="1"/>
|
||||
|
||||
<s:element minOccurs="0" maxOccurs="1" name="test"
|
||||
type="s0:test2" />
|
||||
<!-- <s:element minOccurs="0" maxOccurs="1" name="test"
|
||||
type="s0:test2" /> //-->
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
@@ -59,10 +59,10 @@ xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<message name="sayHelloSoapIn">
|
||||
<part name="parameters" element="s0:sayHello" />
|
||||
|
||||
<part name="test1" type="s0:testExtended" />
|
||||
<!-- <part name="test1" type="s0:testExtended" />
|
||||
|
||||
<part name="test2" type="s0:test2"
|
||||
targetNamespace="urn:test2" />
|
||||
targetNamespace="urn:test2" /> //-->
|
||||
</message>
|
||||
|
||||
<message name="sayHelloSoapOut">
|
||||
81
t/acceptance/wsdl/contributed/Axis.wsdl
Normal file
81
t/acceptance/wsdl/contributed/Axis.wsdl
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://order.soap.services"
|
||||
xmlns:impl="http://order.soap.services" xmlns:intf="http://order.soap.services"
|
||||
xmlns:apachesoap="http://xml.apache.org/xml-soap"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://database.services"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<!--WSDL created by Apache Axis version: 1.2RC3
|
||||
Built on Feb 28, 2005 (10:15:14 EST)-->
|
||||
<wsdl:types>
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://database.services">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="ProcedureResponse">
|
||||
<sequence>
|
||||
<element name="message" nillable="true" type="soapenc:string" />
|
||||
<element name="status" type="xsd:int" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="confirmRequest">
|
||||
<wsdl:part name="language_id" type="soapenc:string" />
|
||||
<wsdl:part name="user_id" type="soapenc:string" />
|
||||
<wsdl:part name="supplier_code" type="soapenc:string" />
|
||||
<wsdl:part name="customer_no" type="soapenc:string" />
|
||||
<wsdl:part name="author" type="soapenc:string" />
|
||||
<wsdl:part name="title" type="soapenc:string" />
|
||||
<wsdl:part name="isbn" type="soapenc:string" />
|
||||
<wsdl:part name="classification" type="soapenc:string" />
|
||||
<wsdl:part name="purchase_note" type="soapenc:string" />
|
||||
<wsdl:part name="article_no" type="soapenc:string" />
|
||||
<wsdl:part name="price" type="xsd:double" />
|
||||
<wsdl:part name="currency_id" type="soapenc:string" />
|
||||
<wsdl:part name="delivery_date" type="xsd:dateTime" />
|
||||
<wsdl:part name="info_note" type="soapenc:string" />
|
||||
<wsdl:part name="no_of_copies" type="xsd:int" />
|
||||
<wsdl:part name="order_no" type="soapenc:string" />
|
||||
<wsdl:part name="order_date" type="xsd:dateTime" />
|
||||
<wsdl:part name="title_no" type="soapenc:string" />
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="confirmResponse">
|
||||
<wsdl:part name="confirmReturn" type="tns1:ProcedureResponse" />
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="OrderImpl">
|
||||
<wsdl:operation name="confirm"
|
||||
parameterOrder="language_id user_id supplier_code customer_no author title isbn classification purchase_note article_no price currency_id delivery_date info_note no_of_copies order_no order_date title_no">
|
||||
<wsdl:input name="confirmRequest" message="impl:confirmRequest" />
|
||||
<wsdl:output name="confirmResponse" message="impl:confirmResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="OrderSoapBinding" type="impl:OrderImpl">
|
||||
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="confirm">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="confirmRequest">
|
||||
<wsdlsoap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://order.soap.services" />
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="confirmResponse">
|
||||
<wsdlsoap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://order.soap.services" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="OrderImplService">
|
||||
<wsdl:port name="Order" binding="impl:OrderSoapBinding">
|
||||
<wsdlsoap:address location="http://example.com/services/services/Order" />
|
||||
</wsdl:port>
|
||||
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
202
t/acceptance/wsdl/contributed/ETest.wsdl
Normal file
202
t/acceptance/wsdl/contributed/ETest.wsdl
Normal file
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://example.com/soap/services/ETest"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:apachesoap="http://xml.apache.org/xml-soap"
|
||||
xmlns:impl="http://example.com/soap/services/ETest"
|
||||
xmlns:intf="http://example.com/soap/services/ETest"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:ETest"
|
||||
xmlns:tns2="urn:acquisition" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<wsdl:types>
|
||||
<schema targetNamespace="urn:ETest" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="CreationBaseData">
|
||||
<sequence>
|
||||
<element name="createdBy" nillable="true" type="xsd:long" />
|
||||
<element name="creationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateCenter" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updateDateLocal" nillable="true" type="xsd:dateTime" />
|
||||
<element name="updatedBy" nillable="true" type="xsd:long" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="CreationData">
|
||||
<complexContent>
|
||||
<extension base="tns1:CreationBaseData">
|
||||
<sequence>
|
||||
<element name="creatorFullName" nillable="true" type="xsd:string" />
|
||||
<element name="modifierFullName" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</extension>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
<complexType abstract="true" name="EProductData">
|
||||
<sequence>
|
||||
<element name="EStatus" nillable="true" type="xsd:string" />
|
||||
<element name="EStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="SFXID" nillable="true" type="xsd:string" />
|
||||
<element name="activationFromDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activationToDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="activityStatusDateTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="canEditSFXID" type="xsd:boolean" />
|
||||
<element name="concurrentNumberOfUsers" nillable="true" type="xsd:int" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="deleteable" type="xsd:boolean" />
|
||||
<element name="ETestCode" nillable="true" type="xsd:string" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="mainContact" nillable="true" type="xsd:string" />
|
||||
<element name="metaLibID" nillable="true" type="xsd:string" />
|
||||
<element name="otherID" nillable="true" type="xsd:string" />
|
||||
<element name="otherSource" nillable="true" type="xsd:string" />
|
||||
<element name="privateNote" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatus" nillable="true" type="xsd:string" />
|
||||
<element name="procurementStatusUpdateDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="procurementStatusUpdatedate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="sourceInstanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryCode" nillable="true" type="xsd:string" />
|
||||
<element name="sponseringLibraryName" nillable="true" type="xsd:string" />
|
||||
<element name="updateTarget" nillable="true" type="xsd:string" />
|
||||
<element name="workExpressionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="EProductInformation">
|
||||
<sequence>
|
||||
<element name="acquisitions" nillable="true"
|
||||
type="impl:ArrayOf_tns2_AcquisitionData" />
|
||||
<element name="data" nillable="true" type="tns1:EProductData" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="urn:acquisition" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="AcquisitionCommonData">
|
||||
<sequence>
|
||||
<element name="budgets" nillable="true" type="xsd:string" />
|
||||
<element name="campusCode" nillable="true" type="xsd:string" />
|
||||
<element name="concurrentUsersNote" nillable="true" type="xsd:string" />
|
||||
<element name="creationData" nillable="true" type="tns1:CreationData" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instituteCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
<complexType name="AcquisitionData">
|
||||
<sequence>
|
||||
<element name="ILSSubscriptionNo" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCode" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionCommonData" nillable="true"
|
||||
type="tns2:AcquisitionCommonData" />
|
||||
<element name="acquisitionMethod" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionNumber" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatus" nillable="true" type="xsd:string" />
|
||||
<element name="acquisitionStatusDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="advanceNoticeDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="autoRenewal" nillable="true" type="xsd:boolean" />
|
||||
<element name="consortialAgreement" type="xsd:boolean" />
|
||||
<element name="discountOnPrice" nillable="true" type="xsd:int" />
|
||||
<element name="id" nillable="true" type="xsd:long" />
|
||||
<element name="instanceCode" nillable="true" type="xsd:string" />
|
||||
<element name="materialType" nillable="true" type="xsd:string" />
|
||||
<element name="noteForILS" nillable="true" type="xsd:string" />
|
||||
<element name="noteForVendor" nillable="true" type="xsd:string" />
|
||||
<element name="noticePeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="numberOfCopies" nillable="true" type="xsd:int" />
|
||||
<element name="orderDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="orderForm" nillable="true" type="xsd:string" />
|
||||
<element name="orderSendMethod" nillable="true" type="xsd:string" />
|
||||
<element name="pooledConcurrentUsers" nillable="true" type="xsd:int" />
|
||||
<element name="price" nillable="true" type="xsd:double" />
|
||||
<element name="pricingCap" nillable="true" type="xsd:int" />
|
||||
<element name="pricingCapFrom" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingCapTo" nillable="true" type="xsd:dateTime" />
|
||||
<element name="pricingModel" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationNote" nillable="true" type="xsd:string" />
|
||||
<element name="printCancellationRestriction" type="xsd:boolean" />
|
||||
<element name="printPurchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="purchaseOrderNo" nillable="true" type="xsd:string" />
|
||||
<element name="renewallOrCancellationDate" nillable="true" type="xsd:dateTime" />
|
||||
<element name="renewallOrCancellationDescisionNote" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForILS" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="renewallOrCancellationNoteForVendor" nillable="true"
|
||||
type="xsd:string" />
|
||||
<element name="subscriptionNotification" nillable="true" type="xsd:int" />
|
||||
<element name="subscriptionPeriodCode" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionType" nillable="true" type="xsd:string" />
|
||||
<element name="subscriptionTypeNote" nillable="true" type="xsd:string" />
|
||||
<element name="vendorAdvancedNotice" nillable="true" type="xsd:int" />
|
||||
<element name="vendorAdvancedNoticeVal" nillable="true" type="xsd:string" />
|
||||
<element name="vendorCode" nillable="true" type="xsd:string" />
|
||||
<element name="vendorName" nillable="true" type="xsd:string" />
|
||||
<element name="vendorSubscriptionCode" nillable="true" type="xsd:string" />
|
||||
</sequence>
|
||||
</complexType>
|
||||
</schema>
|
||||
<schema targetNamespace="http://example.com/soap/services/ETest"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<complexType name="ArrayOf_tns2_AcquisitionData">
|
||||
<complexContent>
|
||||
<restriction base="soapenc:Array">
|
||||
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:AcquisitionData[]" />
|
||||
</restriction>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
</schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="getETestResponse">
|
||||
<wsdl:part name="getETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestResponse">
|
||||
<wsdl:part name="getFixedETestReturn" type="tns1:EProductInformation" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="getFixedETestRequest"></wsdl:message>
|
||||
<wsdl:message name="getETestRequest">
|
||||
<wsdl:part name="indexName" type="xsd:string" />
|
||||
<wsdl:part name="indexValue" type="xsd:string" />
|
||||
<wsdl:part name="withStatus" type="xsd:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="ETestWeb">
|
||||
<wsdl:operation name="getETest" parameterOrder="indexName indexValue withStatus">
|
||||
<wsdl:input message="impl:getETestRequest" name="getETestRequest" />
|
||||
<wsdl:output message="impl:getETestResponse" name="getETestResponse" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdl:input message="impl:getFixedETestRequest" name="getFixedETestRequest" />
|
||||
<wsdl:output message="impl:getFixedETestResponse"
|
||||
name="getFixedETestResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="ETestSoapBinding" type="impl:ETestWeb">
|
||||
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="getETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://ETest.webservice.api.verde.exlibris.com" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="getFixedETest">
|
||||
<wsdlsoap:operation soapAction="" />
|
||||
<wsdl:input name="getFixedETestRequest">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://ETest.webservice.api.verde.exlibris.com" use="encoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output name="getFixedETestResponse">
|
||||
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="http://example.com/soap/services/ETest" use="encoded" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="ETestWebService">
|
||||
<wsdl:port binding="impl:ETestSoapBinding" name="ETest">
|
||||
<wsdlsoap:address location="http://example.com/soap/services/ETest" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
160
t/acceptance/wsdl/contributed/OITest.wsdl
Normal file
160
t/acceptance/wsdl/contributed/OITest.wsdl
Normal file
@@ -0,0 +1,160 @@
|
||||
<wsdl:definitions xmlns:oi="http://example.com/OITest/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:ws="http://example.com/OITest/ws/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://example.com/OITest/ws/">
|
||||
<wsdl:types>
|
||||
<xsi:schema targetNamespace="http://example.com/OITest/ws/"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns="http://example.com/OITest/ws/" elementFormDefault="unqualified"
|
||||
attributeFormDefault="unqualified">
|
||||
</xsi:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="AvailableToSellRequest">
|
||||
<wsdl:part name="atsInquiry" element="oi:atsInquiry" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AvailableToSellResponse">
|
||||
<wsdl:part name="availableToSell" element="oi:availableToSell" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="POResponse">
|
||||
<wsdl:part name="acknowledgement" element="oi:acknowledgement" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="OITestWebServicesFault">
|
||||
<wsdl:part name="OITestFault" element="oi:OITestFault" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="CatalogRequest">
|
||||
<wsdl:part name="catalogRequest" element="oi:catalogRequest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="CatalogReponse">
|
||||
<wsdl:part name="catalog" element="oi:catalog" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="CatalogListRequest">
|
||||
<wsdl:part name="catalogListInfo" element="oi:catalogListRequest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="CatalogListResponse">
|
||||
<wsdl:part name="catalogList" element="oi:catalogList" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="POSubmitRequest">
|
||||
<wsdl:part name="submitPO" element="oi:submitPO" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="POCancelRequest">
|
||||
<wsdl:part name="cancelPO" element="oi:cancelPO" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="POChangeRequest">
|
||||
<wsdl:part name="changePO" element="oi:changePO" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="OITestPort">
|
||||
<wsdl:operation name="ATSCheck">
|
||||
<wsdl:input message="ws:AvailableToSellRequest" />
|
||||
<wsdl:output message="ws:AvailableToSellResponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POSubmit">
|
||||
<wsdl:input message="ws:POSubmitRequest" />
|
||||
<wsdl:output message="ws:POResponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POCancel">
|
||||
<wsdl:input message="ws:POCancelRequest" />
|
||||
<wsdl:output message="ws:POResponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POChange">
|
||||
<wsdl:input message="ws:POChangeRequest" />
|
||||
<wsdl:output message="ws:POResponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="CatalogRequest">
|
||||
<wsdl:input message="ws:CatalogRequest" />
|
||||
<wsdl:output message="ws:CatalogReponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="CatalogListRequest">
|
||||
<wsdl:input message="ws:CatalogListRequest" />
|
||||
<wsdl:output message="ws:CatalogListResponse" />
|
||||
<wsdl:fault name="OITestFault" message="ws:OITestWebServicesFault" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="OITestBinding" type="ws:OITestPort">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="ATSCheck">
|
||||
<soap:operation soapAction="http://example.com/OITest/ATSCheck" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POSubmit">
|
||||
<soap:operation soapAction="http://example.com/OITest/POSubmit" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POCancel">
|
||||
<soap:operation soapAction="http://example.com/OITest/POCancel" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="POChange">
|
||||
<soap:operation soapAction="http://example.com/OITest/POChange" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="CatalogRequest">
|
||||
<soap:operation soapAction="http://example.com/OITest/CatalogRequest" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="CatalogListRequest">
|
||||
<soap:operation soapAction="http://example.com/OITest/CatalogListRequest" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="OITestFault">
|
||||
<soap:fault name="OITestFault" use="literal" />
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="OITestService">
|
||||
<wsdl:port name="OITestService" binding="ws:OITestBinding">
|
||||
<soap:address location="http://localhost:8080/ws/services/OITestService" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
368
t/acceptance/wsdl/contributed/tools.wsdl
Normal file
368
t/acceptance/wsdl/contributed/tools.wsdl
Normal file
@@ -0,0 +1,368 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<wsdl: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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:tns="http://tempuri.org/Dijkalk_Webservice/Tools"
|
||||
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
|
||||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
||||
targetNamespace="http://tempuri.org/Dijkalk_Webservice/Tools"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<wsdl:types>
|
||||
<s:schema elementFormDefault="qualified"
|
||||
targetNamespace="http://tempuri.org/Dijkalk_Webservice/Tools">
|
||||
<s:element name="IrSzamValid">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="cIrszam" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="IrSzamValidResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="IrSzamValidResult"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="HelynevValid">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="cHelynev" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="HelynevValidResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="HelynevValidResult"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="KozterValid">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="cIrszam" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="cKozterNev" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="KozterValidResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="KozterValidResult"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetVersion">
|
||||
<s:complexType />
|
||||
</s:element>
|
||||
<s:element name="GetVersionResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="GetVersionResult"
|
||||
type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="string" nillable="true" type="s:string" />
|
||||
</s:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="IrSzamValidSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:IrSzamValid" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IrSzamValidSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:IrSzamValidResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:HelynevValid" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:HelynevValidResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:KozterValid" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:KozterValidResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetVersionSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:GetVersion" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetVersionSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:GetVersionResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IrSzamValidHttpGetIn">
|
||||
<wsdl:part name="cIrszam" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IrSzamValidHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidHttpGetIn">
|
||||
<wsdl:part name="cHelynev" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidHttpGetIn">
|
||||
<wsdl:part name="cIrszam" type="s:string" />
|
||||
<wsdl:part name="cKozterNev" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetVersionHttpGetIn" />
|
||||
<wsdl:message name="GetVersionHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IrSzamValidHttpPostIn">
|
||||
<wsdl:part name="cIrszam" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IrSzamValidHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidHttpPostIn">
|
||||
<wsdl:part name="cHelynev" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="HelynevValidHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidHttpPostIn">
|
||||
<wsdl:part name="cIrszam" type="s:string" />
|
||||
<wsdl:part name="cKozterNev" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="KozterValidHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetVersionHttpPostIn" />
|
||||
<wsdl:message name="GetVersionHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="ToolsSoap">
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése irányítószám részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:IrSzamValidSoapIn" />
|
||||
<wsdl:output message="tns:IrSzamValidSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése helységnév részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:HelynevValidSoapIn" />
|
||||
<wsdl:output message="tns:HelynevValidSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Közterület adatok lekérdezése irányítószám és közterület név részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:KozterValidSoapIn" />
|
||||
<wsdl:output message="tns:KozterValidSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Verziószám lekérdezés
|
||||
</documentation>
|
||||
<wsdl:input message="tns:GetVersionSoapIn" />
|
||||
<wsdl:output message="tns:GetVersionSoapOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:portType name="ToolsHttpGet">
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése irányítószám részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:IrSzamValidHttpGetIn" />
|
||||
<wsdl:output message="tns:IrSzamValidHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése helységnév részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:HelynevValidHttpGetIn" />
|
||||
<wsdl:output message="tns:HelynevValidHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Közterület adatok lekérdezése irányítószám és közterület név részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:KozterValidHttpGetIn" />
|
||||
<wsdl:output message="tns:KozterValidHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Verziószám lekérdezés
|
||||
</documentation>
|
||||
<wsdl:input message="tns:GetVersionHttpGetIn" />
|
||||
<wsdl:output message="tns:GetVersionHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:portType name="ToolsHttpPost">
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése irányítószám részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:IrSzamValidHttpPostIn" />
|
||||
<wsdl:output message="tns:IrSzamValidHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Helység adatok lekérdezése helységnév részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:HelynevValidHttpPostIn" />
|
||||
<wsdl:output message="tns:HelynevValidHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Közterület adatok lekérdezése irányítószám és közterület név részlet alapján
|
||||
</documentation>
|
||||
<wsdl:input message="tns:KozterValidHttpPostIn" />
|
||||
<wsdl:output message="tns:KozterValidHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
Verziószám lekérdezés
|
||||
</documentation>
|
||||
<wsdl:input message="tns:GetVersionHttpPostIn" />
|
||||
<wsdl:output message="tns:GetVersionHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="ToolsSoap" type="tns:ToolsSoap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<soap:operation soapAction="http://tempuri.org/Dijkalk_Webservice/Tools/IrSzamValid"
|
||||
style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<soap:operation
|
||||
soapAction="http://tempuri.org/Dijkalk_Webservice/Tools/HelynevValid"
|
||||
style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<soap:operation soapAction="http://tempuri.org/Dijkalk_Webservice/Tools/KozterValid"
|
||||
style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<soap:operation soapAction="http://tempuri.org/Dijkalk_Webservice/Tools/GetVersion"
|
||||
style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="ToolsHttpGet" type="tns:ToolsHttpGet">
|
||||
<http:binding verb="GET" />
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<http:operation location="/IrSzamValid" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<http:operation location="/HelynevValid" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<http:operation location="/KozterValid" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<http:operation location="/GetVersion" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="ToolsHttpPost" type="tns:ToolsHttpPost">
|
||||
<http:binding verb="POST" />
|
||||
<wsdl:operation name="IrSzamValid">
|
||||
<http:operation location="/IrSzamValid" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="HelynevValid">
|
||||
<http:operation location="/HelynevValid" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="KozterValid">
|
||||
<http:operation location="/KozterValid" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetVersion">
|
||||
<http:operation location="/GetVersion" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="Tools">
|
||||
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
|
||||
<wsdl:port name="ToolsSoap" binding="tns:ToolsSoap">
|
||||
<soap:address location="http://www.example.org/tools.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="ToolsHttpGet" binding="tns:ToolsHttpGet">
|
||||
<http:address location="http://www.example.org/tools.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="ToolsHttpPost" binding="tns:ToolsHttpPost">
|
||||
<http:address location="http://www.example.org/tools.asmx" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
174
t/acceptance/wsdl/email_account.wsdl
Normal file
174
t/acceptance/wsdl/email_account.wsdl
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="email_account"
|
||||
targetNamespace="email_account"
|
||||
xmlns:tns="email_account"
|
||||
xmlns:wsd="http://www.w3c.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
|
||||
>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="email_account">
|
||||
<xsd:complexType name="imapAccount">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Ein (evtl. unvollständiger) Account-Datensatz.
|
||||
Alle Felder des Datensatzes können, müssen aber nicht
|
||||
gefüllt sein.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:any>
|
||||
<xsd:element name="email" type="xsd:string" />
|
||||
<xsd:element name="uid" type="xsd:string" />
|
||||
<xsd:element name="password" type="xsd:string" />
|
||||
<xsd:element name="host" type="xsd:string" />
|
||||
<xsd:element name="sendQuota" type="xsd:int" />
|
||||
<xsd:element name="receiveQuota" type="xsd:int" />
|
||||
<xsd:element name="enabled" type="xsd:boolean" default="true"/>
|
||||
</xsd:any>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="imapAccountList">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Eine Liste von Account-Datensätzen. Die Liste kann leer sein.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:any maxOccurs="unbounded">
|
||||
<xsd:element name="account" type="tns:imapAccount"/>
|
||||
</xsd:any>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="getRequest">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="getResponse">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="createRequest">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="createResponse">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="modifyRequest">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="modifyResponse">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="searchRequest">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="searchResponse">
|
||||
<part name="accountList" type="tns:imapAccountList"/>
|
||||
</message>
|
||||
<message name="deleteRequest">
|
||||
<part name="account" type="tns:imapAccount"/>
|
||||
</message>
|
||||
<message name="deleteResponse">
|
||||
<part name="accountList" type="tns:imapAccountList"/>
|
||||
</message>
|
||||
<portType name="email_account">
|
||||
<operation name="get">
|
||||
<documentation>
|
||||
Methode zum Anzeigen eines Account-Datensatzes.
|
||||
Erwartet als Input einen (potentiell unvollständigen)
|
||||
Account-Datensatz und liefert den (vollständigen)
|
||||
Datensatz zurück.
|
||||
</documentation>
|
||||
|
||||
<input message="getRequest"/>
|
||||
<output message="getResponse"/>
|
||||
</operation>
|
||||
<operation name="create">
|
||||
<documentation>
|
||||
Methode zum Anlegen eines Account-Datensatzes.
|
||||
Erwartet als Input einen (potentiell unvollständigen)
|
||||
Account-Datensatz und liefert den (vollständigen)
|
||||
Datensatz zurück.
|
||||
</documentation>
|
||||
<input message="createRequest"/>
|
||||
<output message="createResponse"/>
|
||||
</operation>
|
||||
<operation name="modify">
|
||||
<documentation>
|
||||
Methode zum Ändern eines Account-Datensatzes.
|
||||
Erwartet als Input einen (potentiell unvollständigen)
|
||||
Account-Datensatz und liefert den (vollständigen)
|
||||
Datensatz zurück.
|
||||
</documentation>
|
||||
<input message="modifyRequest"/>
|
||||
<output message="modifyResponse"/>
|
||||
</operation>
|
||||
<operation name="delete">
|
||||
<documentation>
|
||||
Methode zum Löschen eines Account-Datensatzes.
|
||||
Erwartet als Input einen (potentiell unvollständigen)
|
||||
Account-Datensatz und liefert den (vollständigen)
|
||||
Datensatz zurück.
|
||||
</documentation>
|
||||
<input message="deleteRequest"/>
|
||||
<output message="deleteResponse"/>
|
||||
</operation>
|
||||
<operation name="search">
|
||||
<documentation>
|
||||
Methode zum Suchen eines oder mehrerer Account-Datensätze.
|
||||
Erwartet als Input einen (potentiell unvollständigen)
|
||||
Account-Datensatz und liefert eine Liste an (vollständigen)
|
||||
passenden Datensätzen zurück. Die Liste kann leer sein.
|
||||
</documentation>
|
||||
<input message="searchRequest"/>
|
||||
<output message="searchResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding type="email_account" name="soap">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<soap:operation soapAction="email_account/get">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
<soap:operation soapAction="email_account/create">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
<soap:operation soapAction="email_account/modify">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
<soap:operation soapAction="email_account/delete">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
|
||||
<soap:operation soapAction="email_account/search">
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</soap:operation>
|
||||
</binding>
|
||||
<service name="email_account">
|
||||
<port name="email_account" binding="soap">
|
||||
<address location="https://127.0.0.1/email_account" />
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
4
t/attic/01_use.t
Normal file
4
t/attic/01_use.t
Normal file
@@ -0,0 +1,4 @@
|
||||
use Test::More tests => 2;
|
||||
use lib '../lib';
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
ok( SOAP::WSDL->new(), 'Instantiated object' );
|
||||
38
t/attic/02_port.t
Normal file
38
t/attic/02_port.t
Normal file
@@ -0,0 +1,38 @@
|
||||
use Test::More tests => 9;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use lib '../lib';
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
ok( ($soap->servicename('testService') eq 'testService' ) );
|
||||
ok( ($soap->portname('testPort') eq 'testPort' ) );
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
|
||||
ok( ($soap->portname() eq 'testPort' ),
|
||||
"Found first port definition" );
|
||||
|
||||
ok( ($soap->portname('testPort2') eq 'testPort2' ),
|
||||
"Found second port definition (based on URL)" );
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
ok( ($soap->portname('testPort3') eq 'testPort3' ),
|
||||
"Found third port definition (based on Name)" );
|
||||
|
||||
|
||||
ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );
|
||||
ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit');
|
||||
94
t/attic/03_complexType-all.t
Normal file
94
t/attic/03_complexType-all.t
Normal file
@@ -0,0 +1,94 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
$name =~s/^t\///;
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
print "# SOAP::WSDL Version: $SOAP::WSDL::VERSION\n";
|
||||
|
||||
my $xml;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://' . $path . '/acceptance/wsdl/' . $name . '.wsdl',
|
||||
readable =>1,
|
||||
), 'Instantiated object' );
|
||||
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(
|
||||
checkoccurs => 1,
|
||||
), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => 'Test 2',
|
||||
}
|
||||
) ), 'Serialized complexType' );
|
||||
|
||||
# oprint $xml;
|
||||
|
||||
#exit;
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die "Cannot open acceptance results file";
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP: {
|
||||
print $SKIP;
|
||||
skip( $SKIP, 1 ) if ($SKIP);
|
||||
eval { soap_eq_or_diff( $xml, $testXML, 'Got expected result') };
|
||||
};
|
||||
|
||||
# $soap->wsdl_checkoccurs(1);
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => [ 'Test 2', 'Test 3' ]
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
"Died on illegal number of elements (too many)"
|
||||
);
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => {
|
||||
Test1 => 'Test 1',
|
||||
}
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
19
t/attic/03_complexType-choice.t
Normal file
19
t/attic/03_complexType-choice.t
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
19
t/attic/03_complexType-complexContent.t
Normal file
19
t/attic/03_complexType-complexContent.t
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
19
t/attic/03_complexType-group.t
Normal file
19
t/attic/03_complexType-group.t
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
92
t/attic/03_complexType-sequence.t
Normal file
92
t/attic/03_complexType-sequence.t
Normal file
@@ -0,0 +1,92 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(
|
||||
checkoccurs => 1,
|
||||
), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
#4
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
testSequence => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => 'Test 2',
|
||||
}
|
||||
) ), 'Serialized complexType' );
|
||||
|
||||
#5
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die "Cannot open acceptance results file";
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( 1, $SKIP ) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
#6
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testSequence => {
|
||||
Test1 => 'Test 1',
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
ok( ($@),
|
||||
"Died on illegal number of elements"
|
||||
);
|
||||
|
||||
#7
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testSequence => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => [ 1, 2, 3, ]
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
ok( ($@),
|
||||
"Died on illegal number of elements"
|
||||
);
|
||||
|
||||
|
||||
# chdir back to where we came from
|
||||
chdir $cwd;
|
||||
19
t/attic/03_complexType-simpleContent.t
Normal file
19
t/attic/03_complexType-simpleContent.t
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
5
t/attic/04_element-complexType.t
Normal file
5
t/attic/04_element-complexType.t
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
use Test::More tests => 1;
|
||||
use lib '../lib';
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
93
t/attic/04_element-simpleType.t
Normal file
93
t/attic/04_element-simpleType.t
Normal file
@@ -0,0 +1,93 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
|
||||
use Test::More;
|
||||
plan qw/no_plan/;
|
||||
# plan "skip_all", "Not yet supported";
|
||||
# use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simpler) element' );
|
||||
|
||||
# print $xml, "\n";
|
||||
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die 'Cannot open acceptance file '
|
||||
. $path . '/acceptance/results/' . $name . '.xml';
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP: {
|
||||
skip($SKIP, 1) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
};
|
||||
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 2, 3 ]
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
# print $@;
|
||||
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
"Died on illegal number of elements (too many)"
|
||||
);
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
chdir $cwd;
|
||||
74
t/attic/04_element.t
Normal file
74
t/attic/04_element.t
Normal file
@@ -0,0 +1,74 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
}
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 'Test'
|
||||
) ), 'Serialized (simpler) element' );
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die "Cannot open acceptance results file";
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( $SKIP, 1 ) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
};
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 'Test 2', 'Test 3' ]
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
"Died on illegal number of elements (too many)"
|
||||
);
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
98
t/attic/05_simpleType-list.t
Normal file
98
t/attic/05_simpleType-list.t
Normal file
@@ -0,0 +1,98 @@
|
||||
use Test::More tests => 10;
|
||||
use lib '../lib';
|
||||
use lib 'lib';
|
||||
use lib 't/lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::SOAPMessage;
|
||||
use diagnostics;
|
||||
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
unless ($SOAP::WSDL::MISSING) { };
|
||||
|
||||
my ($xml, $xml2);
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => [ 1, 2 ] )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
|
||||
#print $xml, "\n";
|
||||
|
||||
SKIP: {
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| skip("Cannot open acceptance results file", 1);
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
#5
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
|
||||
#6
|
||||
ok ( $xml2 = $soap->serializer->method( $soap->call('test',
|
||||
testAll => "1 2" )
|
||||
),
|
||||
'Serialized (simple) call (scalar)' );
|
||||
#7
|
||||
ok( $xml eq $xml2, 'Got expected result');
|
||||
|
||||
#8
|
||||
ok (
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 2
|
||||
)
|
||||
), "Serialized simple call (scalar value)"
|
||||
);
|
||||
|
||||
#9
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
|
||||
#10
|
||||
SKIP:
|
||||
{
|
||||
skip ("maxLength test not implemented", 1)
|
||||
if ( $SOAP::WSDL::MISSING->{ simpleType }->{ list }->{ maxLength } );
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (more than maxLength)');
|
||||
|
||||
}
|
||||
|
||||
chdir $cwd;
|
||||
105
t/attic/05_simpleType-restriction.t
Normal file
105
t/attic/05_simpleType-restriction.t
Normal file
@@ -0,0 +1,105 @@
|
||||
use Test::More tests => 9;
|
||||
use diagnostics;
|
||||
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use lib '../lib';
|
||||
use lib 'lib';
|
||||
use lib 't/lib';
|
||||
|
||||
use Test::SOAPMessage;
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->autotype(0);
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
|
||||
print $xml, "\n";
|
||||
|
||||
|
||||
SKIP: {
|
||||
skip 'broken', 1;
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| skip("Cannot open acceptance results file ". $name . '.xml', 1);
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
chomp $testXML;
|
||||
chomp $xml;
|
||||
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
|
||||
# 6
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1, 2 ]
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( "minValue check not implemented ", 1)
|
||||
if ($SOAP::WSDL::MISSING->{ simpleType }->{ restriction }->{ minValue });
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 0
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal value');
|
||||
}
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( "maxValue check not implemented ", 1)
|
||||
if ($SOAP::WSDL::MISSING->{ simpleType }->{ restriction }->{ maxValue });
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 100
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal value');
|
||||
}
|
||||
|
||||
|
||||
chdir $cwd;
|
||||
85
t/attic/05_simpleType-union.t
Normal file
85
t/attic/05_simpleType-union.t
Normal file
@@ -0,0 +1,85 @@
|
||||
use Test::More tests => 9;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use lib '../lib';
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
|
||||
# print $xml, "\n";
|
||||
|
||||
SKIP: {
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| skip("Cannot open acceptance results file ". $name . '.xml', 1);
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
is( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
|
||||
# 6
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1 , 'union']
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
#8
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test2',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
|
||||
#9
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1 , 'union']
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
chdir $cwd;
|
||||
83
t/attic/10_performance.t
Normal file
83
t/attic/10_performance.t
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Test::More tests=> 6;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../..';
|
||||
use Data::Dumper;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use_ok qw/ SOAP::WSDL /;
|
||||
use Benchmark;
|
||||
|
||||
# print "Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
# print "Performance test with simple WSDL file\n";
|
||||
|
||||
my $data = {
|
||||
name => 'Mein Name',
|
||||
givenName => 'Vorname'
|
||||
|
||||
};
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
my $cacheDir;
|
||||
if ($^O =~ m/Win/)
|
||||
{
|
||||
$cacheDir = 'C:/Temp/WSDL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$cacheDir = '/tmp/';
|
||||
}
|
||||
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
ok(
|
||||
$soap=SOAP::WSDL->new(
|
||||
wsdl => "file://$path/acceptance/wsdl/10_helloworld.asmx.xml",
|
||||
no_dispatch => 1
|
||||
),
|
||||
"Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."ms)" );
|
||||
|
||||
$soap->proxy('http://helloworld/helloworld.asmx');
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
eval{
|
||||
$soap->wsdlinit(caching => 1,
|
||||
cache_directory => $cacheDir ) };
|
||||
|
||||
unless ($@) {
|
||||
pass("wsdl file init (".tv_interval ( $t0, [gettimeofday]) ."s)");
|
||||
} else {
|
||||
fail( $@ );
|
||||
}
|
||||
$soap->readable(1);
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok( $soap->call("sayHello" , %{ $data }),
|
||||
"1 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)") ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
ok($soap->call(sayHello => %{ $data }),
|
||||
"1 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)" );
|
||||
|
||||
timethis 500, sub { $soap->call(sayHello => %{ $data }) };
|
||||
|
||||
__END__
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
for (my $i=1; $i<100; $i++)
|
||||
{
|
||||
$soap->call(sayHello => %{ $data });
|
||||
}
|
||||
ok(1, "100 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)");
|
||||
|
||||
chdir $cwd;
|
||||
118
t/attic/11_helloworld.NET.t
Normal file
118
t/attic/11_helloworld.NET.t
Normal file
@@ -0,0 +1,118 @@
|
||||
#!/usr/bin/perl -w
|
||||
#######################################################################################
|
||||
#
|
||||
# 2_helloworld.t
|
||||
#
|
||||
# Acceptance test for message encoding, based on .NET wsdl and example code.
|
||||
# SOAP::WSDL's encoding doesn't I<exactly> match the .NET example, because
|
||||
# .NET doesn't always specify types (SOAP::WSDL does), and the namespace
|
||||
# prefixes chosen are different (maybe the encoding style, too ? this would be a bug !)
|
||||
#
|
||||
########################################################################################
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
use Test;
|
||||
plan tests => 5;
|
||||
use Time::HiRes qw( gettimeofday tv_interval );
|
||||
use lib '../..';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use SOAP::WSDL;
|
||||
ok 1; # if we made it this far, we're ok
|
||||
### test vars END
|
||||
print "Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
|
||||
print "Acceptance test against sample output with simple WSDL\n";
|
||||
|
||||
my $data = {
|
||||
name => 'test',
|
||||
givenName => 'test',
|
||||
# test => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# },
|
||||
# test1 => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# extend => 'EXTEND',
|
||||
# },
|
||||
# test2 => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# }
|
||||
};
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
|
||||
ok( $soap=SOAP::WSDL->new(
|
||||
wsdl => 'file:///'.$path.'/acceptance/wsdl/11_helloworld.wsdl',
|
||||
no_dispatch => 1
|
||||
) );
|
||||
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
print "Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
$soap->proxy('http://helloworld/helloworld.asmx');
|
||||
$t0 = [gettimeofday];
|
||||
ok($soap->wsdlinit());
|
||||
print "WSDL init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
|
||||
open (FILE, "acceptance/results/11_helloworld.xml")
|
||||
|| open (FILE, "t/acceptance/results/11_helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml_test=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
if ( ($xml) && ($xml eq $xml_test) ) {
|
||||
ok 1;
|
||||
print "Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)\n"
|
||||
} else {
|
||||
ok 0;
|
||||
print "Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
print "$xml\n$xml_test\n"; };
|
||||
};
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
|
||||
open (FILE, "acceptance/results/11_helloworld.xml")
|
||||
|| open FILE, ("t/acceptance/results/11_helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
|
||||
$xml_test=~s/\<\/$1\:Body\>.*//;
|
||||
|
||||
if ( ($xml) && ($xml eq $xml_test) ) {
|
||||
ok 1;
|
||||
print "Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)\n";
|
||||
} else {
|
||||
ok 0;
|
||||
print "Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
print "$xml\n$xml_test\n"; };
|
||||
};
|
||||
|
||||
chdir $cwd;
|
||||
48
t/attic/12_binding.pl
Normal file
48
t/attic/12_binding.pl
Normal file
@@ -0,0 +1,48 @@
|
||||
use lib '../lib';
|
||||
use Test;
|
||||
use SOAP::WSDL;
|
||||
use Cwd;
|
||||
use Data::Dumper;
|
||||
|
||||
plan tests => 9;
|
||||
|
||||
print "# Using SOAP::WSDL Version $SOAP::WSDL::VERSION\n";
|
||||
|
||||
my $name = '02_port';
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
|
||||
|
||||
if (-d 't')
|
||||
{
|
||||
$cwd .= '/t';
|
||||
}
|
||||
|
||||
|
||||
my $url = 'http://127.0.0.1/testPort';
|
||||
|
||||
|
||||
ok(1);
|
||||
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $cwd . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
) );
|
||||
ok( ($soap->servicename('testService') eq 'testService' ) );
|
||||
ok( ($soap->portname('testPort') eq 'testPort' ) );
|
||||
|
||||
ok( $soap->wsdlinit( url => $url ) );
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
my $xpath = $soap->_wsdl_xpath( );
|
||||
|
||||
my @ports = $xpath->findnodes( '/definitions/service[@name="' . $soap->servicename() . '"]/port/soap:address[@location="' . $url .'"]');
|
||||
if (@ports)
|
||||
{
|
||||
print "# found testPort URL\n";
|
||||
my $address = shift @ports;
|
||||
my $port = $address->getParentNode();
|
||||
print $port->getAttribute('binding'), "\n";
|
||||
print $port->getAttribute('name'), "\n";
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user