From 008d06b72a0f815f851e33be0d28f43f48cb5a48 Mon Sep 17 00:00:00 2001 From: Martin Kutter Date: Fri, 5 Oct 2007 09:50:09 -0800 Subject: [PATCH] import SOAP-WSDL 2.00_17 from CPAN git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_17 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_17.tar.gz --- Build.PL | 58 +- CHANGES | 466 ++-- HACKING | 31 +- LICENSE | 7 + MAINFEST | 1 + MANIFEST | 316 ++- META.yml | 235 +- README | 57 +- TEST_COVERAGE | 11 + TODO | 27 + benchmark/01_expat.t | 97 + benchmark/XSD/01_anyType.t | 21 + benchmark/XSD/02_anySimpleType.t | 22 + benchmark/XSD/03_string.t | 22 + benchmark/smallprof.out | 324 +++ benchmark/smallprof.out-whitespace | 315 +++ bin/wsdl2perl.pl | 214 ++ example/fortune.pl | 47 + example/lib/MyElements/CountCookies.pm | 71 + .../lib/MyElements/CountCookiesResponse.pm | 85 + example/lib/MyElements/GetCitiesByCountry.pm | 93 + .../MyElements/GetCitiesByCountryResponse.pm | 93 + example/lib/MyElements/GetFortuneCookie.pm | 71 + .../MyElements/GetFortuneCookieResponse.pm | 85 + example/lib/MyElements/GetSpecificCookie.pm | 85 + .../MyElements/GetSpecificCookieResponse.pm | 85 + example/lib/MyElements/GetWeather.pm | 105 + example/lib/MyElements/GetWeatherResponse.pm | 93 + example/lib/MyElements/int.pm | 60 + example/lib/MyElements/readNodeCount.pm | 71 + .../lib/MyElements/readNodeCountResponse.pm | 85 + example/lib/MyElements/string.pm | 68 + .../FullerData_x0020_Fortune_x0020_Cookie.pm | 327 +++ example/lib/MyInterfaces/GlobalWeather.pm | 83 + .../FullerData_x0020_Fortune_x0020_Cookie.pm | 49 + example/lib/MyTypemaps/GlobalWeather.pm | 50 + example/visitor/visitor.pl | 26 + example/weather.pl | 20 + example/weather_wsdl.pl | 43 + example/wsdl/FortuneCookie.xml | 308 +++ example/wsdl/genericbarcode.xml | 153 ++ example/wsdl/globalweather.xml | 185 ++ lib/SOAP/WSDL.pm | 2023 +++++------------ lib/SOAP/WSDL/Base.pm | 130 ++ lib/SOAP/WSDL/Binding.pm | 13 + lib/SOAP/WSDL/Client.pm | 374 +++ lib/SOAP/WSDL/Client/Base.pm | 124 + lib/SOAP/WSDL/Definitions.pm | 129 ++ lib/SOAP/WSDL/Deserializer/Hash.pm | 160 ++ lib/SOAP/WSDL/Deserializer/SOAP11.pm | 49 + lib/SOAP/WSDL/Deserializer/SOM.pm | 124 + lib/SOAP/WSDL/Expat/Base.pm | 42 + lib/SOAP/WSDL/Expat/Message2Hash.pm | 127 ++ lib/SOAP/WSDL/Expat/MessageParser.pm | 242 ++ lib/SOAP/WSDL/Expat/MessageStreamParser.pm | 76 + lib/SOAP/WSDL/Expat/WSDLParser.pm | 143 ++ lib/SOAP/WSDL/Factory/Deserializer.pm | 152 ++ lib/SOAP/WSDL/Factory/Serializer.pm | 146 ++ lib/SOAP/WSDL/Factory/Transport.pm | 244 ++ lib/SOAP/WSDL/Generator/Template.pm | 49 + lib/SOAP/WSDL/Generator/Template/XSD.pm | 126 + .../WSDL/Generator/Template/XSD/Interface.tt | 69 + .../Generator/Template/XSD/Interface/Body.tt | 65 + .../Template/XSD/Interface/Header.tt | 38 + .../Template/XSD/Interface/Operation.tt | 17 + .../Template/XSD/Interface/POD/Element.tt | 13 + .../Template/XSD/Interface/POD/Message.tt | 9 + .../Template/XSD/Interface/POD/Operation.tt | 8 + .../Template/XSD/Interface/POD/Part.tt | 7 + .../Template/XSD/Interface/POD/Type.tt | 7 + .../Template/XSD/Interface/POD/method_info.tt | 7 + .../WSDL/Generator/Template/XSD/Typemap.tt | 28 + .../Generator/Template/XSD/_type_class.tt | 6 + .../Generator/Template/XSD/complexType.tt | 44 + .../Template/XSD/complexType/POD/all.tt | 7 + .../Template/XSD/complexType/POD/choice.tt | 9 + .../XSD/complexType/POD/complexContent.tt | 9 + .../XSD/complexType/POD/restriction.tt | 7 + .../Template/XSD/complexType/POD/structure.tt | 13 + .../Generator/Template/XSD/complexType/all.tt | 46 + .../Template/XSD/complexType/atomicTypes.tt | 19 + .../XSD/complexType/complexContent.tt | 8 + .../Template/XSD/complexType/contentModel.tt | 15 + .../Template/XSD/complexType/restriction.tt | 8 + .../WSDL/Generator/Template/XSD/element.tt | 71 + .../Template/XSD/element/POD/structure.tt | 30 + .../WSDL/Generator/Template/XSD/simpleType.tt | 56 + .../Template/XSD/simpleType/POD/list.tt | 20 + .../XSD/simpleType/POD/restriction.tt | 17 + .../Template/XSD/simpleType/POD/structure.tt | 1 + .../Template/XSD/simpleType/atomicType.tt | 3 + .../Template/XSD/simpleType/contentModel.tt | 7 + .../Generator/Template/XSD/simpleType/list.tt | 21 + .../Template/XSD/simpleType/restriction.tt | 9 + lib/SOAP/WSDL/Generator/Visitor.pm | 315 +++ lib/SOAP/WSDL/Generator/Visitor/Typelib.pm | 10 + lib/SOAP/WSDL/Generator/Visitor/Typemap.pm | 227 ++ lib/SOAP/WSDL/Manual.pod | 303 +++ lib/SOAP/WSDL/Manual/Glossary.pod | 91 + lib/SOAP/WSDL/Manual/WS_I.pod | 1241 ++++++++++ lib/SOAP/WSDL/Manual/XSD.pod | 249 ++ lib/SOAP/WSDL/Message.pm | 9 + lib/SOAP/WSDL/OpMessage.pm | 12 + lib/SOAP/WSDL/Operation.pm | 16 + lib/SOAP/WSDL/Parser.pod | 264 +++ lib/SOAP/WSDL/Part.pm | 44 + lib/SOAP/WSDL/Port.pm | 10 + lib/SOAP/WSDL/PortType.pm | 32 + lib/SOAP/WSDL/SOAP/Address.pm | 9 + lib/SOAP/WSDL/SOAP/Body.pm | 11 + lib/SOAP/WSDL/SOAP/Header.pm | 12 + lib/SOAP/WSDL/SOAP/HeaderFault.pm | 6 + lib/SOAP/WSDL/SOAP/Operation.pm | 12 + lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm | 102 + lib/SOAP/WSDL/Serializer/SOAP11.pm | 68 + lib/SOAP/WSDL/Service.pm | 9 + lib/SOAP/WSDL/Transport/HTTP.pm | 96 + lib/SOAP/WSDL/Transport/Loopback.pm | 81 + lib/SOAP/WSDL/Transport/Test.pm | 129 ++ lib/SOAP/WSDL/TypeLookup.pm | 180 ++ lib/SOAP/WSDL/Types.pm | 37 + lib/SOAP/WSDL/XSD/Builtin.pm | 35 + lib/SOAP/WSDL/XSD/ComplexType.pm | 118 + lib/SOAP/WSDL/XSD/Element.pm | 108 + lib/SOAP/WSDL/XSD/Schema.pm | 73 + lib/SOAP/WSDL/XSD/Schema/Builtin.pm | 62 + lib/SOAP/WSDL/XSD/SimpleType.pm | 101 + lib/SOAP/WSDL/XSD/Typelib/Builtin.pm | 387 ++++ lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm | 7 + lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm | 7 + lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm | 9 + lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm | 27 + .../WSDL/XSD/Typelib/Builtin/anySimpleType.pm | 42 + lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm | 34 + lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm | 25 + .../WSDL/XSD/Typelib/Builtin/base64Binary.pm | 37 + lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm | 58 + lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm | 71 + lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm | 60 + lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm | 32 + lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm | 31 + lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm | 33 + lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm | 26 + .../WSDL/XSD/Typelib/Builtin/gMonthDay.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm | 26 + .../WSDL/XSD/Typelib/Builtin/gYearMonth.pm | 25 + .../WSDL/XSD/Typelib/Builtin/hexBinary.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm | 32 + lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm | 26 + lib/SOAP/WSDL/XSD/Typelib/Builtin/list.pm | 41 + lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm | 25 + .../XSD/Typelib/Builtin/negativeInteger.pm | 25 + .../XSD/Typelib/Builtin/nonNegativeInteger.pm | 25 + .../XSD/Typelib/Builtin/nonPositiveInteger.pm | 26 + .../XSD/Typelib/Builtin/normalizedString.pm | 33 + .../XSD/Typelib/Builtin/positiveInteger.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm | 51 + lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm | 53 + lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm | 24 + .../WSDL/XSD/Typelib/Builtin/unsignedByte.pm | 25 + .../WSDL/XSD/Typelib/Builtin/unsignedInt.pm | 25 + .../WSDL/XSD/Typelib/Builtin/unsignedLong.pm | 24 + .../WSDL/XSD/Typelib/Builtin/unsignedShort.pm | 25 + lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm | 385 ++++ lib/SOAP/WSDL/XSD/Typelib/Element.pm | 152 ++ lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm | 132 ++ t/001_use.t | 38 + t/002_parse_wsdl.t | 332 +++ t/003_wsdl_based_serializer.t | 96 + t/004_parse_wsdl.t | 398 ++++ t/005_parse_contributed.t | 24 + t/006_client.t | 112 + t/007_envelope.t | 36 + t/008_client_wsdl_complexType.t | 30 + t/009_data_classes.t | 89 + t/011_simpleType.t | 36 + t/012_element.t | 68 + t/013_complexType.t | 48 + t/016_client_object.t | 63 + t/017_generator.t | 442 ++++ t/018_compat_2_00_15-generator.t | 7 + t/020_storable.t | 10 + t/098_pod.t | 19 + t/1_performance.t | 107 - t/2_helloworld.NET.t | 104 - t/3_various.t | 109 - t/4_auto_set_port.t | 55 - t/5_same_transport.t | 19 - t/97_pod.t | 27 - t/98_pod_coverage.t | 27 - t/Expat/01_expat.t | 52 + t/Expat/03_wsdl.t | 410 ++++ t/SOAP/WSDL/01_use.t | 7 + t/SOAP/WSDL/02_port.t | 25 + t/SOAP/WSDL/03_complexType-all.t | 80 + t/SOAP/WSDL/03_complexType-choice.t | 12 + t/SOAP/WSDL/03_complexType-complexContent.t | 22 + t/SOAP/WSDL/03_complexType-element-ref.t | 39 + t/SOAP/WSDL/03_complexType-group.t | 22 + t/SOAP/WSDL/03_complexType-sequence.t | 76 + t/SOAP/WSDL/03_complexType-simpleContent.t | 22 + t/SOAP/WSDL/04_element-complexType.t | 4 + t/SOAP/WSDL/04_element-simpleType.t | 48 + t/SOAP/WSDL/04_element.t | 66 + t/SOAP/WSDL/05_simpleType-list.t | 51 + t/SOAP/WSDL/05_simpleType-restriction.t | 57 + t/SOAP/WSDL/05_simpleType-union.t | 62 + t/SOAP/WSDL/06_keep_alive.t | 30 + t/SOAP/WSDL/11_helloworld.NET.t | 53 + t/SOAP/WSDL/12_binding.t | 25 + t/SOAP/WSDL/Deserializer/Hash.t | 21 + t/SOAP/WSDL/Deserializer/SOM.t | 30 + t/SOAP/WSDL/Deserializer/XSD.t | 19 + t/SOAP/WSDL/Factory/Deserializer.t | 21 + t/SOAP/WSDL/Factory/Serializer.t | 21 + t/SOAP/WSDL/Factory/Transport.t | 16 + t/SOAP/WSDL/Generator/Template.t | 63 + t/SOAP/WSDL/Generator/Visitor.t | 22 + t/SOAP/WSDL/Generator/Visitor/Typemap.t | 144 ++ t/SOAP/WSDL/Generator/XSD.t | 111 + t/SOAP/WSDL/Generator/XSD_unsupported.t | 24 + t/SOAP/WSDL/Transport/01_Test.t | 47 + t/SOAP/WSDL/Transport/02_HTTP.t | 20 + t/SOAP/WSDL/Transport/acceptance/test2.xml | 1 + t/SOAP/WSDL/Transport/acceptance/test3.xml | 1 + t/SOAP/WSDL/Typelib/Fault11.t | 22 + .../XSD/Typelib/Builtin/01_constructors.t | 104 + t/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/ID.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.t | 16 + t/SOAP/WSDL/XSD/Typelib/Builtin/NCName.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.t | 21 + t/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/Name.t | 12 + .../WSDL/XSD/Typelib/Builtin/anySimpleType.t | 50 + t/SOAP/WSDL/XSD/Typelib/Builtin/anyType.t | 23 + t/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.t | 14 + .../WSDL/XSD/Typelib/Builtin/base64Binary.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/boolean.t | 51 + t/SOAP/WSDL/XSD/Typelib/Builtin/byte.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/date.t | 74 + t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t | 32 + t/SOAP/WSDL/XSD/Typelib/Builtin/decimal.t | 15 + t/SOAP/WSDL/XSD/Typelib/Builtin/double.t | 13 + t/SOAP/WSDL/XSD/Typelib/Builtin/float.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.t | 11 + t/SOAP/WSDL/XSD/Typelib/Builtin/int.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/integer.t | 13 + t/SOAP/WSDL/XSD/Typelib/Builtin/long.t | 12 + .../XSD/Typelib/Builtin/negativeInteger.t | 10 + .../XSD/Typelib/Builtin/nonNegativeInteger.t | 10 + .../XSD/Typelib/Builtin/nonPositiveInteger.t | 10 + .../XSD/Typelib/Builtin/normalizedString.t | 22 + .../XSD/Typelib/Builtin/positiveInteger.t | 10 + t/SOAP/WSDL/XSD/Typelib/Builtin/short.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/string.t | 23 + t/SOAP/WSDL/XSD/Typelib/Builtin/time.t | 25 + t/SOAP/WSDL/XSD/Typelib/Builtin/token.t | 12 + .../WSDL/XSD/Typelib/Builtin/unsignedByte.t | 12 + t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.t | 12 + .../WSDL/XSD/Typelib/Builtin/unsignedLong.t | 12 + .../WSDL/XSD/Typelib/Builtin/unsignedShort.t | 12 + t/acceptance/helloworld.asmx.xml | 180 -- t/acceptance/results/03_complexType-all.xml | 1 + .../results/03_complexType-sequence.xml | 1 + .../results/04_element-simpleType.xml | 1 + t/acceptance/results/04_element.xml | 1 + t/acceptance/results/05_simpleType-list.xml | 1 + .../results/05_simpleType-restriction.xml | 1 + t/acceptance/results/05_simpleType-union.xml | 1 + .../11_helloworld.xml} | 2 +- t/acceptance/wsdl/006_sax_client.wsdl | 323 +++ t/acceptance/wsdl/008_complexType.wsdl | 71 + t/acceptance/wsdl/02_port.wsdl | 108 + t/acceptance/wsdl/03_complexType-all.wsdl | 61 + .../wsdl/03_complexType-element-ref.wsdl | 52 + .../wsdl/03_complexType-sequence.wsdl | 103 + t/acceptance/wsdl/04_element-simpleType.wsdl | 57 + t/acceptance/wsdl/04_element.wsdl | 72 + t/acceptance/wsdl/05_simpleType-list.wsdl | 69 + .../wsdl/05_simpleType-restriction.wsdl | 58 + t/acceptance/wsdl/05_simpleType-union.wsdl | 103 + t/acceptance/wsdl/10_helloworld.asmx.xml | 75 + .../11_helloworld.wsdl} | 210 +- t/acceptance/wsdl/contributed/Axis.wsdl | 81 + t/acceptance/wsdl/contributed/ETest.wsdl | 202 ++ t/acceptance/wsdl/contributed/OITest.wsdl | 160 ++ t/acceptance/wsdl/contributed/tools.wsdl | 368 +++ .../wsdl/elementAtomicComplexType.xml | 14 + t/acceptance/wsdl/email_account.wsdl | 174 ++ t/acceptance/wsdl/generator_test.wsdl | 239 ++ .../wsdl/generator_unsupported_test.wsdl | 135 ++ t/acceptance/wsdl/message_gateway.wsdl | 323 +++ t/contributed.wsdl | 206 ++ t/lib/MyComplexType.pm | 19 + t/lib/MyElement.pm | 84 + t/lib/MyElements/GetWeather.pm | 105 + t/lib/MyElements/GetWeatherResponse.pm | 93 + t/lib/MyInterfaces/GlobalWeather.pm | 82 + t/lib/MySimpleType.pm | 53 + t/lib/MyTypemaps/GlobalWeather.pm | 83 + t/lib/Test/SOAPMessage.pm | 64 + t/lib/Typelib/Base.pm | 28 + t/lib/Typelib/TEnqueueMessage.pm | 17 + t/lib/Typelib/TMessage.pm | 26 + t/test.wsdl | 189 ++ 319 files changed, 23045 insertions(+), 2383 deletions(-) create mode 100644 LICENSE create mode 100644 MAINFEST create mode 100644 TEST_COVERAGE create mode 100644 TODO create mode 100644 benchmark/01_expat.t create mode 100644 benchmark/XSD/01_anyType.t create mode 100644 benchmark/XSD/02_anySimpleType.t create mode 100644 benchmark/XSD/03_string.t create mode 100644 benchmark/smallprof.out create mode 100644 benchmark/smallprof.out-whitespace create mode 100644 bin/wsdl2perl.pl create mode 100644 example/fortune.pl create mode 100644 example/lib/MyElements/CountCookies.pm create mode 100644 example/lib/MyElements/CountCookiesResponse.pm create mode 100644 example/lib/MyElements/GetCitiesByCountry.pm create mode 100644 example/lib/MyElements/GetCitiesByCountryResponse.pm create mode 100644 example/lib/MyElements/GetFortuneCookie.pm create mode 100644 example/lib/MyElements/GetFortuneCookieResponse.pm create mode 100644 example/lib/MyElements/GetSpecificCookie.pm create mode 100644 example/lib/MyElements/GetSpecificCookieResponse.pm create mode 100644 example/lib/MyElements/GetWeather.pm create mode 100644 example/lib/MyElements/GetWeatherResponse.pm create mode 100644 example/lib/MyElements/int.pm create mode 100644 example/lib/MyElements/readNodeCount.pm create mode 100644 example/lib/MyElements/readNodeCountResponse.pm create mode 100644 example/lib/MyElements/string.pm create mode 100644 example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm create mode 100644 example/lib/MyInterfaces/GlobalWeather.pm create mode 100644 example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm create mode 100644 example/lib/MyTypemaps/GlobalWeather.pm create mode 100644 example/visitor/visitor.pl create mode 100644 example/weather.pl create mode 100644 example/weather_wsdl.pl create mode 100644 example/wsdl/FortuneCookie.xml create mode 100644 example/wsdl/genericbarcode.xml create mode 100644 example/wsdl/globalweather.xml create mode 100644 lib/SOAP/WSDL/Base.pm create mode 100644 lib/SOAP/WSDL/Binding.pm create mode 100644 lib/SOAP/WSDL/Client.pm create mode 100644 lib/SOAP/WSDL/Client/Base.pm create mode 100644 lib/SOAP/WSDL/Definitions.pm create mode 100644 lib/SOAP/WSDL/Deserializer/Hash.pm create mode 100644 lib/SOAP/WSDL/Deserializer/SOAP11.pm create mode 100644 lib/SOAP/WSDL/Deserializer/SOM.pm create mode 100644 lib/SOAP/WSDL/Expat/Base.pm create mode 100644 lib/SOAP/WSDL/Expat/Message2Hash.pm create mode 100644 lib/SOAP/WSDL/Expat/MessageParser.pm create mode 100644 lib/SOAP/WSDL/Expat/MessageStreamParser.pm create mode 100644 lib/SOAP/WSDL/Expat/WSDLParser.pm create mode 100644 lib/SOAP/WSDL/Factory/Deserializer.pm create mode 100644 lib/SOAP/WSDL/Factory/Serializer.pm create mode 100644 lib/SOAP/WSDL/Factory/Transport.pm create mode 100644 lib/SOAP/WSDL/Generator/Template.pm create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD.pm create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/Body.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/Header.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/Operation.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Element.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Message.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Part.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Type.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/method_info.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/Typemap.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/_type_class.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/element.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/list.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/restriction.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/structure.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/atomicType.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/contentModel.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/list.tt create mode 100644 lib/SOAP/WSDL/Generator/Template/XSD/simpleType/restriction.tt create mode 100644 lib/SOAP/WSDL/Generator/Visitor.pm create mode 100644 lib/SOAP/WSDL/Generator/Visitor/Typelib.pm create mode 100644 lib/SOAP/WSDL/Generator/Visitor/Typemap.pm create mode 100644 lib/SOAP/WSDL/Manual.pod create mode 100644 lib/SOAP/WSDL/Manual/Glossary.pod create mode 100644 lib/SOAP/WSDL/Manual/WS_I.pod create mode 100644 lib/SOAP/WSDL/Manual/XSD.pod create mode 100644 lib/SOAP/WSDL/Message.pm create mode 100644 lib/SOAP/WSDL/OpMessage.pm create mode 100644 lib/SOAP/WSDL/Operation.pm create mode 100644 lib/SOAP/WSDL/Parser.pod create mode 100644 lib/SOAP/WSDL/Part.pm create mode 100644 lib/SOAP/WSDL/Port.pm create mode 100644 lib/SOAP/WSDL/PortType.pm create mode 100644 lib/SOAP/WSDL/SOAP/Address.pm create mode 100644 lib/SOAP/WSDL/SOAP/Body.pm create mode 100644 lib/SOAP/WSDL/SOAP/Header.pm create mode 100644 lib/SOAP/WSDL/SOAP/HeaderFault.pm create mode 100644 lib/SOAP/WSDL/SOAP/Operation.pm create mode 100644 lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm create mode 100644 lib/SOAP/WSDL/Serializer/SOAP11.pm create mode 100644 lib/SOAP/WSDL/Service.pm create mode 100644 lib/SOAP/WSDL/Transport/HTTP.pm create mode 100644 lib/SOAP/WSDL/Transport/Loopback.pm create mode 100644 lib/SOAP/WSDL/Transport/Test.pm create mode 100644 lib/SOAP/WSDL/TypeLookup.pm create mode 100644 lib/SOAP/WSDL/Types.pm create mode 100644 lib/SOAP/WSDL/XSD/Builtin.pm create mode 100644 lib/SOAP/WSDL/XSD/ComplexType.pm create mode 100644 lib/SOAP/WSDL/XSD/Element.pm create mode 100644 lib/SOAP/WSDL/XSD/Schema.pm create mode 100644 lib/SOAP/WSDL/XSD/Schema/Builtin.pm create mode 100644 lib/SOAP/WSDL/XSD/SimpleType.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/list.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/Element.pm create mode 100644 lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm create mode 100644 t/001_use.t create mode 100644 t/002_parse_wsdl.t create mode 100644 t/003_wsdl_based_serializer.t create mode 100644 t/004_parse_wsdl.t create mode 100644 t/005_parse_contributed.t create mode 100644 t/006_client.t create mode 100644 t/007_envelope.t create mode 100644 t/008_client_wsdl_complexType.t create mode 100644 t/009_data_classes.t create mode 100644 t/011_simpleType.t create mode 100644 t/012_element.t create mode 100644 t/013_complexType.t create mode 100644 t/016_client_object.t create mode 100644 t/017_generator.t create mode 100644 t/018_compat_2_00_15-generator.t create mode 100644 t/020_storable.t create mode 100644 t/098_pod.t delete mode 100644 t/1_performance.t delete mode 100644 t/2_helloworld.NET.t delete mode 100644 t/3_various.t delete mode 100644 t/4_auto_set_port.t delete mode 100644 t/5_same_transport.t delete mode 100644 t/97_pod.t delete mode 100644 t/98_pod_coverage.t create mode 100644 t/Expat/01_expat.t create mode 100644 t/Expat/03_wsdl.t create mode 100644 t/SOAP/WSDL/01_use.t create mode 100644 t/SOAP/WSDL/02_port.t create mode 100644 t/SOAP/WSDL/03_complexType-all.t create mode 100644 t/SOAP/WSDL/03_complexType-choice.t create mode 100644 t/SOAP/WSDL/03_complexType-complexContent.t create mode 100644 t/SOAP/WSDL/03_complexType-element-ref.t create mode 100644 t/SOAP/WSDL/03_complexType-group.t create mode 100644 t/SOAP/WSDL/03_complexType-sequence.t create mode 100644 t/SOAP/WSDL/03_complexType-simpleContent.t create mode 100644 t/SOAP/WSDL/04_element-complexType.t create mode 100644 t/SOAP/WSDL/04_element-simpleType.t create mode 100644 t/SOAP/WSDL/04_element.t create mode 100644 t/SOAP/WSDL/05_simpleType-list.t create mode 100644 t/SOAP/WSDL/05_simpleType-restriction.t create mode 100644 t/SOAP/WSDL/05_simpleType-union.t create mode 100644 t/SOAP/WSDL/06_keep_alive.t create mode 100644 t/SOAP/WSDL/11_helloworld.NET.t create mode 100644 t/SOAP/WSDL/12_binding.t create mode 100644 t/SOAP/WSDL/Deserializer/Hash.t create mode 100644 t/SOAP/WSDL/Deserializer/SOM.t create mode 100644 t/SOAP/WSDL/Deserializer/XSD.t create mode 100644 t/SOAP/WSDL/Factory/Deserializer.t create mode 100644 t/SOAP/WSDL/Factory/Serializer.t create mode 100644 t/SOAP/WSDL/Factory/Transport.t create mode 100644 t/SOAP/WSDL/Generator/Template.t create mode 100644 t/SOAP/WSDL/Generator/Visitor.t create mode 100644 t/SOAP/WSDL/Generator/Visitor/Typemap.t create mode 100644 t/SOAP/WSDL/Generator/XSD.t create mode 100644 t/SOAP/WSDL/Generator/XSD_unsupported.t create mode 100644 t/SOAP/WSDL/Transport/01_Test.t create mode 100644 t/SOAP/WSDL/Transport/02_HTTP.t create mode 100644 t/SOAP/WSDL/Transport/acceptance/test2.xml create mode 100644 t/SOAP/WSDL/Transport/acceptance/test3.xml create mode 100644 t/SOAP/WSDL/Typelib/Fault11.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/01_constructors.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/ID.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/NCName.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/Name.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/anyType.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/boolean.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/byte.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/date.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/decimal.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/double.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/float.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/int.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/integer.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/long.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/short.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/string.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/time.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/token.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.t create mode 100644 t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.t delete mode 100644 t/acceptance/helloworld.asmx.xml create mode 100644 t/acceptance/results/03_complexType-all.xml create mode 100644 t/acceptance/results/03_complexType-sequence.xml create mode 100644 t/acceptance/results/04_element-simpleType.xml create mode 100644 t/acceptance/results/04_element.xml create mode 100644 t/acceptance/results/05_simpleType-list.xml create mode 100644 t/acceptance/results/05_simpleType-restriction.xml create mode 100644 t/acceptance/results/05_simpleType-union.xml rename t/acceptance/{helloworld.xml => results/11_helloworld.xml} (64%) create mode 100644 t/acceptance/wsdl/006_sax_client.wsdl create mode 100644 t/acceptance/wsdl/008_complexType.wsdl create mode 100644 t/acceptance/wsdl/02_port.wsdl create mode 100644 t/acceptance/wsdl/03_complexType-all.wsdl create mode 100644 t/acceptance/wsdl/03_complexType-element-ref.wsdl create mode 100644 t/acceptance/wsdl/03_complexType-sequence.wsdl create mode 100644 t/acceptance/wsdl/04_element-simpleType.wsdl create mode 100644 t/acceptance/wsdl/04_element.wsdl create mode 100644 t/acceptance/wsdl/05_simpleType-list.wsdl create mode 100644 t/acceptance/wsdl/05_simpleType-restriction.wsdl create mode 100644 t/acceptance/wsdl/05_simpleType-union.wsdl create mode 100644 t/acceptance/wsdl/10_helloworld.asmx.xml rename t/acceptance/{test.wsdl.xml => wsdl/11_helloworld.wsdl} (89%) create mode 100644 t/acceptance/wsdl/contributed/Axis.wsdl create mode 100644 t/acceptance/wsdl/contributed/ETest.wsdl create mode 100644 t/acceptance/wsdl/contributed/OITest.wsdl create mode 100644 t/acceptance/wsdl/contributed/tools.wsdl create mode 100644 t/acceptance/wsdl/elementAtomicComplexType.xml create mode 100644 t/acceptance/wsdl/email_account.wsdl create mode 100644 t/acceptance/wsdl/generator_test.wsdl create mode 100644 t/acceptance/wsdl/generator_unsupported_test.wsdl create mode 100644 t/acceptance/wsdl/message_gateway.wsdl create mode 100644 t/contributed.wsdl create mode 100644 t/lib/MyComplexType.pm create mode 100644 t/lib/MyElement.pm create mode 100644 t/lib/MyElements/GetWeather.pm create mode 100644 t/lib/MyElements/GetWeatherResponse.pm create mode 100644 t/lib/MyInterfaces/GlobalWeather.pm create mode 100644 t/lib/MySimpleType.pm create mode 100644 t/lib/MyTypemaps/GlobalWeather.pm create mode 100644 t/lib/Test/SOAPMessage.pm create mode 100644 t/lib/Typelib/Base.pm create mode 100644 t/lib/Typelib/TEnqueueMessage.pm create mode 100644 t/lib/Typelib/TMessage.pm create mode 100644 t/test.wsdl diff --git a/Build.PL b/Build.PL index e9f2c3c..cc704e5 100644 --- a/Build.PL +++ b/Build.PL @@ -1,25 +1,45 @@ -#!/usr/bin/perl -w use Module::Build; -Module::Build->new( +$build = Module::Build->new( create_makefile_pl => 'passthrough', + dist_abstract => 'SOAP with WSDL support', dist_name => 'SOAP-WSDL', - dist_version => '1.26', - dist_abstract => 'WSDL support for SOAP::Lite', - module_name => 'SOAP::WSDL', - license => 'artistic', - requires => { - 'SOAP::Lite' => 0, - 'XML::XPath' => 0, + dist_version => '2.00_17', + module_name => 'SOAP::WSDL', + license => 'artistic', + requires => { + 'Class::Std' => q/v0.0.8/, + 'Class::Std::Storable' => 0, + 'Data::Dumper' => 0, + 'Date::Parse' => 0, + 'Date::Format' => 0, + 'File::Basename' => 0, + 'File::Path' => 0, + 'Getopt::Long' => 0, + 'List::Util' => 0, + 'LWP::UserAgent' => 0, + 'Template' => 0, + 'Term::ReadKey' => 0, + 'XML::Parser::Expat' => 0, }, buildrequires => { - 'Test::More' => 0, - 'SOAP::Lite' => 0, - 'XML::XPath' => 0, - 'Time::HiRes' => 0, - 'File::Spec' => 0, - 'File::Basename' => 0, - 'Cwd' => 0, - }, - -)->create_build_script; + 'Class::Std' => q/v0.0.8/, + 'Class::Std::Storable' => 0, + 'Cwd' => 0, + 'Date::Parse' => 0, + 'Date::Format' => 0, + 'Getopt::Long' => 0, + 'List::Util' => 0, + 'LWP::UserAgent' => 0, + 'File::Basename' => 0, + 'File::Path' => 0, + 'File::Spec' => 0, + 'Storable' => 0, + 'Test::More' => 0, + 'Template' => 0, + 'XML::Parser::Expat' => 0, + }, + recursive_test_files => 1, +); +$build->add_build_element('tt'); +$build->create_build_script; diff --git a/CHANGES b/CHANGES index a87d5ae..4f6215b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,167 +1,333 @@ -* v1.26 2007/10/05 - bugfix -- fixed issue reported by T Alex Beamish: tests fail when unwrapped into /tmp -* v1.25 2007/09/24 - maintenance -- added Makefile.PL to ease installation +Release notes for SOAP::WSDL 2.00_17 +------- -* v1.24 2007/09/22 - bugfix -- fixes issue reported by David Bussenschutt: wsdlinit always uses new SOAP::Schema instance. +I'm proud to present a new pre-release version of SOAP::WSDL. -* 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() +SOAP::WSDL is a toolkit for creating WSDL-based SOAP client interfaces in perl. -* 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 +Features: -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 !) + * WSDL based SOAP client + o SOAP1.1 support + o Supports document/literal message style/encoding + * Code generator for generating WSDL-based interface classes + o Generated code includes usage documentation for the web service interface + * Easy-to use API + o Automatically encodes perl data structures as message data + o Automatically sets HTTP headers right + * Efficient documentation + o SOAP::WSDL::Manual guides you at getting your work done, not at + the module's internals + * Thorough test suite + o SOAP::WSDL is heavily regression tested, with a test coverage of + over 90%. + * SOAP::Lite like look and feel + o Where possible, SOAP::WSDL mimics SOAP::Lite's API to allow easy migrations + * XML schema based class library for creating data objects + * High-performance XML parser + * Plugin support. SOAP::WSDL can be extended through plugins in various aspects. + The following plugins are supported: + o Transport plugins via SOAP::WSDL::Factory::Transport + o Serializer plugins via SOAP::WSDL::Factory::Serializer + o Deserializer plugins via SOAP::WSDL::Factory::Serializer -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 +The following changes have been made: -2006/11/06 only in the customized version - Added the support for default values in the wsdl file +2.00_17 +---- +The following features were added (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): -2006/11/04 only in the customized version - Changed the calling interface. Now it's driven by the by the service - and port names. +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): -2006/11/03 only in the customized version - Corrected the Check for the correct number of elements in complex types + * [ 1772617 ] SOAP Header not working + Added header support. Currently, SOAP headers are only supported with + the SOM or the XSD (SOAP11) serializer. - 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. + * [ 1805238 ] Tests in t/SOAP/WSDL don't work when run from t/ -A quick-and-dirty workaround is to turn off the check with + * [ 1805241 ] explain() broken in SOAP::WSDL + explain has been removed from SOAP::WSDL + +The following uncategorized improvements have been made: - $soap->wsdl_checkoccurs(0); + * Added limited support for complexType complexContent content model with + restriction variety. + SOAP::WSDL now supports this XML Schema definition variant, although no + constraints are imposed on derived types yet. + Derived types do not serialize with a xsi:type attribute (and the xsi:type + attribute is not recognized by the XML parser), so you cannot use derived + types as a substitute for theri parent, yet. -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 + * Added support for complexType choice variety + complexType definitions using the choice variety are now supported, + even though the content is not checked (if you pass in invalid data, + invalid XML will be generated). + + * Added Loopback Transport backend. + SOAP::WSDL::Tranport::Loopback just returns the request as respons, but + allows testing the whole chain from user interface to transport backend. + + * Fixed SOAP::WSDL::Factory::Transport prefer user-registered + transport backend + + * Fixed set_soap_version method in SOAP::WSDL::Client. + Re-setting the SOAP version now invalidates (resets) serializer and + deserializer, but not the transport backend. + + * Fixed SOAP::WSDL::XSD::Typelib::Builtin::boolean to return false + when false and true when true. + + * SOAP::WSDL::XSD::Typelib::Builtin::normalizedString now replaces all + occurences of tab, newline and carriage return by whitespce on set_value. + + * Code cleanup + o Lots of orphan methods now replaced by the SOAP::WSDL::Generator + hierarchy have been removed. + o Unused (and unusable) readable option checking has been removed in + SOAP::WSDL::Serializer::SOAP11. + o Unused XML Schema facet attributes have been removed from XSD Builtin + classes + o Methods common to all expat parser classes have been factored out + into a common base class. + + * XML serialization speedup for SOAP::WSDL::XSD::* objects + + * Tests added to improve test coverage. + + * A few documentation errors have been fixed + + * Misspelled default Typemap and Interface prefixes have been corrected + +2.00_16 +---- +The following features were added (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): + + * [ 1761532 ] Support embedded atomic types + SOAP::WSDL now supports a greater variety of XML Schema type definitions. + Note that XML Schema support is still incomplete, though. + + * [ 1797943 ] Create Perl Hash Deserializer + There's a new deserializer which outputs perl hashes as data structures. + Much like XML::Simple, but faster. No XML Attribute support, though. + + * [ 1797678 ] Move Code generator from WSDL::Definitions to separate class + + * [ 1803330 ] Create one interface per port + SOAP::WSDL now creats one interface per port, not one per service. + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [ 1804441 ] parts from binding not regarded in SOAP::WSDL + SOAP::WSDL (interpreter mode) now respects the body parts specified in the + binding. + + * [ 1803763 ] nonNegativeInteger misspelled in Schema::Builtin + + * [ 1793965 ] _expand() does not work on non-root-node ns declarations + + * [ 1792348 ] 006_client.t requires SOAP::Lite in 2.00_15 + SOAP::WSDL no longer attempts to load SOAP::WSDL::Deserializer::SOM when + no_dispatch is set. + 006_client.t now sets outputxml(1), to be really sure. + +The following uncategorized improvements have been made: + + * Code generator only generates interface for the first port in a service + The code generator now generates interfaces for all ports. + Note: The naming scheme has changed. It is now + InterfacePrefix::Service::Port + + * XML Parser speedup + The XML parser has received a little speedup. + + * A number of errors in parsing / traversing WSDL documents have been + corrected. + + * Documentation has been improved + + * A number of (incorrect, but passing) tests have been fixed. + + * Code cleanup: The SOAP::WSDL::SAX* modules are no longer included, as they + are not supported any more. They can still be found in SOAP::WSDL's + subversion repository in the attic directory, though. + +2.00_15 +---- + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [ 1792321 ] 2.00_14 requires SOAP::Lite for passing tests + +2.00_14 +---- + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [ 1792235 ] SOAP::WSDL::Transport::Test missing from 2.00_13 + The package has been re-added + + * [ 1792221 ] class_resolver not set from ::Client in 2.00_13 + Changed to set class_resolver correctly. + +The following uncategorized improvements have been made: + + * The ::SOM deserializer has been simplified to be just a subclass + of SOAP::Deserializer from SOAP::Lite + * Factories now emit more useful error messages when no class is registered + for the protocol/soap_version requested + * Documentation has been improved + - refined ::Factory:: modules' documentation + * Several tests have been added + * XSD classes have been improved for testability + +2.00_13 +---- +The following features were added (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): + + * [ 1790619 ] Test transport backend + A test transport backend has been implemented (SOAP::WSDL::Transport::Test). + It returns the contents from a file and discards the response. + The filename is determined from the soap_action field. + + * [ 1785196 ] Replace outputsom(1) by deserializer plugin + outputsom(1) in SOAP::WSDL is now implemented via using the deserializer + plugin SOAP::WSDL::Deserializer::SOM. + + * [1785195] Support deserializer plugins + Deserializer plugin API added via SOAP::WSDL::Factory::Deserializer. + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [1789581] Support ComplexType mixed + WSDL parser now supports using the mixed="true" attribute in complexType + definitions. Mixed content in messages is only supported via SOAP::SOM yet. + + * [1787975] 016_client_object.t fails due to testing XML as string + Removed string test. + + * [1787959] Test wsdl seems to be broken + Corrected typo. + + * [1787955] ::XSD::Typelib::date is broken + SOAP::WSDL::XSD::Typelib::Builtin::date now converts time-zoned dates properly, + and adds the local time zone if none is given. + + * [1785646] SOAPAction header not set from soap:operation soapAction + SOAP::WSDL now sets the SOAPAction header correctly. + +The following uncategorized improvements have been made: + + * Documentation improvements + +2.00_12 +---- + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [1787146] SOAP::WSDL still uses XML::LibXML + The superficious usage of XML::LibXML has been removed. XML::LibXML with + sax filter has been replaced by SOAP::WSDL::Expat::WSDLParser. + + * [1787054] Test suite requires XML::LibXML in 2.00_11 + The test suite no longer requires XML::LibXML to pass. + + * [1785678] SOAP envelope not checked for namespace + The SOAP envelope is now checked for the correct namespace. + + * [1786644] SOAP::WSDL::Manual - doc error + Documentation improvements + +The following uncategorized improvements have been made + + * The SOAPAction header is now alway quoted (R1109 in WS-I BP 1.0). + +2.00_11 +---- + +The following features were added (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660924): + + * [1767963] Transport plugins via SOAP::WSDL::Factory::Transport. + SOAP::WSDL uses SOAP::Lite's tranport modules as default, with a + lightweight HTTP(S) transport plugin as fallback. + Custom transport modules can be registered via SOAP::WSDL::Factory::Transport. + + * [ 1772730 ] Serializer plugins via SOAP::WSDL::Factory::Serializer + The default serializer for SOAP1.1 is SOAP::WSDL::Serializer::SOAP11. + Custom serializers classes can be registered via + SOAP::WSDL::Factory::Serializer or set via SOAP::WSDL's set_serializer + method. + +The following bugs have been fixed (the numbers in square brackets are the +tracker IDs from https://sourceforge.net/tracker/?group_id=111978&atid=660921): + + * [ 1764854 ] Port WSDL parser to expat and remove XML::LibXML dependency + SOAP::WSDL now requires only XML::Parser to be installed. + XML::LibXML is not required any more, though XML::LibXML based modules still + exist. + +The following uncategorized improvements have been made + + * The number of dependencies has been reduced. SOAP::WSDL no longer requires the + following modules to be installed: + - XML::SAX::Base + - XML::SAX::ParserFactory + - Pod::Simple::Text + - XML::LibXML + + * The missing prerequisite Template has been added. + * Documentation has been improved: + - WS-I Compliance document added. -2006/10/28 only in the customized version - - added a small support for the complexType restrictions of Arrays +2.00_10 +---- + * Changed Makefile.PL to use Module::Build (passthrough mode) + * fixed element ref="" handling -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 +2.00_09 +---- + * SOAP::WSDL::XSD::Typelib::Builtin::boolean objects now return their numerical + value in bool context, not "true" or "false" (always true...) + * date/time test are now timezone-sensitive + * examples added +2.00_08 +--- + * SOAP::WSDL::XSD::Typelib::ComplexType objects now check the class of their + child objects. + This provides early feedback to developers. + * SOAP message parser can skip unwanted parts of the message to improve parsing + speed - see SOAP::WSDL::Expat::MessageParser for details. + * HTTP Content-Type is configurable + * SOAP::WSDL::XSD::Typelib::ComplexType based objects accept any combination of + hash refs, list refs and objects as parameter to set_value() and new(). + * SOAP::WSDL::XSD::Typelib::Builtin::dateTime and ::date convert date + strings into XML date strings + * SOAP::WSDL::Definitions::create now + - converts '.' in service names to '::' (.NET class separator to perl class + separator) + - outputs Typemaps and Interface classes in UTF8 to allow proper inclusion + of UTF8 documentation from WSDL + * SOAP::WSDL::Definitions::create() includes doc in generated interface classes + * WSDLHandler now handles tags + * fixed explain in SimpleType, ComplexType and Element - -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 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.00_07 and below +--- + * Implemented a Code generator for creating SOAP interfaces based on WSDL definitions + * Implemented a high-speed stream based SOAP message parser + SOAP message parser returns a objects based on XML schema based class library + * Implemented a XML schema based class library + * Implemented a stream based WSDL parser. + Parses WSDL into objects. Objects can serialize data, and explain how to use the + service(s) they make up (output documentation). diff --git a/HACKING b/HACKING index add7d05..cc27f04 100644 --- a/HACKING +++ b/HACKING @@ -1,7 +1,7 @@ Development of SOAP::WSDL takes place on sourceforge.net. There's a svn repository available at -https://svn.sourceforge.net/svnroot/soap-wsdl +https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl Engagement in the further development of this module is highly encouraged - many people have already contributed, and many more probably will. @@ -13,12 +13,33 @@ you as co-author. The (my) current roadmap for SOAP::WSDL is: -1.2*: Bugfixes and support for more XSD variants +1.* Development of the 1.* tree has stopped - I won't get past 1.2x anymore... +2.* WSDL -> Perl Class factory with offline WSDL processing -1.3: Bindings support +2.01 +- WSDL support for the most common type definitions +- Online-facility (SOAP::WSDL) using WSDL object tree directly +- usable code generator +- full namespace support when processing WSDL +- high performance when parsing WSDL messages - get nearly as fast as + XML::Simple... -2.*: WSDL -> Perl Class factory with offline WSDL processing +2.02 +- Support for Apache-SOAP datatypes +- support for embedded atomic simpleType/complexType definitions +- Caching of WSDL object tree + generated code (when using SOAP::WSDL). +- Online-facility (SOAP::WSDL) using code generator via cache directory -May 2007, +Somewhere on the TODO list (in no particular order): + +- validation +- typemaps for use with the type="tns:MyComplexType" XML attribute +- external entities support when parsing WSDL +- support all these XML Schema variants +- support creating XML Schmema definitions via SOAP::WSDL::XSD::* ('minimal conformant') +- support other Schema definition languages than XML::Schema (maybe RelaxNG?) +- factor out SOAP::WSDL::XSD into it's own namespace (maybe just XSD ?) + +July 2007, Martin Kutter \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fd6bcd3 --- /dev/null +++ b/LICENSE @@ -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. + + diff --git a/MAINFEST b/MAINFEST new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/MAINFEST @@ -0,0 +1 @@ + diff --git a/MANIFEST b/MANIFEST index d16ff4e..cc734af 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,18 +1,312 @@ +benchmark/01_expat.t +benchmark/smallprof.out +benchmark/smallprof.out-whitespace +benchmark/XSD/01_anyType.t +benchmark/XSD/02_anySimpleType.t +benchmark/XSD/03_string.t +bin/wsdl2perl.pl Build.PL CHANGES +example/fortune.pl +example/lib/MyElements/CountCookies.pm +example/lib/MyElements/CountCookiesResponse.pm +example/lib/MyElements/GetCitiesByCountry.pm +example/lib/MyElements/GetCitiesByCountryResponse.pm +example/lib/MyElements/GetFortuneCookie.pm +example/lib/MyElements/GetFortuneCookieResponse.pm +example/lib/MyElements/GetSpecificCookie.pm +example/lib/MyElements/GetSpecificCookieResponse.pm +example/lib/MyElements/GetWeather.pm +example/lib/MyElements/GetWeatherResponse.pm +example/lib/MyElements/int.pm +example/lib/MyElements/readNodeCount.pm +example/lib/MyElements/readNodeCountResponse.pm +example/lib/MyElements/string.pm +example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm +example/lib/MyInterfaces/GlobalWeather.pm +example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm +example/lib/MyTypemaps/GlobalWeather.pm +example/visitor/visitor.pl +example/weather.pl +example/weather_wsdl.pl +example/wsdl/FortuneCookie.xml +example/wsdl/genericbarcode.xml +example/wsdl/globalweather.xml 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/Deserializer/Hash.pm +lib/SOAP/WSDL/Deserializer/SOAP11.pm +lib/SOAP/WSDL/Deserializer/SOM.pm +lib/SOAP/WSDL/Expat/Base.pm +lib/SOAP/WSDL/Expat/Message2Hash.pm +lib/SOAP/WSDL/Expat/MessageParser.pm +lib/SOAP/WSDL/Expat/MessageStreamParser.pm +lib/SOAP/WSDL/Expat/WSDLParser.pm +lib/SOAP/WSDL/Factory/Deserializer.pm +lib/SOAP/WSDL/Factory/Serializer.pm +lib/SOAP/WSDL/Factory/Transport.pm +lib/SOAP/WSDL/Generator/Template.pm +lib/SOAP/WSDL/Generator/Template/XSD.pm +lib/SOAP/WSDL/Generator/Template/XSD/_type_class.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/all.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/atomicTypes.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/complexContent.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/contentModel.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/all.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/choice.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/complexContent.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/POD/structure.tt +lib/SOAP/WSDL/Generator/Template/XSD/complexType/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/element.tt +lib/SOAP/WSDL/Generator/Template/XSD/element/POD/structure.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/Body.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/Header.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/Operation.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Element.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Message.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/method_info.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Operation.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Part.tt +lib/SOAP/WSDL/Generator/Template/XSD/Interface/POD/Type.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/atomicType.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/contentModel.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/list.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/list.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/POD/structure.tt +lib/SOAP/WSDL/Generator/Template/XSD/simpleType/restriction.tt +lib/SOAP/WSDL/Generator/Template/XSD/Typemap.tt +lib/SOAP/WSDL/Generator/Visitor.pm +lib/SOAP/WSDL/Generator/Visitor/Typelib.pm +lib/SOAP/WSDL/Generator/Visitor/Typemap.pm +lib/SOAP/WSDL/Manual.pod +lib/SOAP/WSDL/Manual/Glossary.pod +lib/SOAP/WSDL/Manual/WS_I.pod +lib/SOAP/WSDL/Manual/XSD.pod +lib/SOAP/WSDL/Message.pm +lib/SOAP/WSDL/Operation.pm +lib/SOAP/WSDL/OpMessage.pm +lib/SOAP/WSDL/Parser.pod +lib/SOAP/WSDL/Part.pm +lib/SOAP/WSDL/Port.pm +lib/SOAP/WSDL/PortType.pm +lib/SOAP/WSDL/Serializer/SOAP11.pm +lib/SOAP/WSDL/Service.pm +lib/SOAP/WSDL/SOAP/Address.pm +lib/SOAP/WSDL/SOAP/Body.pm +lib/SOAP/WSDL/SOAP/Header.pm +lib/SOAP/WSDL/SOAP/HeaderFault.pm +lib/SOAP/WSDL/SOAP/Operation.pm +lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm +lib/SOAP/WSDL/Transport/HTTP.pm +lib/SOAP/WSDL/Transport/Loopback.pm +lib/SOAP/WSDL/Transport/Test.pm +lib/SOAP/WSDL/TypeLookup.pm +lib/SOAP/WSDL/Types.pm +lib/SOAP/WSDL/XSD/Builtin.pm +lib/SOAP/WSDL/XSD/ComplexType.pm +lib/SOAP/WSDL/XSD/Element.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/Builtin/anySimpleType.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/list.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm +lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm +lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm +lib/SOAP/WSDL/XSD/Typelib/Element.pm +lib/SOAP/WSDL/XSD/Typelib/SimpleType.pm +LICENSE +MAINFEST Makefile.PL -MANIFEST This list of files +MANIFEST META.yml README -t/1_performance.t -t/2_helloworld.NET.t -t/3_various.t -t/4_auto_set_port.t -t/5_same_transport.t -t/97_pod.t -t/98_pod_coverage.t -t/acceptance/helloworld.asmx.xml -t/acceptance/helloworld.xml -t/acceptance/test.wsdl.xml +t/001_use.t +t/002_parse_wsdl.t +t/003_wsdl_based_serializer.t +t/004_parse_wsdl.t +t/005_parse_contributed.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/016_client_object.t +t/017_generator.t +t/018_compat_2_00_15-generator.t +t/020_storable.t +t/098_pod.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-element-ref.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/elementAtomicComplexType.xml +t/acceptance/wsdl/email_account.wsdl +t/acceptance/wsdl/generator_test.wsdl +t/acceptance/wsdl/generator_unsupported_test.wsdl +t/acceptance/wsdl/message_gateway.wsdl +t/contributed.wsdl +t/Expat/01_expat.t +t/Expat/03_wsdl.t +t/lib/MyComplexType.pm +t/lib/MyElement.pm +t/lib/MyElements/GetWeather.pm +t/lib/MyElements/GetWeatherResponse.pm +t/lib/MyInterfaces/GlobalWeather.pm +t/lib/MySimpleType.pm +t/lib/MyTypemaps/GlobalWeather.pm +t/lib/Test/SOAPMessage.pm +t/lib/Typelib/Base.pm +t/lib/Typelib/TEnqueueMessage.pm +t/lib/Typelib/TMessage.pm +t/SOAP/WSDL/01_use.t +t/SOAP/WSDL/02_port.t +t/SOAP/WSDL/03_complexType-all.t +t/SOAP/WSDL/03_complexType-choice.t +t/SOAP/WSDL/03_complexType-complexContent.t +t/SOAP/WSDL/03_complexType-element-ref.t +t/SOAP/WSDL/03_complexType-group.t +t/SOAP/WSDL/03_complexType-sequence.t +t/SOAP/WSDL/03_complexType-simpleContent.t +t/SOAP/WSDL/04_element-complexType.t +t/SOAP/WSDL/04_element-simpleType.t +t/SOAP/WSDL/04_element.t +t/SOAP/WSDL/05_simpleType-list.t +t/SOAP/WSDL/05_simpleType-restriction.t +t/SOAP/WSDL/05_simpleType-union.t +t/SOAP/WSDL/06_keep_alive.t +t/SOAP/WSDL/11_helloworld.NET.t +t/SOAP/WSDL/12_binding.t +t/SOAP/WSDL/Deserializer/Hash.t +t/SOAP/WSDL/Deserializer/SOM.t +t/SOAP/WSDL/Deserializer/XSD.t +t/SOAP/WSDL/Factory/Deserializer.t +t/SOAP/WSDL/Factory/Serializer.t +t/SOAP/WSDL/Factory/Transport.t +t/SOAP/WSDL/Generator/Template.t +t/SOAP/WSDL/Generator/Visitor.t +t/SOAP/WSDL/Generator/Visitor/Typemap.t +t/SOAP/WSDL/Generator/XSD.t +t/SOAP/WSDL/Generator/XSD_unsupported.t +t/SOAP/WSDL/Transport/01_Test.t +t/SOAP/WSDL/Transport/02_HTTP.t +t/SOAP/WSDL/Transport/acceptance/test2.xml +t/SOAP/WSDL/Transport/acceptance/test3.xml +t/SOAP/WSDL/Typelib/Fault11.t +t/SOAP/WSDL/XSD/Typelib/Builtin/01_constructors.t +t/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.t +t/SOAP/WSDL/XSD/Typelib/Builtin/anyType.t +t/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.t +t/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.t +t/SOAP/WSDL/XSD/Typelib/Builtin/boolean.t +t/SOAP/WSDL/XSD/Typelib/Builtin/byte.t +t/SOAP/WSDL/XSD/Typelib/Builtin/date.t +t/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.t +t/SOAP/WSDL/XSD/Typelib/Builtin/decimal.t +t/SOAP/WSDL/XSD/Typelib/Builtin/double.t +t/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.t +t/SOAP/WSDL/XSD/Typelib/Builtin/float.t +t/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.t +t/SOAP/WSDL/XSD/Typelib/Builtin/ID.t +t/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.t +t/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.t +t/SOAP/WSDL/XSD/Typelib/Builtin/int.t +t/SOAP/WSDL/XSD/Typelib/Builtin/integer.t +t/SOAP/WSDL/XSD/Typelib/Builtin/long.t +t/SOAP/WSDL/XSD/Typelib/Builtin/Name.t +t/SOAP/WSDL/XSD/Typelib/Builtin/NCName.t +t/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.t +t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.t +t/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.t +t/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.t +t/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.t +t/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.t +t/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.t +t/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.t +t/SOAP/WSDL/XSD/Typelib/Builtin/short.t +t/SOAP/WSDL/XSD/Typelib/Builtin/string.t +t/SOAP/WSDL/XSD/Typelib/Builtin/time.t +t/SOAP/WSDL/XSD/Typelib/Builtin/token.t +t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.t +t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.t +t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.t +t/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.t +t/test.wsdl +TEST_COVERAGE +TODO diff --git a/META.yml b/META.yml index 916ee07..8fb75b3 100644 --- a/META.yml +++ b/META.yml @@ -1,18 +1,243 @@ --- name: SOAP-WSDL -version: 1.26 +version: 2.00_17 author: [] -abstract: WSDL support for SOAP::Lite +abstract: SOAP with WSDL support license: artistic resources: license: http://opensource.org/licenses/artistic-license.php requires: - SOAP::Lite: 0 - XML::XPath: 0 + Class::Std: v0.0.8 + Class::Std::Storable: 0 + Data::Dumper: 0 + Date::Format: 0 + Date::Parse: 0 + File::Basename: 0 + File::Path: 0 + Getopt::Long: 0 + LWP::UserAgent: 0 + List::Util: 0 + Template: 0 + Term::ReadKey: 0 + XML::Parser::Expat: 0 provides: SOAP::WSDL: file: lib/SOAP/WSDL.pm - version: 1.25 + version: 2.00_17 + SOAP::WSDL::Base: + file: lib/SOAP/WSDL/Base.pm + version: 2.00_17 + SOAP::WSDL::Binding: + file: lib/SOAP/WSDL/Binding.pm + SOAP::WSDL::Client: + file: lib/SOAP/WSDL/Client.pm + version: 2.00_17 + SOAP::WSDL::Client::Base: + file: lib/SOAP/WSDL/Client/Base.pm + version: 2.00_17 + SOAP::WSDL::Definitions: + file: lib/SOAP/WSDL/Definitions.pm + version: 2.00_17 + SOAP::WSDL::Deserializer::Hash: + file: lib/SOAP/WSDL/Deserializer/Hash.pm + version: 2.00_17 + SOAP::WSDL::Deserializer::SOAP11: + file: lib/SOAP/WSDL/Deserializer/SOAP11.pm + version: 2.00_17 + SOAP::WSDL::Deserializer::SOM: + file: lib/SOAP/WSDL/Deserializer/SOM.pm + version: 2.00_15 + SOAP::WSDL::Expat::Base: + file: lib/SOAP/WSDL/Expat/Base.pm + SOAP::WSDL::Expat::Message2Hash: + file: lib/SOAP/WSDL/Expat/Message2Hash.pm + SOAP::WSDL::Expat::MessageParser: + file: lib/SOAP/WSDL/Expat/MessageParser.pm + SOAP::WSDL::Expat::MessageStreamParser: + file: lib/SOAP/WSDL/Expat/MessageStreamParser.pm + SOAP::WSDL::Factory::Deserializer: + file: lib/SOAP/WSDL/Factory/Deserializer.pm + SOAP::WSDL::Factory::Serializer: + file: lib/SOAP/WSDL/Factory/Serializer.pm + version: 2.00_17 + SOAP::WSDL::Factory::Transport: + file: lib/SOAP/WSDL/Factory/Transport.pm + version: 2.00_17 + SOAP::WSDL::Generator::Template: + file: lib/SOAP/WSDL/Generator/Template.pm + version: 2.00_17 + SOAP::WSDL::Generator::Template::XSD: + file: lib/SOAP/WSDL/Generator/Template/XSD.pm + SOAP::WSDL::Generator::Visitor: + file: lib/SOAP/WSDL/Generator/Visitor.pm + version: 2.00_17 + SOAP::WSDL::Generator::Visitor::Typelib: + file: lib/SOAP/WSDL/Generator/Visitor/Typelib.pm + SOAP::WSDL::Generator::Visitor::Typemap: + file: lib/SOAP/WSDL/Generator/Visitor/Typemap.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::SOAP::Address: + file: lib/SOAP/WSDL/SOAP/Address.pm + SOAP::WSDL::SOAP::Body: + file: lib/SOAP/WSDL/SOAP/Body.pm + SOAP::WSDL::SOAP::Header: + file: lib/SOAP/WSDL/SOAP/Header.pm + SOAP::WSDL::SOAP::HeaderFault: + file: lib/SOAP/WSDL/SOAP/HeaderFault.pm + SOAP::WSDL::SOAP::Operation: + file: lib/SOAP/WSDL/SOAP/Operation.pm + version: 2.00_17 + SOAP::WSDL::SOAP::Typelib::Fault11: + file: lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm + version: 2.00_17 + SOAP::WSDL::Serializer::SOAP11: + file: lib/SOAP/WSDL/Serializer/SOAP11.pm + version: 2.00_13 + SOAP::WSDL::Service: + file: lib/SOAP/WSDL/Service.pm + SOAP::WSDL::Transport::HTTP: + file: lib/SOAP/WSDL/Transport/HTTP.pm + SOAP::WSDL::Transport::Loopback: + file: lib/SOAP/WSDL/Transport/Loopback.pm + version: 2.00_17 + SOAP::WSDL::Transport::Test: + file: lib/SOAP/WSDL/Transport/Test.pm + version: 2.00_14 + SOAP::WSDL::TypeLookup: + file: lib/SOAP/WSDL/TypeLookup.pm + SOAP::WSDL::Types: + file: lib/SOAP/WSDL/Types.pm + SOAP::WSDL::XSD::Builtin: + file: lib/SOAP/WSDL/XSD/Builtin.pm + SOAP::WSDL::XSD::ComplexType: + file: lib/SOAP/WSDL/XSD/ComplexType.pm + version: 2.00_17 + SOAP::WSDL::XSD::Element: + file: lib/SOAP/WSDL/XSD/Element.pm + version: 2.00_17 + 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 + version: 2.00_17 + SOAP::WSDL::XSD::Typelib::Builtin: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin.pm + version: 2.00_17 + SOAP::WSDL::XSD::Typelib::Builtin::ENTITY: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/ENTITY.pm + SOAP::WSDL::XSD::Typelib::Builtin::ID: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/ID.pm + SOAP::WSDL::XSD::Typelib::Builtin::IDREF: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREF.pm + SOAP::WSDL::XSD::Typelib::Builtin::IDREFS: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/IDREFS.pm + SOAP::WSDL::XSD::Typelib::Builtin::NCName: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/NCName.pm + SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKEN.pm + SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/NMTOKENS.pm + SOAP::WSDL::XSD::Typelib::Builtin::NOTATION: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/NOTATION.pm + SOAP::WSDL::XSD::Typelib::Builtin::Name: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/Name.pm + SOAP::WSDL::XSD::Typelib::Builtin::QName: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/QName.pm + SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm + SOAP::WSDL::XSD::Typelib::Builtin::anyType: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm + SOAP::WSDL::XSD::Typelib::Builtin::anyURI: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/anyURI.pm + SOAP::WSDL::XSD::Typelib::Builtin::base64Binary: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/base64Binary.pm + SOAP::WSDL::XSD::Typelib::Builtin::boolean: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/boolean.pm + version: 2.00_17 + SOAP::WSDL::XSD::Typelib::Builtin::byte: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/byte.pm + SOAP::WSDL::XSD::Typelib::Builtin::date: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm + SOAP::WSDL::XSD::Typelib::Builtin::dateTime: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/dateTime.pm + SOAP::WSDL::XSD::Typelib::Builtin::decimal: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/decimal.pm + SOAP::WSDL::XSD::Typelib::Builtin::double: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/double.pm + SOAP::WSDL::XSD::Typelib::Builtin::duration: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/duration.pm + SOAP::WSDL::XSD::Typelib::Builtin::float: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/float.pm + SOAP::WSDL::XSD::Typelib::Builtin::gDay: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/gDay.pm + SOAP::WSDL::XSD::Typelib::Builtin::gMonth: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonth.pm + SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/gMonthDay.pm + SOAP::WSDL::XSD::Typelib::Builtin::gYear: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/gYear.pm + SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/gYearMonth.pm + SOAP::WSDL::XSD::Typelib::Builtin::hexBinary: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/hexBinary.pm + SOAP::WSDL::XSD::Typelib::Builtin::int: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/int.pm + SOAP::WSDL::XSD::Typelib::Builtin::integer: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/integer.pm + SOAP::WSDL::XSD::Typelib::Builtin::language: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/language.pm + SOAP::WSDL::XSD::Typelib::Builtin::list: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/list.pm + SOAP::WSDL::XSD::Typelib::Builtin::long: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/long.pm + SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/negativeInteger.pm + SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/nonNegativeInteger.pm + SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/nonPositiveInteger.pm + SOAP::WSDL::XSD::Typelib::Builtin::normalizedString: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/normalizedString.pm + SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/positiveInteger.pm + SOAP::WSDL::XSD::Typelib::Builtin::short: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/short.pm + SOAP::WSDL::XSD::Typelib::Builtin::string: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/string.pm + SOAP::WSDL::XSD::Typelib::Builtin::time: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/time.pm + SOAP::WSDL::XSD::Typelib::Builtin::token: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/token.pm + SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedByte.pm + SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedInt.pm + SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedLong.pm + SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort: + file: lib/SOAP/WSDL/XSD/Typelib/Builtin/unsignedShort.pm + SOAP::WSDL::XSD::Typelib::ComplexType: + file: lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm + version: 2.00_16 + 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 generated_by: Module::Build version 0.2808 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html diff --git a/README b/README index 62407bf..d7e76c8 100644 --- a/README +++ b/README @@ -1,31 +1,26 @@ -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. +INTRO +----- + +SOAP-WSDL provides a SOAP client with WSDL support. + +This is a developer release - everything may (and most things will) change. + +INSTALLING +---------- + +Use the following mantra: + + perl Build.PL + perl Build + perl Build test + perl Build install + +If you don't have Module::Build installed, you may also use + + perl Makefile.PL + make + make test + make install + +Note that Module::Build is the recommended installer - make will not run +all tests provided with SOAP-WSDL. \ No newline at end of file diff --git a/TEST_COVERAGE b/TEST_COVERAGE new file mode 100644 index 0000000..4e6bf73 --- /dev/null +++ b/TEST_COVERAGE @@ -0,0 +1,11 @@ +# Unfortunately, Build testcover reports test coverage wrong. +# +# To get a complete coverage report, just run this file as a shell script +# on a linux box (or execute the equivalent commands on another OS): + +cd t/ + +find . -type f -name '*.t' | xargs -n 1 /usr/bin/perl -MDevel::Cover=-silent,1,-summary,0 -I../lib + +cover -ignore_re \.t$ -ignore_re ^lib -coverage="statement" -coverage=condition -coverage=subroutine -coverage="branch" + diff --git a/TODO b/TODO new file mode 100644 index 0000000..a973440 --- /dev/null +++ b/TODO @@ -0,0 +1,27 @@ +TODO list for SOAP::WSDL + +2.00 Pre-releases +-------- +* Implement a Generator Plugin API + +* Implement a interface similar to SOAP::Schema (#1783639) + +2.1 release +-------- +* Support namespaces in SOAP message payload + +* Support the xsi:type attribute on derived types on the wire + +* SOAP1.2 support + +2.2 release +-------- +* XML schema support ("minimal conformant") (#1764845) + +* Support SOAP attachments + +* Act as SOAP Server + +3.0 release +-------- +We're not thinking that far ahead right now. diff --git a/benchmark/01_expat.t b/benchmark/01_expat.t new file mode 100644 index 0000000..5d83397 --- /dev/null +++ b/benchmark/01_expat.t @@ -0,0 +1,97 @@ +#!/usr/bin/perl -w +%DB::packages=(SOAP::WSDL::Expat::MessageParser => 1); +use strict; +use warnings; +use lib '../lib'; +use lib 'lib'; +use lib '../t/lib'; +# use SOAP::WSDL::SAX::MessageHandler; + +use Benchmark; +use SOAP::WSDL::Expat::MessageParser; +use SOAP::WSDL::Expat::Message2Hash; +use XML::Simple; +use XML::LibXML; +use MyComplexType; +use MyElement; +use MySimpleType; + +my $xml = q{ + + Test + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test2 + Test + Test + Test + Test + Test + Test + Test + Test + Test + Test + Test + +}; + + +my $parser = SOAP::WSDL::Expat::MessageParser->new({ + class_resolver => 'FakeResolver' +}); + +my $hash_parser = SOAP::WSDL::Expat::Message2Hash->new(); + +$XML::Simple::PREFERRED_PARSER = 'XML::Parser'; + +my $libxml = XML::LibXML->new(); +my @data; +timethese 10000, +{ + 'Hash (SOAP:WSDL)' => sub { push @data, $hash_parser->parse( $xml ) }, + 'XSD (SOAP::WSDL)' => sub { push @data, $parser->parse( $xml ) }, + 'XML::Simple (Hash)' => sub { push @data, XMLin $xml }, +# 'XML::LibXML (DOM)' => sub { push @data, $libxml->parse_string( $xml ) }, +}; + +# use Test::More tests => 1; +#is $parser->get_data(), q{} +# . q{TestTest2} +# , 'Content comparison'; + +#$parser->class_resolver( 'FakeResolver2' ); + + +# data classes reside in t/lib/Typelib/ +BEGIN { + package FakeResolver; + { + my %class_list = ( + 'MyAtomicComplexTypeElement' => 'MyAtomicComplexTypeElement', + 'MyAtomicComplexTypeElement/test' => 'MyTestElement', + 'MyAtomicComplexTypeElement/test2' => 'MyTestElement2', + ); + + sub get_map { return \%class_list }; + + 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"; + }; + }; +}; diff --git a/benchmark/XSD/01_anyType.t b/benchmark/XSD/01_anyType.t new file mode 100644 index 0000000..a4ef438 --- /dev/null +++ b/benchmark/XSD/01_anyType.t @@ -0,0 +1,21 @@ +use strict; +use warnings; +use Benchmark; +use lib '../../lib'; +use SOAP::WSDL::XSD::Typelib::Builtin::anyType; + +my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new(); + +timethese 10000, { + 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anyType->new() }, + 'new with params' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anyType->new({ + xmlns => 'urn:Test' + }) }, + 'set_FOO' => sub { $obj->set_xmlns('Test') }, +}; + +my $data; +timethese 1000000, { + 'set_FOO' => sub { $obj->set_xmlns('Test') }, + 'get_FOO' => sub { $data = $obj->get_xmlns() }, +}; diff --git a/benchmark/XSD/02_anySimpleType.t b/benchmark/XSD/02_anySimpleType.t new file mode 100644 index 0000000..5a1e09c --- /dev/null +++ b/benchmark/XSD/02_anySimpleType.t @@ -0,0 +1,22 @@ +use strict; +use warnings; +use Benchmark; +use lib '../../lib'; +use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; + +my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new(); + +timethese 10000, { + 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new() }, + 'new + params' => sub { SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ + xmlns => 'urn:Test', + value => 'Teststring' + }) }, + 'set_FOO' => sub { $obj->set_xmlns('Test') }, +}; + +my $data; +timethese 1000000, { + 'set_FOO' => sub { $obj->set_xmlns('Test') }, + 'get_FOO' => sub { $data = $obj->get_xmlns() }, +}; diff --git a/benchmark/XSD/03_string.t b/benchmark/XSD/03_string.t new file mode 100644 index 0000000..5bd4e49 --- /dev/null +++ b/benchmark/XSD/03_string.t @@ -0,0 +1,22 @@ +use strict; +use warnings; +use Benchmark; +use lib '../../lib'; +use SOAP::WSDL::XSD::Typelib::Builtin::string; + +my $obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new(); + +timethese 10000, { + 'new' => sub { SOAP::WSDL::XSD::Typelib::Builtin::string->new() }, + 'new + params' => sub { SOAP::WSDL::XSD::Typelib::Builtin::string->new({ + xmlns => 'urn:Test', + value => 'Teststring' + }) }, + 'set_FOO' => sub { $obj->set_xmlns('Test') }, +}; + +my $data; +timethese 1000000, { + 'set_FOO' => sub { $obj->set_xmlns('Test') }, + 'get_FOO' => sub { $data = $obj->get_xmlns() }, +}; diff --git a/benchmark/smallprof.out b/benchmark/smallprof.out new file mode 100644 index 0000000..017928d --- /dev/null +++ b/benchmark/smallprof.out @@ -0,0 +1,324 @@ + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 1 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 1:#!/usr/bin/perl + 0 0.00000 0.00000 2:package SOAP::WSDL::Expat::MessageParser; + 0 0.00000 0.00000 3:use strict; + 0 0.00000 0.00000 4:use warnings; + 0 0.00000 0.00000 5:use SOAP::WSDL::XSD::Typelib::Builtin; + 0 0.00000 0.00000 6:use XML::Parser::Expat; + 0 0.00000 0.00000 7: + 0 0.00000 0.00000 8:sub new { + 1 0.00000 0.00000 9: my ($class, $args) = @_; + 0 0.00000 0.00000 10: my $self = { + 0 0.00000 0.00000 11: class_resolver => $args->{ + 1 0.00001 0.00000 12: strict => exists $args->{ strict } ? + 0 0.00000 0.00000 13: }; + 1 0.00001 0.00000 14: bless $self, $class; + 1 0.02383 0.02000 15: return $self; + 0 0.00000 0.00000 16:} + 0 0.00000 0.00000 17: + 0 0.00000 0.00000 18:sub class_resolver { + 0 0.00000 0.00000 19: my $self = shift; + 0 0.00000 0.00000 20: $self->{ class_resolver } = shift; + 0 0.00000 0.00000 21: return; + 0 0.00000 0.00000 22:} + 0 0.00000 0.00000 23: + 0 0.00000 0.00000 24:sub _initialize { + 1000 0.00098 0.01000 25: my ($self, $parser) = @_; + 1000 0.04304 0.02000 26: $self->{ parser } = $parser; + 0 0.00000 0.00000 27: + 1000 0.00140 0.01000 28: delete $self->{ data }; + 0 0.00000 0.00000 29: + 1000 0.00042 0.03000 30: my $characters; + 0 0.00000 0.00000 31: #my @characters_from = (); + 1000 0.00059 0.00000 32: my $current = undef; + 1000 0.00093 0.00000 33: my $list = []; # + 1000 0.00065 0.02000 34: my $path = []; # + 1000 0.00064 0.02000 35: my $skip = 0; # + 1000 0.00049 0.01000 36: my $current_part = q{}; # are + 0 0.00000 0.00000 37: + 1000 0.00041 0.00000 38: my $depth = 0; + 0 0.00000 0.00000 39: + 0 0.00000 0.00000 40: my %content_check = $self->{strict} + 0 0.00000 0.00000 41: ? ( + 0 0.00000 0.00000 42: 0 => sub { + 1000 0.00115 0.00000 43: die "Bad top node $_[1]" + 1000 0.01666 0.03000 44: die "Bad namespace for + 0 0.00000 0.00000 45: if $_[0]- + 1000 0.00051 0.02000 46: $depth++; + 1000 0.00413 0.01000 47: return; + 0 0.00000 0.00000 48: }, + 0 0.00000 0.00000 49: 1 => sub { + 1000 0.00050 0.02000 50: $depth++; + 1000 0.03690 0.04000 51: return; + 0 0.00000 0.00000 52: } + 0 0.00000 0.00000 53: ) + 1000 0.01120 0.03000 54: : (); + 0 0.00000 0.00000 55: + 0 0.00000 0.00000 56: my $char_handler = sub { + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 2 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 57: # push @characters_from, $_[1] if + 80000 0.19296 1.00000 58: $characters .= $_[1] if $_[1] + 0 0.00000 0.00000 59: + 80000 0.27660 0.97000 60: return; + 1000 0.00449 0.00000 61: }; + 0 0.00000 0.00000 62: + 0 0.00000 0.00000 63: # use "globals" for speed + 1000 0.00162 0.01000 64: my ($_prefix, $_method, + 0 0.00000 0.00000 65: $_class) = (); + 0 0.00000 0.00000 66: + 0 0.00000 0.00000 67: no strict qw(refs); + 0 0.00000 0.00000 68: $parser->setHandlers( + 0 0.00000 0.00000 69: Start => sub { + 0 0.00000 0.00000 70: # my ($parser, $element, %_attrs) + 0 0.00000 0.00000 71: # $depth = $parser->depth(); + 0 0.00000 0.00000 72: + 0 0.00000 0.00000 73: # call methods without using + 0 0.00000 0.00000 74: # That's slightly faster than + 0 0.00000 0.00000 75: # and we don't have to pass $_[1] + 0 0.00000 0.00000 76: # Yup, that's dirty. + 28000 0.03037 0.32000 77: return &{$content_check{ $depth + 0 0.00000 0.00000 78: + 26000 0.02735 0.15000 79: push @{ $path }, $_[1]; # + 26000 0.01366 0.29000 80: return if $skip; # + 0 0.00000 0.00000 81: + 0 0.00000 0.00000 82: # resolve class of this element + 0 0.00000 0.00000 83: $_class = $self->{ class_resolver + 0 0.00000 0.00000 84: or die "Cannot resolve class + 26000 0.28196 0.56000 85: . join('/', @{ $path }) . + 0 0.00000 0.00000 86: + 26000 0.01695 0.35000 87: if ($_class eq '__SKIP__') { + 0 0.00000 0.00000 88: $skip = join('/', @{ $path + 0 0.00000 0.00000 89: $self->setHandlers( Char => + 0 0.00000 0.00000 90: return; + 0 0.00000 0.00000 91: } + 0 0.00000 0.00000 92: + 26000 0.02064 0.35000 93: push @$list, $current; # step + 0 0.00000 0.00000 94: + 26000 0.02021 0.23000 95: $characters = q(); # empty + 0 0.00000 0.00000 96: #@characters_from = (); + 0 0.00000 0.00000 97: + 0 0.00000 0.00000 98: # Check whether we have a builtin + 0 0.00000 0.00000 99: # We could replace this with + 0 0.00000 0.00000 100: # match is a bit faster if the + 0 0.00000 0.00000 101: # if $class matches... + 26000 0.01676 0.21000 102: if (index $_class, + 0 0.00000 0.00000 103: # check wheter there is a + 0 0.00000 0.00000 104: # or a "new" method + 0 0.00000 0.00000 105: # If not, require it - all + 0 0.00000 0.00000 106: # define new() + 0 0.00000 0.00000 107: # This is not exactly the + 0 0.00000 0.00000 108: defined *{ "$_class\::new" }{ + 26000 0.07804 0.33000 109: or scalar @{ *{ + 0 0.00000 0.00000 110: or eval "require $_class" + 0 0.00000 0.00000 111: or die $@; + 0 0.00000 0.00000 112: } + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 3 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 113: + 26000 0.45038 0.81000 114: $current = $_class->new({ + 0 0.00000 0.00000 115: + 0 0.00000 0.00000 116: # remember top level element + 0 0.00000 0.00000 117: exists $self->{ data } + 26000 0.02113 0.22000 118: or ($self->{ data } = + 26000 0.01267 0.25000 119: $depth++; + 26000 0.07978 0.40000 120: return; + 0 0.00000 0.00000 121: }, + 0 0.00000 0.00000 122: + 0 0.00000 0.00000 123: Char => $char_handler, + 0 0.00000 0.00000 124: + 0 0.00000 0.00000 125: End => sub { + 0 0.00000 0.00000 126: + 28000 0.01974 0.26000 127: pop @{ $path }; + 0 0.00000 0.00000 128: + 28000 0.01197 0.18000 129: if ($skip) { + 0 0.00000 0.00000 130: return if $skip ne join '/', + 0 0.00000 0.00000 131: $skip = 0; + 0 0.00000 0.00000 132: $_[0]->setHandler( Char => + 0 0.00000 0.00000 133: return; + 0 0.00000 0.00000 134: } + 0 0.00000 0.00000 135: + 28000 0.01687 0.25000 136: $depth--; + 0 0.00000 0.00000 137: + 0 0.00000 0.00000 138: # This one easily handles ignores + 28000 0.10769 0.33000 139: return if not ref $list->[-1]; + 0 0.00000 0.00000 140: + 0 0.00000 0.00000 141: # set characters in current if we + 0 0.00000 0.00000 142: # we may have characters in + 0 0.00000 0.00000 143: # too - maybe we should rely on + 0 0.00000 0.00000 144: # may get a speedup by defining a + 0 0.00000 0.00000 145: # and looking it up via exists + 0 0.00000 0.00000 146:# if ( $current- + 0 0.00000 0.00000 147:# $current->set_value( + 0 0.00000 0.00000 148:# } + 0 0.00000 0.00000 149: # currently doesn't work, as + 0 0.00000 0.00000 150: # maybe change ? + 25000 0.21156 0.56000 151: $current->set_value( $characters + 0 0.00000 0.00000 152: #$current->set_value( join + 25000 0.08260 0.32000 153: $characters = q{}; + 0 0.00000 0.00000 154:# undef @characters_from; + 0 0.00000 0.00000 155: # set appropriate attribute in + 0 0.00000 0.00000 156: # multiple values must be + 0 0.00000 0.00000 157: #$_method = "add_$_localname"; + 25000 0.01494 0.21000 158: $_method = "add_$_[1]"; + 25000 0.55155 0.86000 159: $list->[-1]->$_method( $current + 0 0.00000 0.00000 160: + 25000 0.02121 0.14000 161: $current = pop @$list; + 25000 0.07002 0.34000 162: return; + 0 0.00000 0.00000 163: } + 1000 0.12135 0.08000 164: ); + 1000 0.13602 0.11000 165: return $parser; + 0 0.00000 0.00000 166:} + 0 0.00000 0.00000 167: + 0 0.00000 0.00000 168:sub parse { + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 4 + ================================================================= + count wall tm cpu time line + 1000 0.00055 0.03000 169: eval { + 1000 0.07420 0.07000 170: $_[0]->_initialize( + 0 0.00000 0.00000 171: XML::Parser::Expat->new( + 0 0.00000 0.00000 172: Namespaces => 1 + 0 0.00000 0.00000 173: ) + 0 0.00000 0.00000 174: )->parse( $_[1] ); + 1000 0.01030 0.02000 175: $_[0]->{ parser }->release(); + 0 0.00000 0.00000 176: }; + 1000 0.00034 0.00000 177: die $@ if $@; + 1000 2.73620 2.67000 178: return $_[0]->{ data }; + 0 0.00000 0.00000 179:} + 0 0.00000 0.00000 180: + 0 0.00000 0.00000 181:sub parsefile { + 0 0.00000 0.00000 182: eval { + 0 0.00000 0.00000 183: $_[0]->_initialize( + 0 0.00000 0.00000 184: $_[0]->{ parser }->release(); + 0 0.00000 0.00000 185: }; + 0 0.00000 0.00000 186: die $@, $_[1] if $@; + 0 0.00000 0.00000 187: return $_[0]->{ data }; + 0 0.00000 0.00000 188:} + 0 0.00000 0.00000 189: + 0 0.00000 0.00000 190:# SAX-like aliases + 0 0.00000 0.00000 191:sub parse_string; + 0 0.00000 0.00000 192:*parse_string = \&parse; + 0 0.00000 0.00000 193: + 0 0.00000 0.00000 194:sub parse_file; + 0 0.00000 0.00000 195:*parse_file = \&parsefile; + 0 0.00000 0.00000 196: + 0 0.00000 0.00000 197:sub get_data { + 0 0.00000 0.00000 198: return $_[0]->{ data }; + 0 0.00000 0.00000 199:} + 0 0.00000 0.00000 200: + 0 0.00000 0.00000 201:1; + 0 0.00000 0.00000 202: + 0 0.00000 0.00000 203:=pod + ================ SmallProf version 2.02 ================ + Profile of 01_expat.t Page 5 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 1:#!/usr/bin/perl -w + 1 0.00003 0.00000 2:%DB::packages=(SOAP::WSDL::Expat::MessagePars + 0 0.00000 0.00000 3:use strict; + 0 0.00000 0.00000 4:use warnings; + 0 0.00000 0.00000 5:use lib '../lib'; + 0 0.00000 0.00000 6:use lib 'lib'; + 0 0.00000 0.00000 7:use lib '../t/lib'; + 0 0.00000 0.00000 8:use SOAP::WSDL::SAX::MessageHandler; + 0 0.00000 0.00000 9: + 0 0.00000 0.00000 10:use Benchmark; + 0 0.00000 0.00000 11:use SOAP::WSDL::Expat::MessageParser; + 0 0.00000 0.00000 12:use SOAP::WSDL::Expat::Message2Hash; + 0 0.00000 0.00000 13:use XML::Simple; + 0 0.00000 0.00000 14:use XML::LibXML; + 0 0.00000 0.00000 15:use MyComplexType; + 0 0.00000 0.00000 16:use MyElement; + 0 0.00000 0.00000 17:use MySimpleType; + 0 0.00000 0.00000 18: + 0 0.00000 0.00000 19:my $xml = q{Test + 0 0.00000 0.00000 23: Test2 + 0 0.00000 0.00000 24: Test2 + 0 0.00000 0.00000 25: Test2 + 0 0.00000 0.00000 26: Test2 + 0 0.00000 0.00000 27: Test2 + 0 0.00000 0.00000 28: Test2 + 0 0.00000 0.00000 29: Test2 + 0 0.00000 0.00000 30: Test2 + 0 0.00000 0.00000 31: Test2 + 0 0.00000 0.00000 32: Test2 + 0 0.00000 0.00000 33: Test2 + 0 0.00000 0.00000 34: Test2 + 0 0.00000 0.00000 35: Test2 + 0 0.00000 0.00000 36: Test + 0 0.00000 0.00000 37: Test + 0 0.00000 0.00000 38: Test + 0 0.00000 0.00000 39: Test + 0 0.00000 0.00000 40: Test + 0 0.00000 0.00000 41: Test + 0 0.00000 0.00000 42: Test + 0 0.00000 0.00000 43: Test + 0 0.00000 0.00000 44: Test + 0 0.00000 0.00000 45: Test + 0 0.00000 0.00000 46: Test + 0 0.00000 0.00000 47: + 0 0.00000 0.00000 48:}; + 0 0.00000 0.00000 49: + 0 0.00000 0.00000 50: + 0 0.00000 0.00000 51:my $parser = + 0 0.00000 0.00000 52: class_resolver => 'FakeResolver' + 0 0.00000 0.00000 53:}); + 0 0.00000 0.00000 54: + 0 0.00000 0.00000 55:my $hash_parser = + 0 0.00000 0.00000 56: + ================ SmallProf version 2.02 ================ + Profile of 01_expat.t Page 6 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 57:$XML::Simple::PREFERRED_PARSER = + 0 0.00000 0.00000 58: + 0 0.00000 0.00000 59:my $libxml = XML::LibXML->new(); + 0 0.00000 0.00000 60:my @data; + 0 0.00000 0.00000 61:timethese 1000, + 0 0.00000 0.00000 62:{ + 0 0.00000 0.00000 63: # 'Hash (SOAP:WSDL)' => sub { push @data, + 0 0.00000 0.00000 64: 'SOAP::WSDL' => sub { push @data, $parser- + 0 0.00000 0.00000 65:# 'XML::Simple (Hash)' => sub { push @data, + 0 0.00000 0.00000 66:# 'XML::LibXML (DOM)' => sub { push @data, + 0 0.00000 0.00000 67:}; + 0 0.00000 0.00000 68: + 0 0.00000 0.00000 69:# use Test::More tests => 1; + 0 0.00000 0.00000 70:#is $parser->get_data(), + 0 0.00000 0.00000 71:# . q{Testclass_resolver( 'FakeResolver2' ); + 0 0.00000 0.00000 75: + 0 0.00000 0.00000 76: + 0 0.00000 0.00000 77:# data classes reside in t/lib/Typelib/ + 0 0.00000 0.00000 78:BEGIN { + 0 0.00000 0.00000 79: package FakeResolver; + 0 0.00000 0.00000 80: { + 0 0.00000 0.00000 81: my %class_list = ( + 0 0.00000 0.00000 82: 'MyAtomicComplexTypeElement' => + 0 0.00000 0.00000 83: 'MyAtomicComplexTypeElement/test' + 0 0.00000 0.00000 84: + 0 0.00000 0.00000 85: ); + 0 0.00000 0.00000 86: + 0 0.00000 0.00000 87: sub get_map { return \%class_list }; + 0 0.00000 0.00000 88: + 0 0.00000 0.00000 89: sub new { return bless {}, + 0 0.00000 0.00000 90: + 0 0.00000 0.00000 91: sub get_class { + 0 0.00000 0.00000 92: my $name = join('/', @{ $_[1] }); + 0 0.00000 0.00000 93: return ($class_list{ $name }) ? + 0 0.00000 0.00000 94: : warn "no class found for + 0 0.00000 0.00000 95: }; + 0 0.00000 0.00000 96: }; + 0 0.00000 0.00000 97:}; diff --git a/benchmark/smallprof.out-whitespace b/benchmark/smallprof.out-whitespace new file mode 100644 index 0000000..da5f1eb --- /dev/null +++ b/benchmark/smallprof.out-whitespace @@ -0,0 +1,315 @@ + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 1 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 1:#!/usr/bin/perl + 0 0.00000 0.00000 2:package SOAP::WSDL::Expat::MessageParser; + 0 0.00000 0.00000 3:use strict; + 0 0.00000 0.00000 4:use warnings; + 0 0.00000 0.00000 5:use SOAP::WSDL::XSD::Typelib::Builtin; + 0 0.00000 0.00000 6:use XML::Parser::Expat; + 0 0.00000 0.00000 7: + 0 0.00000 0.00000 8:sub new { + 1 0.00000 0.00000 9: my ($class, $args) = @_; + 0 0.00000 0.00000 10: my $self = { + 0 0.00000 0.00000 11: class_resolver => $args->{ + 1 0.00001 0.00000 12: strict => exists $args->{ strict } ? + 0 0.00000 0.00000 13: }; + 1 0.00001 0.00000 14: bless $self, $class; + 1 0.02309 0.03000 15: return $self; + 0 0.00000 0.00000 16:} + 0 0.00000 0.00000 17: + 0 0.00000 0.00000 18:sub class_resolver { + 1 0.00000 0.00000 19: my $self = shift; + 1 2.74336 2.69000 20: $self->{ class_resolver } = shift; + 0 0.00000 0.00000 21:} + 0 0.00000 0.00000 22: + 0 0.00000 0.00000 23:sub _initialize { + 1000 0.00163 0.01000 24: my ($self, $parser) = @_; + 1000 0.03682 0.05000 25: $self->{ parser } = $parser; + 0 0.00000 0.00000 26: + 1000 0.00138 0.01000 27: delete $self->{ data }; + 0 0.00000 0.00000 28: + 1000 0.00048 0.01000 29: my $characters; + 1000 0.00091 0.00000 30: my $current = undef; + 1000 0.00097 0.01000 31: my $list = []; # + 1000 0.00107 0.01000 32: my $path = []; # + 1000 0.00054 0.01000 33: my $skip = 0; # + 1000 0.00053 0.01000 34: my $current_part = q{}; # are + 0 0.00000 0.00000 35: + 1000 0.00041 0.02000 36: my $depth = 0; + 0 0.00000 0.00000 37: + 0 0.00000 0.00000 38: my %content_check = $self->{strict} + 0 0.00000 0.00000 39: ? ( + 0 0.00000 0.00000 40: 0 => sub { + 1000 0.00097 0.02000 41: die "Bad top node $_[1]" + 1000 0.01651 0.00000 42: die "Bad namespace for + 0 0.00000 0.00000 43: if $_[0]- + 1000 0.00068 0.00000 44: $depth++; + 1000 0.00441 0.02000 45: return; + 0 0.00000 0.00000 46: }, + 0 0.00000 0.00000 47: 1 => sub { + 1000 0.00369 0.02000 48: die "Bad node $_[1]. + 1000 0.00060 0.00000 49: $depth++; + 1000 0.03693 0.03000 50: return; + 0 0.00000 0.00000 51: } + 0 0.00000 0.00000 52: ) + 1000 0.01252 0.01000 53: : (); + 0 0.00000 0.00000 54: + 0 0.00000 0.00000 55: # use "globals" for speed + 1000 0.00095 0.01000 56: my ($_prefix, $_method, + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 2 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 57: $_class) = (); + 0 0.00000 0.00000 58: + 0 0.00000 0.00000 59: no strict qw(refs); + 0 0.00000 0.00000 60: $parser->setHandlers( + 0 0.00000 0.00000 61: Start => sub { + 0 0.00000 0.00000 62: # my ($parser, $element, %_attrs) + 0 0.00000 0.00000 63: # $depth = $parser->depth(); + 0 0.00000 0.00000 64: + 0 0.00000 0.00000 65: # call methods without using + 0 0.00000 0.00000 66: # That's slightly faster than + 0 0.00000 0.00000 67: # and we don't have to pass $_[1] + 0 0.00000 0.00000 68: # Yup, that's dirty. + 28000 0.03090 0.31000 69: return &{$content_check{ $depth + 0 0.00000 0.00000 70: + 26000 0.03309 0.32000 71: push @{ $path }, $_[1]; # + 26000 0.01337 0.21000 72: return if $skip; # + 0 0.00000 0.00000 73: + 0 0.00000 0.00000 74: # resolve class of this element + 0 0.00000 0.00000 75: $_class = $self->{ class_resolver + 0 0.00000 0.00000 76: or die "Cannot resolve class + 26000 0.28467 0.53000 77: . join('/', @{ $path }) . + 0 0.00000 0.00000 78: + 0 0.00000 0.00000 79: # maybe write as "return $skip = + 0 0.00000 0.00000 80: # would save a BLOCK... + 26000 0.03919 0.30000 81: return $skip = join('/', @{ $path + 0 0.00000 0.00000 82: + 26000 0.05079 0.22000 83: push @$list, $current; # step + 0 0.00000 0.00000 84: + 26000 0.07934 0.26000 85: $characters = q(); # empty + 0 0.00000 0.00000 86: + 0 0.00000 0.00000 87: # Check whether we have a builtin + 0 0.00000 0.00000 88: # We could replace this with + 0 0.00000 0.00000 89: # match is a bit faster if the + 0 0.00000 0.00000 90: # if $class matches... + 26000 0.01981 0.22000 91: if (index $_class, + 0 0.00000 0.00000 92: # check wheter there is a + 0 0.00000 0.00000 93: # or a "new" method + 0 0.00000 0.00000 94: # If not, require it - all + 0 0.00000 0.00000 95: # define new() + 0 0.00000 0.00000 96: # This is not exactly the + 0 0.00000 0.00000 97: defined *{ "$_class\::new" }{ + 26000 0.08308 0.26000 98: or scalar @{ *{ + 0 0.00000 0.00000 99: or eval "require $_class" + 0 0.00000 0.00000 100: or die $@; + 0 0.00000 0.00000 101: } + 0 0.00000 0.00000 102: + 26000 0.45611 0.64000 103: $current = $_class->new({ + 0 0.00000 0.00000 104: + 0 0.00000 0.00000 105: # remember top level element + 0 0.00000 0.00000 106: exists $self->{ data } + 26000 0.02518 0.26000 107: or ($self->{ data } = + 26000 0.01496 0.32000 108: $depth++; + 26000 0.07949 0.39000 109: return; + 0 0.00000 0.00000 110: }, + 0 0.00000 0.00000 111: + 0 0.00000 0.00000 112: Char => sub { + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 3 + ================================================================= + count wall tm cpu time line + 80000 0.05801 0.73000 113: return if $skip; + 80000 0.38097 1.05000 114: return if $_[1] =~m{ \A \s* \z + 25000 0.01804 0.24000 115: $characters .= $_[1]; + 25000 0.07404 0.32000 116: return; + 0 0.00000 0.00000 117: }, + 0 0.00000 0.00000 118: + 0 0.00000 0.00000 119: End => sub { + 0 0.00000 0.00000 120: + 28000 0.02209 0.25000 121: pop @{ $path }; + 0 0.00000 0.00000 122: + 28000 0.01658 0.29000 123: if ($skip) { + 0 0.00000 0.00000 124: return if $skip ne join '/', + 0 0.00000 0.00000 125: $skip = 0; + 0 0.00000 0.00000 126: return; + 0 0.00000 0.00000 127: } + 0 0.00000 0.00000 128: + 28000 0.01628 0.26000 129: $depth--; + 0 0.00000 0.00000 130: + 0 0.00000 0.00000 131: # This one easily handles ignores + 28000 0.11185 0.27000 132: return if not ref $list->[-1]; + 0 0.00000 0.00000 133: + 0 0.00000 0.00000 134: # set characters in current if we + 0 0.00000 0.00000 135: # we may have characters in + 0 0.00000 0.00000 136: # too - maybe we should rely on + 0 0.00000 0.00000 137: # may get a speedup by defining a + 0 0.00000 0.00000 138: # and looking it up via exists + 0 0.00000 0.00000 139:# if ( $current- + 0 0.00000 0.00000 140:# $current->set_value( + 0 0.00000 0.00000 141:# } + 0 0.00000 0.00000 142: # currently doesn't work, as + 0 0.00000 0.00000 143: # maybe change ? + 25000 0.28121 0.53000 144: $current->set_value( $characters + 25000 0.01730 0.20000 145: $characters = q{}; + 0 0.00000 0.00000 146: # set appropriate attribute in + 0 0.00000 0.00000 147: # multiple values must be + 0 0.00000 0.00000 148: #$_method = "add_$_localname"; + 25000 0.01976 0.23000 149: $_method = "add_$_[1]"; + 25000 0.55083 0.85000 150: $list->[-1]->$_method( $current + 0 0.00000 0.00000 151: + 25000 0.02277 0.25000 152: $current = pop @$list; + 25000 0.06949 0.36000 153: return; + 0 0.00000 0.00000 154: } + 1000 0.12369 0.12000 155: ); + 1000 0.13620 0.08000 156: return $parser; + 0 0.00000 0.00000 157:} + 0 0.00000 0.00000 158: + 0 0.00000 0.00000 159:sub parse { + 1000 0.00065 0.02000 160: eval { + 1000 0.07514 0.09000 161: $_[0]->_initialize( + 0 0.00000 0.00000 162: XML::Parser::Expat->new( + 0 0.00000 0.00000 163: Namespaces => 1 + 0 0.00000 0.00000 164: ) + 0 0.00000 0.00000 165: )->parse( $_[1] ); + 1000 0.01077 0.02000 166: $_[0]->{ parser }->release(); + 0 0.00000 0.00000 167: }; + 1000 0.00051 0.00000 168: die $@ if $@; + ================ SmallProf version 2.02 ================ + Profile of ../lib/SOAP/WSDL/Expat/MessageParser.pm Page 4 + ================================================================= + count wall tm cpu time line + 1000 0.01431 0.04000 169: return $_[0]->{ data }; + 0 0.00000 0.00000 170:} + 0 0.00000 0.00000 171: + 0 0.00000 0.00000 172:sub parsefile { + 0 0.00000 0.00000 173: eval { + 0 0.00000 0.00000 174: $_[0]->_initialize( + 0 0.00000 0.00000 175: $_[0]->{ parser }->release(); + 0 0.00000 0.00000 176: }; + 0 0.00000 0.00000 177: die $@, $_[1] if $@; + 0 0.00000 0.00000 178: return $_[0]->{ data }; + 0 0.00000 0.00000 179:} + 0 0.00000 0.00000 180: + 0 0.00000 0.00000 181:# SAX-like aliases + 0 0.00000 0.00000 182:sub parse_string; + 0 0.00000 0.00000 183:*parse_string = \&parse; + 0 0.00000 0.00000 184: + 0 0.00000 0.00000 185:sub parse_file; + 0 0.00000 0.00000 186:*parse_file = \&parsefile; + 0 0.00000 0.00000 187: + 0 0.00000 0.00000 188:sub get_data { + 0 0.00000 0.00000 189: return $_[0]->{ data }; + 0 0.00000 0.00000 190:} + 0 0.00000 0.00000 191: + 0 0.00000 0.00000 192:1; + 0 0.00000 0.00000 193: + 0 0.00000 0.00000 194:=pod + ================ SmallProf version 2.02 ================ + Profile of 01_expat.t Page 5 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 1:#!/usr/bin/perl -w + 1 0.00002 0.00000 2:%DB::packages=(SOAP::WSDL::Expat::MessagePars + 0 0.00000 0.00000 3:use strict; + 0 0.00000 0.00000 4:use warnings; + 0 0.00000 0.00000 5:use lib '../lib'; + 0 0.00000 0.00000 6:use lib 'lib'; + 0 0.00000 0.00000 7:use lib '../t/lib'; + 0 0.00000 0.00000 8:use SOAP::WSDL::SAX::MessageHandler; + 0 0.00000 0.00000 9: + 0 0.00000 0.00000 10:use Benchmark; + 0 0.00000 0.00000 11:use SOAP::WSDL::Expat::MessageParser; + 0 0.00000 0.00000 12:use SOAP::WSDL::Expat::Message2Hash; + 0 0.00000 0.00000 13:use XML::Simple; + 0 0.00000 0.00000 14:use XML::LibXML; + 0 0.00000 0.00000 15:use MyComplexType; + 0 0.00000 0.00000 16:use MyElement; + 0 0.00000 0.00000 17:use MySimpleType; + 0 0.00000 0.00000 18: + 0 0.00000 0.00000 19:my $xml = q{Test + 0 0.00000 0.00000 23: Test2 + 0 0.00000 0.00000 24: Test2 + 0 0.00000 0.00000 25: Test2 + 0 0.00000 0.00000 26: Test2 + 0 0.00000 0.00000 27: Test2 + 0 0.00000 0.00000 28: Test2 + 0 0.00000 0.00000 29: Test2 + 0 0.00000 0.00000 30: Test2 + 0 0.00000 0.00000 31: Test2 + 0 0.00000 0.00000 32: Test2 + 0 0.00000 0.00000 33: Test2 + 0 0.00000 0.00000 34: Test2 + 0 0.00000 0.00000 35: Test2 + 0 0.00000 0.00000 36: Test + 0 0.00000 0.00000 37: Test + 0 0.00000 0.00000 38: Test + 0 0.00000 0.00000 39: Test + 0 0.00000 0.00000 40: Test + 0 0.00000 0.00000 41: Test + 0 0.00000 0.00000 42: Test + 0 0.00000 0.00000 43: Test + 0 0.00000 0.00000 44: Test + 0 0.00000 0.00000 45: Test + 0 0.00000 0.00000 46: Test + 0 0.00000 0.00000 47: + 0 0.00000 0.00000 48:}; + 0 0.00000 0.00000 49: + 0 0.00000 0.00000 50: + 0 0.00000 0.00000 51:my $parser = + 0 0.00000 0.00000 52: class_resolver => 'FakeResolver' + 0 0.00000 0.00000 53:}); + 0 0.00000 0.00000 54: + 0 0.00000 0.00000 55:my $hash_parser = + 0 0.00000 0.00000 56: + ================ SmallProf version 2.02 ================ + Profile of 01_expat.t Page 6 + ================================================================= + count wall tm cpu time line + 0 0.00000 0.00000 57:$XML::Simple::PREFERRED_PARSER = + 0 0.00000 0.00000 58: + 0 0.00000 0.00000 59:my $libxml = XML::LibXML->new(); + 0 0.00000 0.00000 60:my @data; + 0 0.00000 0.00000 61:timethese 1000, + 0 0.00000 0.00000 62:{ + 0 0.00000 0.00000 63:# 'SOAP::WSDL Hash' => sub { push @data, + 0 0.00000 0.00000 64: 'SOAP::WSDL' => sub { push @data, $parser- + 0 0.00000 0.00000 65:# 'XML::Simple (Hash)' => sub { push @data, + 0 0.00000 0.00000 66:# 'XML::LibXML (DOM)' => sub { push @data, + 0 0.00000 0.00000 67:}; + 0 0.00000 0.00000 68: + 0 0.00000 0.00000 69:# use Test::More tests => 1; + 0 0.00000 0.00000 70:#is $parser->get_data(), + 0 0.00000 0.00000 71:# . q{Testclass_resolver( 'FakeResolver2' ); + 0 0.00000 0.00000 75: + 0 0.00000 0.00000 76: + 0 0.00000 0.00000 77:# data classes reside in t/lib/Typelib/ + 0 0.00000 0.00000 78:BEGIN { + 0 0.00000 0.00000 79: package FakeResolver; + 0 0.00000 0.00000 80: { + 0 0.00000 0.00000 81: my %class_list = ( + 0 0.00000 0.00000 82: 'MyAtomicComplexTypeElement' => + 0 0.00000 0.00000 83: 'MyAtomicComplexTypeElement/test' + 0 0.00000 0.00000 84: + 0 0.00000 0.00000 85: ); + 0 0.00000 0.00000 86: + 0 0.00000 0.00000 87: sub get_map { return \%class_list }; + 0 0.00000 0.00000 88: + 0 0.00000 0.00000 89: sub new { return bless {}, + 0 0.00000 0.00000 90: + 0 0.00000 0.00000 91: sub get_class { + 0 0.00000 0.00000 92: my $name = join('/', @{ $_[1] }); + 0 0.00000 0.00000 93: return ($class_list{ $name }) ? + 0 0.00000 0.00000 94: : warn "no class found for + 0 0.00000 0.00000 95: }; + 0 0.00000 0.00000 96: }; + 0 0.00000 0.00000 97:}; diff --git a/bin/wsdl2perl.pl b/bin/wsdl2perl.pl new file mode 100644 index 0000000..6437cee --- /dev/null +++ b/bin/wsdl2perl.pl @@ -0,0 +1,214 @@ +#!/usr/bin/perl -w +use strict; +use warnings; +use Pod::Usage; +use Getopt::Long; +use LWP::UserAgent; +use SOAP::WSDL::Expat::WSDLParser; +use SOAP::WSDL::Generator::Template::XSD; +use Term::ReadKey; + +my %opt = ( + url => '', + prefix => undef, + type_prefix => 'MyTypes', + element_prefix => 'MyElements', + typemap_prefix => 'MyTypemaps', + interface_prefix => 'MyInterfaces', + base_path => 'lib/', + proxy => undef +); + +{ # a block just to scope "no warnings" + no warnings qw(redefine); + + *LWP::UserAgent::get_basic_credentials = sub { + my ($user, $password); + # remove user from option if called, to force prompting for a user + # name the next time + print "URL requires authorization.\n"; + if (not $user = delete $opt{user}) { + print 'User name:'; + ReadMode 1; + $user = ReadLine(); + ReadMode 0; + }; + if (not $password = delete $opt{password}) { + print 'Password:'; + ReadMode 2; + $user = ReadLine; + ReadMode 0; + }; + return ($user, $password); + }; +} + +GetOptions(\%opt, + qw( + prefix|p=s + type_prefix|t=s + element_prefix|e=s + typemap_prefix|m=s + interface_prefix|i=s + base_path|b=s + typemap_include|mi=s + help|h + proxy|x=s + keep_alive + user=s + password=s + ) +); + +my $url = $ARGV[0]; + +pod2usage( -exit => 1 , verbose => 2 ) if ($opt{help}); +pod2usage( -exit => 1 , verbose => 1 ) if not ($url); + +my $parser = SOAP::WSDL::Expat::WSDLParser->new(); + +local $ENV{HTTP_PROXY} = $opt{proxy} if $opt{proxy}; +local $ENV{HTTPS_PROXY} = $opt{proxy} if $opt{proxy}; + +my $lwp = LWP::UserAgent->new( + $opt{keep_alive} + ? ( keep_alive => 1 ) + : () + ); +$lwp->env_proxy(); # get proxy from environment. Works for both http & https. + +my $response = $lwp->get($url); +die $response->message(), "\n" if $response->code != 200; + +my $xml = $response->content(); + +my $definitions = $parser->parse_string( $xml ); + +my %typemap = (); + +if ($opt{typemap_include}) { + die "$opt{typemap_include} not found " if not -f $opt{typemap_include}; + %typemap = do $opt{typemap_include}; +} + +my $generator = SOAP::WSDL::Generator::Template::XSD->new({ + type_prefix => $opt{ type_prefix }, + typemap_prefix => $opt{ typemap_prefix }, + element_prefix => $opt{ element_prefix }, + interface_prefix => $opt{ interface_prefix }, + OUTPUT_PATH => $opt{ base_path }, + definitions => $definitions, +}); + +# start with typelib, as errors will most likely occur here... +$generator->generate_typelib(); +$generator->generate_interface(); +$generator->generate_typemap({ (%typemap) ? (typemap => \%typemap) : () }); + + +=pod + +=head1 NAME + +wsdl2perl.pl - create perl bindings for SOAP webservices. + +=head1 SYNOPSIS + + wsdl2perl.pl -t TYPE_PREFIX -e ELEMENT_PREFIX -m TYPEMAP_PREFIX \ + -i INTERFACE_PREFIX -b BASE_DIR URL + +=head1 OPTIONS + + NAME SHORT DESCRITPION + ---------------------------------------------------------------------------- + prefix p Prefix for both type and element classes. + type_prefix t Prefix for type classes. + Default: MyTypes + element_prefix e Prefix for element classes. + Default: MyElements + typemap_prefix m Prefix for typemap classes. + Default: MyTypemaps + interface_prefix i Prefix for interface classes. + Default: MyInterfaces + base_path b Path to create classes in. + Default: . + typemap_include mi File to include in typemap. Must eval() to a valid + perl hash (not a has ref !). + proxy x HTTP(S) proxy to use (if any). wsdl2perl will also + use the proxy settings specified via the HTTP_PROXY + and HTTPS_PROXY environment variables. + keep_alive Use http keep_alive. + user Username for HTTP authentication + password Password. wsdl2perl will prompt if not given. + help h Show help content + +=head1 DESCRIPTION + +Generates a interface class for a SOAP web service described by a WSDL +definition. + +The following classes are created: + +=over + +=item * A interface class for every SOAP port in service + +Interface classes are what you will mainly deal with: They provide a method +for accessing every web service method. + +=item * A typemap for every service + +Typemaps are used internally by SOAP::WSDL for parsing the SOAP message into +object trees. + +If the WSDL definition is incomplete, you may need to add some lines to +your typemap. Especially definitions for faults are sometimes left out. + +Additional typemap content may be included by passing a file name as +typemap_include (mi) option. + +=item * A type class for every element, complexType or simpleType definition + +You may need to write additional type classes if your WSDL is incomplete. + +For writing your own lib classes, see L, +L +and L. + +=back + +=head1 TROUBLESHOOTING + +=head2 Accessing HTTPS URLs + +You need Crypt::SSLeay installed for accessing HTTPS URLs. + +=head2 Accessing protected documents + +Use the -u option for specifying the user name. You will be prompted for a +password. + +Alternatively, you may specify a passowrd with --password on the command +line. + +=head2 Accessing documents protected by NTLM authentication + +Set the --keep_alive option. + +Note that accessing documents protected by NTLM authentication is currently +untested, because I have no access to a system using NTLM authentication. +If you try it, I would be glad if you could just drop me a note about +success or failure. + +=head1 LICENSE + +Copyright 2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 AUTHOR + +Martin Kutter Emartin.kutter fen-net.deE + +=cut diff --git a/example/fortune.pl b/example/fortune.pl new file mode 100644 index 0000000..3a52148 --- /dev/null +++ b/example/fortune.pl @@ -0,0 +1,47 @@ +# Accessing the fortune cookie service at +# www.fullerdata.com/FortuneCookie/FortuneCookie.asmx +# +# I have no connection to www.fullerdata.com +# +# Use this script at your own risk. + +# Run before: +# D:\Eigene Dateien\Martin\SOAP-WSDL\trunk>perl -I../lib wsdl2perl.pl "file:///D:/ +# Eigene Dateien/Martin/SOAP-WSDL/trunk/bin/FortuneCookie.xml" + +use lib 'lib/'; +use MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie; +my $cookieService = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie->new(); + +my $cookie; +$cookie = $cookieService->GetFortuneCookie() + or die "$cookie"; + +print $cookie; # ->get_GetFortuneCookieResult()->get_value, "\n"; + +$cookie = $cookieService->GetSpecificCookie({ index => 23 }) + or die "$cookie"; + +print $cookie->get_GetSpecificCookieResult(), "\n"; + +print $cookie; + + +=for demo: + +# the same in SOAP lite (second call) +# + +use SOAP::Lite; + +my $lite = SOAP::Lite->new()->on_action(sub { join '/', @_ } ) + ->proxy('http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx'); + +$lite->call( + SOAP::Data->name('GetSpecificCookie') + ->attr({ 'xmlns', 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' }), + SOAP::Data->name('index')->value(23) + ); + +die $soap->message() if ($soap->fault()); +print $soap->result(); \ No newline at end of file diff --git a/example/lib/MyElements/CountCookies.pm b/example/lib/MyElements/CountCookies.pm new file mode 100644 index 0000000..c57423f --- /dev/null +++ b/example/lib/MyElements/CountCookies.pm @@ -0,0 +1,71 @@ +package MyElements::CountCookies; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('CountCookies'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::CountCookies + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element CountCookies. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/CountCookiesResponse.pm b/example/lib/MyElements/CountCookiesResponse.pm new file mode 100644 index 0000000..93f48d3 --- /dev/null +++ b/example/lib/MyElements/CountCookiesResponse.pm @@ -0,0 +1,85 @@ +package MyElements::CountCookiesResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CountCookiesResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CountCookiesResult + ) ], + { + CountCookiesResult => \%CountCookiesResult_of, + + }, + { + + CountCookiesResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('CountCookiesResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::CountCookiesResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element CountCookiesResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CountCookiesResult + +=head1 Object structure + + CountCookiesResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'CountCookiesResponse'=> { + 'CountCookiesResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetCitiesByCountry.pm b/example/lib/MyElements/GetCitiesByCountry.pm new file mode 100644 index 0000000..a294ade --- /dev/null +++ b/example/lib/MyElements/GetCitiesByCountry.pm @@ -0,0 +1,93 @@ +package MyElements::GetCitiesByCountry; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CountryName_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CountryName + ) ], + { + CountryName => \%CountryName_of, + + }, + { + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetCitiesByCountry'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + + + + + + +=pod + +=head1 NAME + +MyElements::GetCitiesByCountry + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetCitiesByCountry. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CountryName + +=head1 Object structure + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetCitiesByCountry'=> { + 'CountryName' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetCitiesByCountryResponse.pm b/example/lib/MyElements/GetCitiesByCountryResponse.pm new file mode 100644 index 0000000..7f4e87b --- /dev/null +++ b/example/lib/MyElements/GetCitiesByCountryResponse.pm @@ -0,0 +1,93 @@ +package MyElements::GetCitiesByCountryResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetCitiesByCountryResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetCitiesByCountryResult + ) ], + { + GetCitiesByCountryResult => \%GetCitiesByCountryResult_of, + + }, + { + + GetCitiesByCountryResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetCitiesByCountryResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + + + + + + +=pod + +=head1 NAME + +MyElements::GetCitiesByCountryResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetCitiesByCountryResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetCitiesByCountryResult + +=head1 Object structure + + GetCitiesByCountryResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetCitiesByCountryResponse'=> { + 'GetCitiesByCountryResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetFortuneCookie.pm b/example/lib/MyElements/GetFortuneCookie.pm new file mode 100644 index 0000000..a0041e4 --- /dev/null +++ b/example/lib/MyElements/GetFortuneCookie.pm @@ -0,0 +1,71 @@ +package MyElements::GetFortuneCookie; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetFortuneCookie'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetFortuneCookie + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetFortuneCookie. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/GetFortuneCookieResponse.pm b/example/lib/MyElements/GetFortuneCookieResponse.pm new file mode 100644 index 0000000..571951a --- /dev/null +++ b/example/lib/MyElements/GetFortuneCookieResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetFortuneCookieResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetFortuneCookieResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetFortuneCookieResult + ) ], + { + GetFortuneCookieResult => \%GetFortuneCookieResult_of, + + }, + { + + GetFortuneCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetFortuneCookieResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetFortuneCookieResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetFortuneCookieResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetFortuneCookieResult + +=head1 Object structure + + GetFortuneCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetFortuneCookieResponse'=> { + 'GetFortuneCookieResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetSpecificCookie.pm b/example/lib/MyElements/GetSpecificCookie.pm new file mode 100644 index 0000000..766438d --- /dev/null +++ b/example/lib/MyElements/GetSpecificCookie.pm @@ -0,0 +1,85 @@ +package MyElements::GetSpecificCookie; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %index_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + index + ) ], + { + index => \%index_of, + + }, + { + + index => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetSpecificCookie'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetSpecificCookie + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetSpecificCookie. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + index + +=head1 Object structure + + index => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetSpecificCookie'=> { + 'index' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetSpecificCookieResponse.pm b/example/lib/MyElements/GetSpecificCookieResponse.pm new file mode 100644 index 0000000..ab29b06 --- /dev/null +++ b/example/lib/MyElements/GetSpecificCookieResponse.pm @@ -0,0 +1,85 @@ +package MyElements::GetSpecificCookieResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetSpecificCookieResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetSpecificCookieResult + ) ], + { + GetSpecificCookieResult => \%GetSpecificCookieResult_of, + + }, + { + + GetSpecificCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('GetSpecificCookieResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::GetSpecificCookieResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetSpecificCookieResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetSpecificCookieResult + +=head1 Object structure + + GetSpecificCookieResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetSpecificCookieResponse'=> { + 'GetSpecificCookieResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetWeather.pm b/example/lib/MyElements/GetWeather.pm new file mode 100644 index 0000000..0070896 --- /dev/null +++ b/example/lib/MyElements/GetWeather.pm @@ -0,0 +1,105 @@ +package MyElements::GetWeather; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %CityName_of :ATTR(:get); + +my %CountryName_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + CityName + + CountryName + ) ], + { + CityName => \%CityName_of, + CountryName => \%CountryName_of, + + }, + { + + CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetWeather'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + + + + + + +=pod + +=head1 NAME + +MyElements::GetWeather + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetWeather. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + CityName + CountryName + +=head1 Object structure + + CityName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + CountryName => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetWeather'=> { + 'CityName' => $someValue, + 'CountryName' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/GetWeatherResponse.pm b/example/lib/MyElements/GetWeatherResponse.pm new file mode 100644 index 0000000..c259ea1 --- /dev/null +++ b/example/lib/MyElements/GetWeatherResponse.pm @@ -0,0 +1,93 @@ +package MyElements::GetWeatherResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %GetWeatherResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + GetWeatherResult + ) ], + { + GetWeatherResult => \%GetWeatherResult_of, + + }, + { + + GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + + } +); + + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('GetWeatherResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + + + + + + +=pod + +=head1 NAME + +MyElements::GetWeatherResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element GetWeatherResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + GetWeatherResult + +=head1 Object structure + + GetWeatherResult => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'GetWeatherResponse'=> { + 'GetWeatherResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/int.pm b/example/lib/MyElements/int.pm new file mode 100644 index 0000000..51a3f4e --- /dev/null +++ b/example/lib/MyElements/int.pm @@ -0,0 +1,60 @@ +package MyElements::int; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# +# definition +# + +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::Builtin::int +); + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('int'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::int + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element int. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'int' => $someValue, + + +=cut + diff --git a/example/lib/MyElements/readNodeCount.pm b/example/lib/MyElements/readNodeCount.pm new file mode 100644 index 0000000..405975d --- /dev/null +++ b/example/lib/MyElements/readNodeCount.pm @@ -0,0 +1,71 @@ +package MyElements::readNodeCount; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + + +__PACKAGE__->_factory( + [ qw() ], + { + + }, + { + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('readNodeCount'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::readNodeCount + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element readNodeCount. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + + +=cut + diff --git a/example/lib/MyElements/readNodeCountResponse.pm b/example/lib/MyElements/readNodeCountResponse.pm new file mode 100644 index 0000000..f7f769b --- /dev/null +++ b/example/lib/MyElements/readNodeCountResponse.pm @@ -0,0 +1,85 @@ +package MyElements::readNodeCountResponse; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + +# atomic complexType +# definition +use SOAP::WSDL::XSD::Typelib::ComplexType; +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::ComplexType +); + + +my %readNodeCountResult_of :ATTR(:get); + + +__PACKAGE__->_factory( + [ qw( + readNodeCountResult + ) ], + { + readNodeCountResult => \%readNodeCountResult_of, + + }, + { + + readNodeCountResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + + } +); + + + +sub get_xmlns { 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' } + +__PACKAGE__->__set_name('readNodeCountResponse'); +__PACKAGE__->__set_nillable(); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + +=pod + +=head1 NAME MyElements::readNodeCountResponse + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element readNodeCountResponse. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + readNodeCountResult + +=head1 Object structure + + readNodeCountResult => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'readNodeCountResponse'=> { + 'readNodeCountResult' => $someValue, + }, + + +=cut + diff --git a/example/lib/MyElements/string.pm b/example/lib/MyElements/string.pm new file mode 100644 index 0000000..b148ea3 --- /dev/null +++ b/example/lib/MyElements/string.pm @@ -0,0 +1,68 @@ +package MyElements::string; +use strict; +use Class::Std::Storable; +use SOAP::WSDL::XSD::Typelib::Element; + + +# +# definition +# + +use base qw( + SOAP::WSDL::XSD::Typelib::Element + SOAP::WSDL::XSD::Typelib::Builtin::string +); + + +sub get_xmlns { 'http://www.webserviceX.NET' } + +__PACKAGE__->__set_name('string'); +__PACKAGE__->__set_nillable(true); +__PACKAGE__->__set_minOccurs(); +__PACKAGE__->__set_maxOccurs(); +__PACKAGE__->__set_ref(''); + +1; + + +__END__ + + + + + + +=pod + +=head1 NAME + +MyElements::string + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +Type class for the XML element string. + +=head1 PROPERTIES + +The following properties may be accessed using get_PROPERTY / set_PROPERTY +methods: + + +=head1 Object structure + + +Structure as perl hash: + + The object structure is displayed as hash below though this is not correct. + Complex hash elements actually are objects of their corresponding classes + (look for classes of the same name in your typleib). + new() will accept a hash structure like this, but transform it to a object + tree. + + 'string' => $someValue, + + +=cut + diff --git a/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm new file mode 100644 index 0000000..fab733e --- /dev/null +++ b/example/lib/MyInterfaces/FullerData_x0020_Fortune_x0020_Cookie.pm @@ -0,0 +1,327 @@ +package MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie; +use strict; +use warnings; +use MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; +use base 'SOAP::WSDL::Client::Base'; + +sub new { + my $class = shift; + my $arg_ref = shift || {}; + my $self = $class->SUPER::new({ + class_resolver => 'MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie', + proxy => 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx', + %{ $arg_ref } + }); + return bless $self, $class; +} + +__PACKAGE__->__create_methods( + GetSpecificCookie => [ 'MyElements::GetSpecificCookie', ], + CountCookies => [ 'MyElements::CountCookies', ], + readNodeCount => [ 'MyElements::readNodeCount', ], + GetFortuneCookie => [ 'MyElements::GetFortuneCookie', ], + +); + +1; + +__END__ + +=pod + +=head1 NAME + +MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie - SOAP interface to FullerData_x0020_Fortune_x0020_Cookie at +http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx + +=head1 SYNOPSIS + + my $interface = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie->new(); + my $CountCookies = $interface->CountCookies(); + + +=head1 Service FullerData_x0020_Fortune_x0020_Cookie + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieSoap + Binding: tns:FullerData_x0020_Fortune_x0020_CookieSoap + Location: http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx + +=head2 SOAP Operations + +B + + Input, output and fault messages are stated as perl hash refs. + + These are only for informational purposes - the actual implementation + normally uses object trees, not hash refs, though the input messages + may be passed to the respective methods as hash refs and will be + converted to object trees automatically. + + +=head3 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieHttpGet + Binding: tns:FullerData_x0020_Fortune_x0020_CookieHttpGet + Location: + +=head2 SOAP Operations + +B + + Input, output and fault messages are stated as perl hash refs. + + These are only for informational purposes - the actual implementation + normally uses object trees, not hash refs, though the input messages + may be passed to the respective methods as hash refs and will be + converted to object trees automatically. + + +=head3 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + +=head2 Service information: + + Port name: FullerData_x0020_Fortune_x0020_CookieHttpPost + Binding: tns:FullerData_x0020_Fortune_x0020_CookieHttpPost + Location: + +=head2 SOAP Operations + +B + + Input, output and fault messages are stated as perl hash refs. + + These are only for informational purposes - the actual implementation + normally uses object trees, not hash refs, though the input messages + may be passed to the respective methods as hash refs and will be + converted to object trees automatically. + + +=head3 readNodeCount + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetFortuneCookie + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 CountCookies + +B + + { + } + + +B + + { + } + + +B + + + + +=head3 GetSpecificCookie + +B + + { + } + + +B + + { + } + + +B + + + + + +=cut + diff --git a/example/lib/MyInterfaces/GlobalWeather.pm b/example/lib/MyInterfaces/GlobalWeather.pm new file mode 100644 index 0000000..af188a1 --- /dev/null +++ b/example/lib/MyInterfaces/GlobalWeather.pm @@ -0,0 +1,83 @@ +package MyInterfaces::GlobalWeather; + +use strict; +use warnings; +use MyTypemaps::GlobalWeather; +use base 'SOAP::WSDL::Client::Base'; + +sub new { + my $class = shift; + my $arg_ref = shift || {}; + my $self = $class->SUPER::new({ + class_resolver => 'MyTypemaps::GlobalWeather', + proxy => 'http://www.webservicex.net/globalweather.asmx', + %{ $arg_ref } + }); + return bless $self, $class; +} + +__PACKAGE__->__create_methods( + GetWeather => { + parts => [ 'MyElements::GetWeather', ], + soap_action => 'http://www.webserviceX.NET/GetWeather', + style => 'document', + # use => '', # use not implemented yet + }, + GetCitiesByCountry => { + parts => [ 'MyElements::GetCitiesByCountry', ], + soap_action => 'http://www.webserviceX.NET/GetCitiesByCountry', + style => 'document', + # use => '', # use not implemented yet + }, + +); + +1; + +__END__ + + + + + +=pod + +=head1 NAME + +MyInterfaces::GlobalWeather - SOAP interface to GlobalWeather at +http://www.webservicex.net/globalweather.asmx + +=head1 SYNOPSIS + + my $interface = MyInterfaces::GlobalWeather->new(); + my $GetCitiesByCountry = $interface->GetCitiesByCountry(); + + +=head1 METHODS + +=head2 GetWeather + +Get weather report for all major cities around the world. + +SYNOPSIS: + + $service->GetWeather({ + 'CityName' => $someValue, + 'CountryName' => $someValue, + }); + + +=head2 GetCitiesByCountry + +Get all major cities by country name(full / part). + +SYNOPSIS: + + $service->GetCitiesByCountry({ + 'CountryName' => $someValue, + }); + + + +=pod + diff --git a/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm new file mode 100644 index 0000000..4859370 --- /dev/null +++ b/example/lib/MyTypemaps/FullerData_x0020_Fortune_x0020_Cookie.pm @@ -0,0 +1,49 @@ +package MyTypemaps::FullerData_x0020_Fortune_x0020_Cookie; +use strict; +use warnings; + +my %typemap = ( +'readNodeCount' => 'MyElements::readNodeCount', +'readNodeCountResponse' => 'MyElements::readNodeCountResponse', +# atomic complex type (sequence) +'readNodeCountResponse/readNodeCountResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetFortuneCookie' => 'MyElements::GetFortuneCookie', +'GetFortuneCookieResponse' => 'MyElements::GetFortuneCookieResponse', +# atomic complex type (sequence) +'GetFortuneCookieResponse/GetFortuneCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'CountCookies' => 'MyElements::CountCookies', +'CountCookiesResponse' => 'MyElements::CountCookiesResponse', +# atomic complex type (sequence) +'CountCookiesResponse/CountCookiesResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetSpecificCookie' => 'MyElements::GetSpecificCookie', +# atomic complex type (sequence) +'GetSpecificCookie/index' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', + +# end atomic complex type (sequence) +'GetSpecificCookieResponse' => 'MyElements::GetSpecificCookieResponse', +# atomic complex type (sequence) +'GetSpecificCookieResponse/GetSpecificCookieResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) + + + + +); + +sub get_class { + my $name = join '/', @{ $_[1] }; + exists $typemap{ $name } or die "Cannot resolve $name via " . __PACKAGE__; + return $typemap{ $name }; +} + +1; + +__END__ + diff --git a/example/lib/MyTypemaps/GlobalWeather.pm b/example/lib/MyTypemaps/GlobalWeather.pm new file mode 100644 index 0000000..67f07f6 --- /dev/null +++ b/example/lib/MyTypemaps/GlobalWeather.pm @@ -0,0 +1,50 @@ +package MyTypemaps::GlobalWeather; +use strict; +use warnings; + +my %typemap = ( +# SOAP 1.1 fault typemap +'Fault' => 'SOAP::WSDL::SOAP::Typelib::Fault11', +'Fault/faultcode' => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', +'Fault/faultactor' => 'SOAP::WSDL::XSD::Typelib::Builtin::TOKEN', +'Fault/faultstring' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', +'Fault/detail' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# generated typemap +'GetWeather' => 'MyElements::GetWeather', +# atomic complex type (sequence) +'GetWeather/CityName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', +'GetWeather/CountryName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetWeatherResponse' => 'MyElements::GetWeatherResponse', +# atomic complex type (sequence) +'GetWeatherResponse/GetWeatherResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetCitiesByCountry' => 'MyElements::GetCitiesByCountry', +# atomic complex type (sequence) +'GetCitiesByCountry/CountryName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) +'GetCitiesByCountryResponse' => 'MyElements::GetCitiesByCountryResponse', +# atomic complex type (sequence) +'GetCitiesByCountryResponse/GetCitiesByCountryResult' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + +# end atomic complex type (sequence) + + + + +); + +sub get_class { + my $name = join '/', @{ $_[1] }; + exists $typemap{ $name } or die "Cannot resolve $name via " . __PACKAGE__; + return $typemap{ $name }; +} + +1; + +__END__ + diff --git a/example/visitor/visitor.pl b/example/visitor/visitor.pl new file mode 100644 index 0000000..2918c56 --- /dev/null +++ b/example/visitor/visitor.pl @@ -0,0 +1,26 @@ +package PersonVisitor; +use Class::Std; # handles all basic stuff like constructors etc. + +sub visit_Person { + my ( $self, $object ) = @_; + print "Person name is ", $object->get_name(), "\n"; +} + +package Person; +use Class::Std; +my %name : ATTR(:name :default); + +sub accept { $_[1]->visit_Person( $_[0] ) } + +package main; +my @person_from = (); +for (qw(Gamma Helm Johnson Vlissides)) { + push @person_from, Person->new( { name => $_ } ); +} + +my $visitor = PersonVisitor->new(); +for (@person_from) { + $_->accept($visitor); +} + + diff --git a/example/weather.pl b/example/weather.pl new file mode 100644 index 0000000..e340fe9 --- /dev/null +++ b/example/weather.pl @@ -0,0 +1,20 @@ +# Accessing the globalweather service at +# www.webservicex.net/GlobalWeather/GlobalWeather.asmx +# +# Note that the GlobalWeather web service returns a (quoted) XML structure - +# don't be surprised by the response's format. +# +# I have no connection to www.webservicex.net +# Use this script at your own risk. +# +# This script demonstrates the use of a interface generated by wsdl2perl.pl + +use lib 'lib/'; +use MyInterfaces::GlobalWeather; +my $weather = MyInterfaces::GlobalWeather->new({ no_dispatch => 1 }); +my $result = $weather->GetWeather({ CountryName => 'Germany', CityName => 'Munich' }); +print $result; +# boolean comparison overloaded +die $result->get_faultstring()->get_value() if not ($result); + +print $result->get_GetWeatherResult()->get_value() , "\n"; diff --git a/example/weather_wsdl.pl b/example/weather_wsdl.pl new file mode 100644 index 0000000..0053c46 --- /dev/null +++ b/example/weather_wsdl.pl @@ -0,0 +1,43 @@ +# Accessing the globalweather service at +# www.webservicex.net/GlobalWeather/GlobalWeather.asmx +# +# Note that the GlobalWeather web service returns a (quoted) XML structure - +# don't be surprised by the response's format. +# +# I have no connection to www.webservicex.net +# Use this script at your own risk. +# +# This script demonstrates the use of SOAP::WSDL in SOAP::Lite style. + +use lib 'lib/'; +use lib '../lib'; +use File::Basename qw(dirname); +use File::Spec; +my $path = File::Spec->rel2abs( dirname __FILE__); + +# SOAP::WSDL variant +use SOAP::WSDL; +my $soap = SOAP::WSDL->new(); +my $som = $soap->wsdl("file:///$path/wsdl/globalweather.xml") + ->call('GetWeather', GetWeather => + { CountryName => 'Germany', CityName => 'Munich' } +); + +die "Error" if $som->fault(); +print $som->result(); + +# SOAP::Lite variant: +# Note that you have to look both the proxy and the xmlns attribute +# set on the GetWeather SOAP::Data object from the WSDL. + +use SOAP::Lite +trace; +$soap = SOAP::Lite->new()->on_action( sub { join'/', @_ } ) + ->proxy("http://www.webservicex.net/globalweather.asmx"); # from WSDL +$som = $soap->call( + SOAP::Data->name('GetWeather') + ->attr({ xmlns => 'http://www.webserviceX.NET' }), # from WSDL + SOAP::Data->name('CountryName')->value('Germany'), + SOAP::Data->name('CityName')->value('Munich') +); +die "Error" if $som->fault(); +print $som->result(); diff --git a/example/wsdl/FortuneCookie.xml b/example/wsdl/FortuneCookie.xml new file mode 100644 index 0000000..09afdc7 --- /dev/null +++ b/example/wsdl/FortuneCookie.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + Display the number of nodes specified in fortune XML document + + + + + Get a random fortune cookie from the XML document + + + + + Count the actual number of nodes in the XML document of fortunes + + + + + Get a specific cookie by the XML node number + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple XML-based fortune cookie + + + + + + + + + + + \ No newline at end of file diff --git a/example/wsdl/genericbarcode.xml b/example/wsdl/genericbarcode.xml new file mode 100644 index 0000000..6363039 --- /dev/null +++ b/example/wsdl/genericbarcode.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WebserviceX.NET barcode library that provides the means to create barcodes for printing and display in any internet enabled applications. This web service supports Code 128, Industrial 2 of 5, Interleaved 2 of 5, Code 2 5 Matrix, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Codabar, EAN13, EAN8, MSI, Postnet, Supp2, Supp5, UPC A, UPC E0 and UPC E1 barcode formats. This Barcodes returns byte image. It supports following image format JPEG, GIF, PNG, BMP, EMF, EXIF, ICON, MEMORY BMP, TIFF and WMF. + + + + + + + + + + + + + + + + + + + + + + + + + + Barcode generator + + + + + + + + + + + \ No newline at end of file diff --git a/example/wsdl/globalweather.xml b/example/wsdl/globalweather.xml new file mode 100644 index 0000000..b28974d --- /dev/null +++ b/example/wsdl/globalweather.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + Get weather report for all major cities around the world. + + + + + Get all major cities by country name(full / part). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/SOAP/WSDL.pm b/lib/SOAP/WSDL.pm index 6eabd51..c52d194 100644 --- a/lib/SOAP/WSDL.pm +++ b/lib/SOAP/WSDL.pm @@ -1,1000 +1,316 @@ -#!/usr/bin/perl -w package SOAP::WSDL; - -use SOAP::Lite; -use vars qw($VERSION @ISA); -use XML::XPath; -use Data::Dumper; - use strict; use warnings; +use vars qw($AUTOLOAD); +use Carp; +use Scalar::Util qw(blessed); +use SOAP::WSDL::Client; +use SOAP::WSDL::Expat::WSDLParser; +use Class::Std; +use SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType; +use LWP::UserAgent; -@ISA = qw(SOAP::Lite); +our $VERSION='2.00_17'; -$VERSION = "1.25"; +my %no_dispatch_of :ATTR(:name); +my %wsdl_of :ATTR(:name); +my %proxy_of :ATTR(:name); +my %autotype_of :ATTR(:name); +my %outputxml_of :ATTR(:name :default<0>); +my %outputtree_of :ATTR(:name); +my %outputhash_of :ATTR(:name); +my %servicename_of :ATTR(:name); +my %portname_of :ATTR(:name); +my %class_resolver_of :ATTR(:name); -# SOAP::Lite has changed the name for speciying a schema in 0.6? -# method before: schema -# method name after: schema_url -# -# Actually, we don't care which SOAP::Lite version there is, so we -# try to support whatever we find... -# -my $SCHEMA_URL = $SOAP::Lite::VERSION >= 0.6 ? 'schema_url' : 'schema'; +my %method_info_of :ATTR(:default<()>); +my %port_of :ATTR(:default<()>); +my %porttype_of :ATTR(:default<()>); +my %binding_of :ATTR(:default<()>); +my %service_of :ATTR(:default<()>); +my %definitions_of :ATTR(:get :default<()>); +my %serialize_options_of :ATTR(:default<()>); -sub wsdlinit -{ - my $self = shift; - my %opt = @_; - $self->{ _WSDL }->{ cache } = {}; - $self->{ _WSDL }->{ caching } = $opt{ caching }; - $self->{ _WSDL }->{ cache_directory } = $opt{ cache_directory } - if exists( $opt{ cache_directory } ); - $self->{ _WSDL }->{ checkoccurs } = 1 - unless defined( $self->{ _WSDL }->{ checkoccurs } ); +my %client_of :ATTR(:name :default<()>); +my %keep_alive_of :ATTR(:name :default<0> ); - if ( ( $self->{ _WSDL }->{ caching } ) - && ( !$self->{ _WSDL }->{ fileCache } ) ) - { - $self->wsdl_cache_init(); - } +my %LOOKUP = ( + no_dispatch => \%no_dispatch_of, + class_resolver => \%class_resolver_of, + wsdl => \%wsdl_of, + proxy => \%proxy_of, + autotype => \%autotype_of, + outputxml => \%outputxml_of, + outputtree => \%outputtree_of, + outputhash => \%outputhash_of, + portname => \%portname_of, + servicename => \%servicename_of, + keep_alive => \%keep_alive_of, +); - #makeup xpath document - my $xpath; +sub readable { warn <{ _WSDL }->{ fileCache } ) - { +sub set_readable; *set_readable = \&readable; - # get xpath from cache - $xpath = $self->{ _WSDL }->{ fileCache }->get( $self->wsdl ); +for my $method (keys %LOOKUP ) { + no strict qw(refs); + *{ $method } = sub { + my $self = shift; + my $ident = ident $self; + if (@_) { + $LOOKUP{ $method }->{ $ident } = shift; + return $self; + } + return $LOOKUP{ $method }->{ $ident }; + }; +} - # get in-memory cache from cache - if ( $self->{ _WSDL }->{ caching } ) - { - my $cache = - $self->{ _WSDL }->{ fileCache }->get( $self->wsdl . "_cache" ); - $self->{ _WSDL }->{ cache } = $cache || {}; - } ## end if ( $self->{ _WSDL }->... - } ## end if ( $self->{ _WSDL }->... - unless ( $xpath ) - { - no strict qw(refs); - $xpath = XML::XPath->new( - xml => $self->schema->$SCHEMA_URL( $self->wsdl() )->access ); - } ## end unless ( $xpath ) +{ # just a BLOCK for scoping warnings. - ( $xpath ) - || die "Error processing WSDL: Cannot create XPath object"; + # we need to roll our own for supporting + # SOAP::WSDL->new( key => value ) syntax, + # like SOAP::Lite does. Class::Std enforces a single hash ref as + # parameters to new() + no warnings qw(redefine); + sub new { + my $class = shift; + my %args_from = @_; + my $self = \do { my $foo = undef }; + bless $self, $class; + + for (keys %args_from) { + my $method = $self->can("set_$_") + or croak "unknown parameter $_ passed to new"; + $method->($self, $args_from{$_}); + } + my $ident = ident $self; + $self->wsdlinit() if ($wsdl_of{ $ident }); + + $client_of{ $ident } = SOAP::WSDL::Client->new(); + + return $self; + } +} - $self->_wsdl_xpath( $xpath ); +sub wsdlinit { + my $self = shift; + my $ident = ident $self; + my %opt = @_; - # Get root element () and get - # default prefix (the root element's one). - my $definitions = undef; - $definitions = $xpath->find( '/*[1]' )->shift; + my $lwp = LWP::UserAgent->new( + $keep_alive_of{ $ident } + ? (keep_alive => 1) + : () + ); + my $response = $lwp->get( $wsdl_of{ $ident } ); + croak $response->message() if ($response->code != 200); - my $prefix = $definitions->getPrefix; - $self->_wsdl_wsdlns( $prefix ? $prefix . ':' : '' ); + my $parser = SOAP::WSDL::Expat::WSDLParser->new(); + $parser->parse_string( $response->content() ); - # get the targetNamespace - my $tns = $definitions->getAttribute( 'targetNamespace' ) - || die - "Error processing WSDL: cannot get "; + my $wsdl_definitions = $parser->get_data(); - # look for schema namespace & prefix for targetNamespace - my ( $defaultNS, $schemaNS ) = ( '', '' ); - my @_ns_sub_list = (); + # sanity checks + 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"; - my $nameSpaces = $definitions->getNamespaces - || die "Error processing WSDL: cannot get namespaces"; - my $nsHash = {}; - foreach my $ns ( @{ $nameSpaces } ) - { - $xpath->set_namespace( $ns->getPrefix, $ns->getData ); - if ( $ns->getData eq $tns ) - { - push @_ns_sub_list, $ns->getPrefix; - next; - } - - #------------------------------------------------------- - # Here we look for the default wsdl namespace which is used *only* - # when we are looking for the arrays restrictions. - # Originally the prefix was used for this, but sometimes the prefix - # can be omitted - #------------------------------------------------------- - $ns->getPrefix eq "#default" and next; - if ( $ns->getData eq "http://schemas.xmlsoap.org/wsdl/" ) - { - $self->_wsdl_wsdlExplicitNS( - $ns->getPrefix ? $ns->getPrefix . ":" : "" ); - } - - # the schema namespace is hardcoded in to the SOAP::Constants package, - # in the Lite.pm module - if ( defined $SOAP::Constants::XML_SCHEMAS{ $ns->getData } - and $SOAP::Constants::XML_SCHEMAS{ $ns->getData } =~ - /SOAP::XMLSchema\d+/ ) - { - $schemaNS = $ns->getPrefix; - } ## end if ( defined $SOAP::Constants::XML_SCHEMAS... - $nsHash->{ $ns->getData } = $ns->getPrefix . ':'; - } ## end foreach my $ns ( @{ $nameSpaces... - - $self->_wsdl_ns( $nsHash ); - $defaultNS = join( '|', @_ns_sub_list ); - - $self->_wsdl_tns( $defaultNS ); - $self->_wsdl_tns_uri( $tns ); - $self->_wsdl_schemans( $schemaNS ); - - #--- - #-- TBD: remove all the hardcoded urls - $self->_wsdl_soapns( - $self->_wsdl_ns->{ 'http://schemas.xmlsoap.org/wsdl/soap/' } ); - - #the default namespaces for types - $self->{ _WSDL }->{ _type_ns } = ""; - $self->_wsdl_schemans - and $self->{ _WSDL }->{ _type_ns } .= $self->_wsdl_schemans . ":|"; - - #TBD: the apache soap special case has to be handled elsewhere - $nsHash->{ 'http://xml.apache.org/xml-soap' } - and $self->{ _WSDL }->{ _type_ns } .= - $nsHash->{ 'http://xml.apache.org/xml-soap' } . "|"; - chop $self->{ _WSDL }->{ _type_ns }; - - $self->servicename( $opt{ servicename } ) if ( $opt{ servicename } ); - $self->portname( $opt{ portname } ) if ( $opt{ portname } ); - - # return something useful to ease testing... - return $self; + # setup lookup variables + $definitions_of{ $ident } = $wsdl_definitions; + $serialize_options_of{ $ident } = { + autotype => 0, + typelib => $types, + namespace => $ns, + }; + $servicename_of{ $ident } = $opt{servicename} if $opt{servicename}; + $portname_of{ $ident } = $opt{portname} if $opt{portname}; + return $self; } ## end sub wsdlinit -sub _wsdl_init_port -{ +sub _wsdl_get_service :PRIVATE { + my $ident = ident shift; + my $wsdl = $definitions_of{ $ident }; + return $service_of{ $ident } = $servicename_of{ $ident } + ? $wsdl->find_service( $wsdl->get_targetNamespace() , $servicename_of{ $ident } ) + : $service_of{ $ident } = $wsdl->get_service()->[ 0 ]; +} ## end sub _wsdl_get_service + +sub _wsdl_get_port :PRIVATE { + my $ident = ident shift; + my $wsdl = $definitions_of{ $ident }; + my $ns = $wsdl->get_targetNamespace(); + return $port_of{ $ident } = $portname_of{ $ident } + ? $service_of{ $ident }->get_port( $ns, $portname_of{ $ident } ) + : $port_of{ $ident } = $service_of{ $ident }->get_port()->[ 0 ]; +} + +sub _wsdl_get_binding :PRIVATE { my $self = shift; - my $name = shift; - my $opt = shift; - my $xpath = $self->_wsdl_xpath; - my $tns = $self->_wsdl_tns; + my $ident = ident $self; + my $wsdl = $definitions_of{ $ident }; + my $port = $port_of{ $ident } || $self->_wsdl_get_port(); + $binding_of{ $ident } = $wsdl->find_binding( $port->expand( $port->get_binding() ) ) + or die "no binding found for ", $port->get_binding(); + return $binding_of{ $ident }; +} - # Step one: get element - # - # This provides us with the address (enpoint/proxy), which we set here - # and the binding name. +sub _wsdl_get_portType :PRIVATE { + my $self = shift; + my $ident = ident $self; + my $wsdl = $definitions_of{ $ident }; + my $binding = $binding_of{ $ident } || $self->_wsdl_get_binding(); + $porttype_of{ $ident } = $wsdl->find_portType( $binding->expand( $binding->get_type() ) ) + or die "cannot find portType for " . $binding->get_type(); + return $porttype_of{ $ident }; +} - # Fetch _wsdl_wsdlns() - . 'definitions/' - . $self->_wsdl_wsdlns() .'service[@name="' . $self->servicename() - . '"]/' - . $self->_wsdl_wsdlns() . 'port[@name="' . $name . '"]/' - . $self->_wsdl_soapns() . 'address'; +sub _wsdl_init_methods :PRIVATE { + my $self = shift; + my $ident = ident $self; + my $wsdl = $definitions_of{ $ident }; + my $ns = $wsdl->get_targetNamespace(); - my $address = $xpath->find( $path )->shift - || die "Error processing WSDL file - no such port ($path)"; - my $endpoint = $address->getAttribute( 'location' ) - or die "No endpoint address found ($path)"; + # get bindings, portType, message, part(s) - use private methods for clear separation... + $self->_wsdl_get_service if not ($service_of{ $ident }); + my $binding = $binding_of{ $ident } || $self->_wsdl_get_binding() + || die "Can't find binding"; + my $portType = $porttype_of{ $ident } || $self->_wsdl_get_portType(); - $self->proxy( $endpoint ); + $method_info_of{ $ident } = {}; - my $port = $address->getParentNode(); - my $binding_name = $port->getAttribute( 'binding' ); + foreach my $binding_operation (@{ $binding->get_operation() }) + { + my $method = {}; - # Step two: get the correct element. - # This provides us with the portType name. - # Remember binding for later usage (in call() ) and - # + # 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; - # remove the default targetNamespace from messageName - $binding_name =~ s/^($tns)\:*//; + # get parts + # 1. get operation from port + my $operation = $portType->find_operation( $ns, + $binding_operation->get_name() ); - $path = join( - $self->_wsdl_wsdlns, - ( - '/', - 'definitions/', - 'binding[@name="' . $binding_name . '"]', - ) - ); + # 2. get input message name + my ( $prefix, $localname ) = split /:/, + $operation->first_input()->get_message(); - my $binding = $xpath->find( $path )->shift() - or die "no binding found ($path)"; + # 3. get input message + my $message = $wsdl->find_message( $ns, $localname ) + or die "Message {$ns}$localname not found in WSDL definition"; - $self->{ _WSDL }->{ binding } = $binding; + if (my $body=$binding_operation->first_input()->first_body()) { + if ($body->get_parts()) { + $method->{ parts } = []; # make sure it's empty + my $message_part_ref = $message->get_part(); + for my $name (split m{\s} , $body->get_parts() ) { + $name =~s{ \A [^:]+: }{}x; # throw away ns prefix + # could probably made more efficient, but our lists are + # usually quite short + push @{ $method->{ parts } }, + grep { $_->get_name() eq $name } @{ $message_part_ref }; + } + } + } + $method->{ parts } ||= $message->get_part(); + - my $portType_name = $binding->getAttribute( 'type' ); + # rpc / encoded methods may have a namespace specified. + # look it up and set it... + $method->{ namespace } = $binding_operation + ? do { + my $input = $binding_operation->first_input(); + $input ? $input->first_body()->get_namespace() : undef; + } + : undef; - # remove the default targetNamespace from messageName - $portType_name =~ s/^($tns)\:*//; - - $path = join( - $self->_wsdl_wsdlns, - ( - '/', - 'definitions/', - 'portType[@name="' . $portType_name . '"]', - ) - ); - - # warn("looking for $path"); - my $portType = $xpath->find( $path )->shift() - or die "No portType found ($path)"; - $self->{ _WSDL }->{ portType } = $portType; + $method_info_of{ $ident }->{ $binding_operation->get_name() } = $method; + } + return $method_info_of{ $ident }; } -sub call -{ - my $self = shift; - my $method = shift; - my %data = @_; +sub call { + my ($self, $method, @data_from) = @_; + my $ident = ident $self; - my $path; - my $location; - my $mode = 'input'; + my ($data, $header) = ref $data_from[0] + ? ($data_from[0], $data_from[1] ) + : (@data_from>1) + ? ( { @data_from }, undef ) + : ( $data_from[0], undef ); - my $tns = $self->_wsdl_tns; - my $ns = $self->_wsdl_ns; + $self->wsdlinit() if not ($definitions_of{ $ident }); + $self->_wsdl_init_methods() if not ($method_info_of{ $ident }); - my $xpath = $self->_wsdl_xpath; + my $client = $client_of{ $ident }; + + # pass-through keep_alive if we need it... + $client->set_proxy( $proxy_of{ $ident } + || $port_of{ $ident }->first_address()->get_location(), + $keep_alive_of{ $ident } ? (keep_alive => 1) : (), + ); + + $client->set_no_dispatch( $no_dispatch_of{ $ident } ); + $client->set_outputxml( $outputxml_of{ $ident } ? 1 : 0 ); - ( $xpath ) || do - { - $self->wsdlinit; - $xpath = $self->_wsdl_xpath - || die "Error processing WSDL: no wsdl object"; - }; - - # get the first port if none has been set... - $self->_get_first_port() if (not $self->portname() ); - - # initialize port if not done yet - $self->_wsdl_init_port( $self->portname() ) - if ( not $self->_wsdl_portType() ); - - my $portType = $self->_wsdl_portType(); - my $binding = $self->_wsdl_binding(); - - $path = join( - $self->_wsdl_wsdlns, - ( - # '/', - 'operation[@name="' . $method . '"]/', - $mode - ) - ); - - #overload: the user has provided a the input name for us - $data{ "wsdl_${mode}_name" } - and $path .= "[\@name='" . $data{ "wsdl_${mode}_name" } . "']"; - - # warn "Looking for operation $path"; - my $inputMessageName; - my $binding_operation_message = $binding->find( $path )->shift(); - if ($binding_operation_message) - { - my $binding_operation = $binding_operation_message->getParentNode(); - my $soapAction = $binding_operation->getAttribute( 'soapAction' ); - $self->on_action( sub { return "$soapAction" } ) if ($soapAction); - # warn "soapAction set to $soapAction\n"; - - #if defined, the input message name has to be the leading item - #in the SOAP call. If not defined, it has to be the operation - #name. In the case of overloaded calls, it *IS* the parameter passed - #by the calling script. So - - if ( $data{ "wsdl_${mode}_name" } ) - { - $inputMessageName = $data{ "wsdl_${mode}_name" }; - } - else - { - $inputMessageName = $binding_operation_message->getAttribute('name'); - } - - } - # just set it right if not set before: - $inputMessageName ||= $method; - - $path = join( - $self->_wsdl_wsdlns, - ( - '/', - 'definitions/', - 'binding[@name="' . $binding->getAttribute('name') . '"]/', - 'operation[@name="' . $method . '"]/', - "$mode/" - ) - ) - . $self->_wsdl_soapns . "body"; - - # warn "looking for $path..."; - my $callNamespace; - my $encodingStyle = q{}; - if (my $operation = $self->_wsdl_find( $path )->shift) - { - # warn "found operation:" . Dumper $operation; - #a call can have an associated, namespace - $callNamespace = $operation->getAttribute('namespace'); - #the encoding style is required when handling restricted complextypes - $encodingStyle = $operation->getAttribute( 'encodingStyle' ); - } - $callNamespace ||= $self->_wsdl_tns_uri; - - $self->wsdl_encoding( $self->_wsdl_ns->{ $encodingStyle } ) - if ($encodingStyle); - - $path = join( - $self->_wsdl_wsdlns, - ( - '/', 'definitions/', - 'portType[@name="' . $portType->getAttribute('name') . '"]/', - 'operation[@name="' . $method . '"]/', - $mode - ) - ); - - # overload: the calling script has to say wich overloading - # procedure call has to be encoded and forwarded to the server - - $data{ "wsdl_${mode}_name" } - and $path .= "[\@name='" . $data{ "wsdl_${mode}_name" } . "']"; - - $path .= "/\@message"; - my $messageName = $self->_wsdl_findvalue( $path, "dieIfError" ); - - $messageName =~ s/^($tns)\:*//; - - $path = join( - $self->_wsdl_wsdlns, - ( '/', 'definitions/', 'message[@name="' . $messageName . '"]/' - , 'part' ) - ); - - # warn "looking for $path..."; - - # An operation without parts is equivalent to a procedure - # call without parameters - # Though not very common, messages may have more than one part... - my $parts = $self->_wsdl_find( $path ); - - my @param = (); - while ( my $part = $parts->shift ) - { - my @enc = $self->encode( $part, \%data ); - push @param, @enc if ( @enc ); - } - - my $methodEncoded = - SOAP::Data->name( $inputMessageName ) - ->attr( { "xmlns" => $callNamespace } ); - unless ( $self->{ _WSDL }->{ no_dispatch } ) - { - return $self->SUPER::call( - $methodEncoded => @param, - @{ $data{ soap_headers } } - ); - } ## end unless ( $self->{ _WSDL }->... - else - { - return $methodEncoded, @param; - } -} ## end sub call - -# find the first servie and port for convenience - -sub _get_first_port -{ - my $self = shift; - my $url = shift; - my $xpath = $self->_wsdl_xpath(); - - # find /wsdl:definitions/wsdl:service/wsdl:port/soap:address - # use namespace prefixes from WSDL - they may differ... - # - # We head right for the address instead of just fetching the first - # port - we want to set the SOAP::Lite proxy, and accessing - # our parent is easier than running repeated XPath queries... - # - my $path = '/' . $self->_wsdl_wsdlns() . - 'definitions/' - . $self->_wsdl_wsdlns() .'service/' - . $self->_wsdl_wsdlns() . 'port/' - . $self->_wsdl_soapns() . 'address'; - - my @ports = $xpath->findnodes( $path ); - - return if ( not @ports ); - - my $address = shift @ports; - my $port = $address->getParentNode(); - my $service = $port->getParentNode(); - $self->servicename( $service->getAttribute( 'name' ) ); - $self->portname( $port->getAttribute( 'name' ) ); - - return $self; -} ## end sub _get_first_port - -sub DESTROY -{ - my $self = shift; - $self->wsdl_cache_store(); - return 1; -} - -#a sort of autoload for the store-and-return methods -sub _load_method -{ - my $method = shift; - my $param = shift; - no strict "refs"; - *$method = sub { - my $self = shift; - return ( @_ ) ? $self->{ _WSDL }->{ $param } = shift - : $self->{ _WSDL }->{ $param } ? $self->{ _WSDL }->{ $param } - : ""; - }; -} ## end sub _load_method - -sub portname { - my $self = shift; - if ( @_ ) - { - my $portname = shift; - if ( not defined($self->{ _WSDL }->{ portname }) - or ($portname ne ($self->{ _WSDL }->{ portname }) ) ) - { - $self->{ _WSDL }->{ portname } = $portname; - $self->_wsdl_init_port( $portname ); - } - } - if ($self->{ _WSDL }->{ 'portname' }) - { - return $self->{ _WSDL }->{ 'portname' } + # only load ::Deserializer::SOM if we really need to deserialize to SOM. + # maybe we should introduce something like $output{ $ident } with a fixed + # set of values - m{^(TREE|HASH|XML|SOM)$}xms ? + if ( ( ! $outputtree_of{ $ident } ) + && ( ! $outputhash_of{ $ident } ) + && ( ! $outputxml_of{ $ident } ) + && ( ! $no_dispatch_of{ $ident } ) ) { + require SOAP::WSDL::Deserializer::SOM; + $client->set_deserializer( SOAP::WSDL::Deserializer::SOM->new() ); }; - return; -} -&_load_method( "no_dispatch", "no_dispatch" ); -&_load_method( "wsdl", "wsdl" ); -&_load_method( "wsdl_checkoccurs", "checkoccurs" ); -&_load_method( "servicename", "servicename" ); -#&_load_method( "portname", "portname" ); -&_load_method( "wsdl_cache_directory", "cache_directory" ); -&_load_method( "wsdl_encoding", "wsdl_encoding" ); -&_load_method( "_wsdl_ns", "namespaces" ); -&_load_method( "_wsdl_xpath", "xpath" ); -&_load_method( "_wsdl_tns", "tns" ); -&_load_method( "_wsdl_tns_uri", "tns_uri" ); -&_load_method( "_wsdl_wsdlns", "wsdlns" ); -&_load_method( "_wsdl_schemans", "schemans" ); -&_load_method( "_wsdl_soapns", "soapns" ); -&_load_method( "_wsdl_wsdlExplicitNS", "wsdl_wsdlExplicitNS" ); -&_load_method( "_wsdl_binding", "binding" ); -&_load_method( "_wsdl_portType", "portType" ); + my $method_info = $method_info_of{ $ident }->{ $method }; -#each call to make finder returns a wrapped version of the xpath calls. -#find, findvalue, findnodes and so on -#the cache checking part is hidden here -sub _make_finder() -{ - my ( $method, $call ) = @_; - no strict "refs"; - *$method = sub { - my $self = shift; - my ( $path, $dieIfError ) = @_; - my $data = ""; + # TODO serialize both header and body, not only header + my (@response) = (blessed $data) + ? $client->call( { + operation => $method, + soap_action => $method_info->{ soap_action }, + }, $data ) + : do { + my $content = ''; + # TODO support RPC-encoding: Top-Level element + namespace... + foreach my $part ( @{ $method_info->{ parts } } ) { + $content .= $part->serialize( $method, $data, + { + %{ $serialize_options_of{ $ident } }, + } ); + } + $client->call( + { + operation => $method, + soap_action => $method_info->{ soap_action } + }, + # absolutely stupid, but we need a reference which + # serializes to XML on stringification... + SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ + value => $content + }), + SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ + value => $header + }) + ); + }; - $data = $self->{ _WSDL }->{ cache }->{ $path }; - unless ( $data ) - { - $data = $self->_wsdl_xpath->$call( $path ); - $self->{ _WSDL }->{ cache }->{ $path } = $data - if ( $self->{ _WSDL }->{ caching } ); - } ## end unless ( $data ) - if ( !$data ) - { - $dieIfError - and - print( "Error processing WSDL: can't find the path '$path'\n" ), - exit; - } ## end if ( !$data ) - return $data; - }; -} ## end sub _make_finder() - -&_make_finder( "_wsdl_find", "find" ); -&_make_finder( "_wsdl_findvalue", "findvalue" ); -&_make_finder( "_wsdl_findnodes", "findnodes" ); - -sub wsdl_cache_store -{ - my $self = shift; - if ( ( $self->{ _WSDL }->{ cache_directory } ) - && ( $self->{ _WSDL }->{ fileCache } ) ) - { - $self->{ _WSDL }->{ fileCache } - ->set( $self->wsdl, $self->{ _WSDL }->{ xpath } ); - $self->{ _WSDL }->{ fileCache } - ->set( $self->wsdl . "_cache", $self->{ _WSDL }->{ cache } ); - } ## end if ( ( $self->{ _WSDL ... -} ## end sub wsdl_cache_store - -sub wsdl_cache_init -{ - my $self = shift; - my $p = shift || {}; # get custom params - or none... - my $cache = undef; - eval { require Cache::FileCache; }; - if ( $@ ) - { - # warn about missing Cache::FileCache and set cache hadnle to undef - warn "File caching is enabled, but you do not have the " - . "Cache::FileCache module. Disabling Filesystem caching." - if ( $self->{ _WSDL }->{ cache_directory } ); - $self->{ _WSDL }->{ fileCache } = undef; - } ## end if ( $@ ) - else - { - # initialize cache from custom parameters if given - $p->{ cache_root } ||= $self->{ _WSDL }->{ cache_directory }; - $cache = Cache::FileCache->new( $p ); - } ## end else [ if ( $@ ) - $self->{ _WSDL }->{ fileCache } = $cache; -} ## end sub wsdl_cache_init - -sub encode -{ - - my $self = shift; - my $part = shift; - my $data = shift; - - my $schemaNS = $self->_wsdl_schemans ? $self->_wsdl_schemans . ':' : ''; - my $defaultNS = $self->{ _WSDL }->{ tns }; - - my %nsHash = reverse %{ $self->_wsdl_ns }; - my %nsURIs = %{ $self->_wsdl_ns }; - - #TBD: Caching hook ? - my $p = { - name => $part->findvalue( '@name' )->value, - type => $part->findvalue( '@type' )->value, - element => $part->findvalue( '@element' )->value, - xmlns => $part->findvalue( '@targetNamespace' )->value, - nillable => $part->findvalue( '@nillable' )->value, - }; - - my $result = undef; - my $order = undef; - my $typeName = undef; - my $typeNS = ""; - my $type = ""; - - my $default = $part->findvalue( '@default' )->value; - if ( $default eq "0" or $default ) - { - $p->{ default } = $default; - } - - if ( ( $p->{ type } ) ) - { - if ( $p->{ type } =~ m!($defaultNS):(.*)! ) - { - $typeName = $2; - - #looking for type restrictions - my $path = join( $self->_wsdl_wsdlns, - '/', 'definitions/', "types/${schemaNS}schema/" ) - . "${schemaNS}simpleType[\@name='$typeName']/" - . "${schemaNS}restriction" . "|" - . join( $self->_wsdl_wsdlns, - '/', 'definitions/', "types/${schemaNS}schema/" ) - . "${schemaNS}complexType[\@name='$typeName']/${schemaNS}complexContent/" - . "${schemaNS}restriction"; - - #usually there is only one restriction - #my $simpleType = $self->{_WSDL}->{xpath}->find($path)->shift; - my $simpleType = $self->_wsdl_find( $path, "" )->shift; - $simpleType - and my $baseType = $simpleType->findvalue( '@base' )->value; - - #TBD: verify if the data matches the restrictions - #-- - #now we have (hopely) the base type - my $wsdl_encoding = $self->wsdl_encoding(); - - if ( defined( $baseType ) - and $baseType eq $wsdl_encoding . "Array" ) - { - - #the type is an array restricted of something - #-- - $type = $baseType; - $type =~ s/^$schemaNS/xsd:/; - - #-- - - #if the basetype is Array then we ask: Array of what? - #only complexTypes can be restricted to an Array - my $path = join( $self->_wsdl_wsdlns, - '/', 'definitions/', "types/${schemaNS}schema/" ) - . "${schemaNS}complexType[\@name='$typeName']/${schemaNS}complexContent/" - . "${schemaNS}restriction/" - . "${schemaNS}attribute"; - - my $simpleType = - $self->{ _WSDL }->{ xpath }->find( $path )->shift; - $simpleType - and $baseType = - $simpleType->findvalue( - '@' . ( $self->_wsdl_wsdlExplicitNS ) . 'arrayType' ) - ->value; - - #and now we have (eventually) the base type - $baseType =~ s/..$//; - } ## end if ( defined( $baseType... - $baseType and $p->{ type } = $baseType; - } ## end if ( $p->{ type } =~ m!($defaultNS):(.*)!... - - #Now, we have p, and p has a type - #and the type of p is (eventually) extracted from some restriction - - #In order to get the correct type, now we have to handle the imported - #namespaces. Some wsdl files have multiple schema declaration. - #And each declaration can have her own imported namespaces. - #Plainly: for each type check we have to check the schemas chain - #in order to get the imported namespaces for *that* schema - - #- _type_ns contains the typical default namespaces - $typeNS = $self->{ _WSDL }->{ _type_ns }; - - $p->{ type } =~ /(.*:)(.*)/; - if ( $1 ne $schemaNS ) - { - - #the type of p don't belongs to some default schema type - #first we look after the schema who owns our type - my $path = join( $self->_wsdl_wsdlns, - '/', 'definitions/', "types/${schemaNS}schema/" ) - . "*[\@name='$2']"; - - my $schema = $self->_wsdl_find( "$path/..", "" )->shift; - my $nodeSet = - $self->_wsdl_find( - "$path/preceding-sibling::${schemaNS}import" ); - while ( my $node = $nodeSet->shift ) - { - no warnings; - $typeNS .= "|" - . $self->_wsdl_ns->{ $node->getAttribute( 'namespace' ) }; - } ## end while ( my $node = $nodeSet... - -#if the schema has a default nameSpace, it has to be added to the added to dhe typeNs list - - my $schemaTargetNS = $schema->findvalue( '@targetNamespace' ); - if ( $schemaTargetNS ) - { - defined $self->_wsdl_ns->{ $schemaTargetNS } - and $typeNS .= "|" . $self->_wsdl_ns->{ $schemaTargetNS }; - } - } ## end if ( $1 ne $schemaNS ) - - if ( $p->{ type } =~ m/^$typeNS/ ) - { #it's a simple type - - #symple types can have default values - if ( !exists $data->{ $p->{ name } } - or !defined $data->{ $p->{ name } } ) - { - if ( defined $p->{ default } ) - { - $data->{ $p->{ name } } = $p->{ default }; - } - } ## end if ( !exists $data->{ ... - - #-- this stuff is supposed to check the occurrences - my $count = -1; - if ( $self->{ _WSDL }->{ checkoccurs } ) - { - $count = - exists $data->{ $p->{ name } } - ? defined $data->{ $p->{ name } } - ? ref $data->{ $p->{ name } } eq 'ARRAY' - ? scalar @{ $data->{ $p->{ name } } } - : 1 - : 0 - : 0; - - $order = $part->getParentNode()->getName; - $p->{ minOccurs } = $part->findvalue( '@minOccurs' )->value; - if ( ( !defined( $p->{ minOccurs } ) ) - || ( $p->{ minOccurs } eq "" ) ) - { - if ( $order eq 'sequence' ) - { - $p->{ minOccurs } = 1; - } - elsif ( $order eq 'all' ) - { - $p->{ minOccurs } = 0; - } - else - { - $p->{ minOccurs } = 0; - } - } ## end if ( ( !defined( $p->{... - - $p->{ maxOccurs } = $part->findvalue( '@maxOccurs' )->value; - if ( ( !defined( $p->{ maxOccurs } ) ) - || ( $p->{ maxOccurs } eq "" ) ) - { - if ( $order eq 'sequence' ) { $p->{ maxOccurs } = 1 } - elsif ( $order eq 'all' ) { $p->{ maxOccurs } = 1 } - else { $p->{ maxOccurs } = undef } - } ## end if ( ( !defined( $p->{... - $p->{ maxOccurs } = undef - if ( defined( $p->{ maxOccurs } ) - && $p->{ maxOccurs } eq 'unbounded' ); - } ## end if ( $self->{ _WSDL }->... - - # check for ocurrence ? - # acceptable number of value ? - if ( - ( !$self->{ _WSDL }->{ checkoccurs } ) - || ( ( $p->{ minOccurs } <= $count ) - || ( $p->{ nillable } eq "true" ) ) - && ( ( !defined( $p->{ maxOccurs } ) ) - || ( $count <= $p->{ maxOccurs } ) ) - ) - { - - # not nillable - # empty value - ( !$p->{ nillable } ) - && ( ( !( exists $data->{ $p->{ name } } ) ) - || ( !( defined $data->{ $p->{ name } } ) ) ) - && do - { - return (); - }; - - # some value - - # SOAP::Lite uses the "xsd" prefix for specifying schema NS - my $type = $p->{ type }; - $type =~ s/^$schemaNS/xsd:/; - $result = SOAP::Data->new( name => $p->{ name } ); - $result->type( $type ) if ( $self->autotype ); - $result->attr( { xmlns => $p->{ xmlns } } ) if $p->{ xmlns }; - return ( $result->value( $data->{ $p->{ name } } ) ); - } ## end if ( ( !$self->{ _WSDL... - else - { - no warnings; - die "illegal number of elements ($count, min: " - . $p->{ minOccurs } - . ", max: ." - . $p->{ maxOccurs } - . ") for element '$p->{ name }' (may be sub-element) "; - } ## end else [ if ( ( !$self->{ _WSDL... - - } ## end if ( $p->{ type } =~ m/^$typeNS/... - else - { ### must be a complex type - ### get complex type - my $type = $p->{ type }; - $type =~ s/^($defaultNS)\://; # - $type =~ s/^(.+?\:)?//; - my $path; - { - no warnings; - - $path = '/' - . $self->_wsdl_wsdlns - . 'definitions/' - . $self->_wsdl_wsdlns - . "types/${schemaNS}schema/" - . "${schemaNS}complexType[\@name='$type']" . '|' . '/' - . $self->_wsdl_wsdlns - . 'definitions/' - . $self->_wsdl_wsdlns - . "types/schema[\@xmlns='" - . $nsHash{ $schemaNS } - . "' and \@targetNameSpace = '" - . $nsHash{ $1 } . "' ]/" - . "complexType[\@name='$type']"; - }; - - my $complexType = $self->_wsdl_find( $path, "dieIfError" )->shift; - - ### handles arrays of complex types - ### TBD: check for min /max number of elements - if ( ref $data->{ $p->{ name } } eq 'ARRAY' ) - { - - #$data says: look, in this position I have for you an array of stuff - my @resultArray = (); - foreach my $subdata ( @{ $data->{ $p->{ name } } } ) - { - $result = SOAP::Data->new( name => $p->{ name } ); - $result->type( $type ) if ( $self->autotype ); - $result->attr( { xmlns => $p->{ xmlns } } ) - if $p->{ xmlns }; - my $value = - $self->_encodeComplexType( $complexType, $subdata ); - push @resultArray, $result->value( $value ) - if ( defined( $value ) ); - } ## end foreach my $subdata ( @{ $data... - return ( @resultArray ) ? @resultArray : (); - } ## end if ( ref $data->{ $p->... - else - { - $result = SOAP::Data->new( name => $p->{ name } ); - - #.Net compatibility $result->type( $type ) if ($self->autotype); - $result->attr( { xmlns => $p->{ xmlns } } ) if $p->{ xmlns }; - my $value; - - # - if ( $data->{ $p->{ name } } ) - { #we have some data to encode - $value = - $self->_encodeComplexType( $complexType, - $data->{ $p->{ name } } ); - } ## end if ( $data->{ $p->{ name... - else - { - $p->{ minOccurs } = - $part->findvalue( '@minOccurs' )->value; - if ( $p->{ minOccurs } ne '' and $p->{ minOccurs } > 0 ) - { - - #this element is required, but we have no data to encode - #it's an error - die "illegal number of elements (0, min: " - . $p->{ minOccurs } - . ", for element '$p->{ name }' (may be sub-element) "; - } ## end if ( $p->{ minOccurs }... - } ## end else [ if ( $data->{ $p->{ name... - return () unless ( defined( $value ) ); - return ( $result->value( $value ) ); - } ## end else [ if ( ref $data->{ $p->... - } ## end else [ if ( $p->{ type } =~ m/^$typeNS/... - } ## end if ( ( $p->{ type } ) ... - elsif ( $p->{ element } ) - { - - #if p has no type, then must be an an element (or an error) - #which one? - my $elementPath = $p->{ element }; - - $elementPath =~ s/^$defaultNS\://; - - # there are two ways how schema are usually defined - my $path = '/' - . $self->_wsdl_wsdlns - . 'definitions/' - . $self->_wsdl_wsdlns - . 'types/' - . $schemaNS - . 'schema/' - . $schemaNS - . 'element[@name="' - . $elementPath . '"]/' - . $schemaNS - . 'complexType/' - . 'descendant::' - . $schemaNS - . 'element'; - - my $elements = $self->_wsdl_findnodes( $path, "dieIfError" ); - - my @resultArray = (); - while ( my $e = $elements->shift ) - { - my @enc; - @enc = $self->encode( $e, $data ); - push @resultArray, @enc if ( @enc ); - } ## end while ( my $e = $elements... - return ( @resultArray ) ? @resultArray : (); - } ## end elsif ( $p->{ element } ) - else - { - - #typical case when coping with .Net generated wsdl files - ( $p->{ name } eq "anyType" ) - and print -"Oops, have you defined an ArrayOfAnyType without the Type? Try type=[namespace]:anyType\n"; - die "illegal part definition\n"; - } ## end else [ if ( ( $p->{ type } ) ... - return (); # if we got here, something went wrong... -} ## end sub encode - -sub _encodeComplexType -{ - my $self = shift; - my $complexType = shift; - my $data = shift; - my @result = (); - my $schemaNS = $self->_wsdl_schemans ? $self->_wsdl_schemans . ':' : ''; - my $defaultNS = $self->_wsdl_tns; - my %nsHash = reverse %{ $self->_wsdl_ns }; - - #-- first we encode the local elements .... - my $path = './/' . $schemaNS . 'element'; - my $elements = $complexType->find( $path ); - while ( my $e = $elements->shift ) - { - my @enc; - @enc = $self->encode( $e, $data ); - push @result, @enc if ( @enc ); - } ## end while ( my $e = $elements... - - my $extension = undef; - ### check for extension -#%baseList avoids loops while looking at the extensions chain, just a flag holder - my %baseList = (); - - #... and then we cope with the chain of extensions - while ( $extension = - $complexType->find( './/' . $schemaNS . 'extension' )->shift ) - { - ### pull in extension base - my $base = $extension->findvalue( '@base' ); - $base =~ s/^$defaultNS\://; - $base =~ s/^(.+?\:)//; - - #- - last if ( $baseList{ $base } ); #got a loop - $baseList{ $base } = 1; - - #- - my $path; - { - no warnings; - - # there are two ways how schema are usually defined - $path = '/' - . $self->_wsdl_wsdlns - . 'definitions/' - . $self->_wsdl_wsdlns - . "types/" - . $schemaNS - . "schema/" - . $schemaNS - . "complexType[\@name='$base']" . '|' . '/' - . $self->_wsdl_wsdlns - . 'definitions/' - . $self->_wsdl_wsdlns - . "types/schema[\@xmlns='" - . $nsHash{ $schemaNS } - . "' and \@targetNameSpace = '" - . $nsHash{ $1 } . "' ]/" - . "complexType[\@name='$base']"; - } - - $complexType = $self->_wsdl_find( $path, "dieIfError" )->shift; - - #now we can find the elements - $path = ".//" . $schemaNS . "element|.//element"; - my $elements = $complexType->find( $path ) - || die "Error processing WSDL: '$path' not found"; - - while ( my $e = $elements->shift ) - { - my @enc; - @enc = $self->encode( $e, $data ); - push @result, @enc if ( @enc ); - } ## end while ( my $e = $elements... - } ## end while ( $extension = $complexType... - return ( @result ) ? \SOAP::Data->value( @result ) : (); -} ## end sub _encodeComplexType + return unless @response; # nothing to do for one-ways + return wantarray ? @response : $response[0]; +} 1; @@ -1006,568 +322,419 @@ __END__ SOAP::WSDL - SOAP with WSDL support +=head1 Overview + +For creating Perl classes instrumenting a web service with a WSDL definition, +read L. + +For using an interpreting (thus slow and somewhat troublesome) WSDL based +SOAP client, which mimics L's API, read on. + =head1 SYNOPSIS - use SOAP::WSDL; - - my $soap = SOAP::WSDL->new( wsdl => 'http://server.com/ws.wsdl' ); - $soap->wsdlinit(); - $soap->servicename( 'myservice' ); - $soap->portname( 'myport' ); - - my $som = $soap->call( 'method' => ( - name => 'value' , - name => 'value' ) ); - - + my $soap = SOAP::WSDL->new( + wsdl => 'file://bla.wsdl', + ); + + my $result = $soap->call('MyMethod', %data); + =head1 DESCRIPTION -This is mainly a bugfix update to 1.22, which was a small update to 1.21 -- autodetection of servicename and portname have been -are re-introduced, so users of 1.20 have no need to change their scripts. +SOAP::WSDL provides easy access to Web Services with WSDL descriptions. -1.21 was a new version of SOAP::WSDL, mainly based on the work of -Giovanni S Fois. +The WSDL is parsed and stored in memory. -SOAP::WSDL provides WSDL support for SOAP::Lite. -It is built as a add-on to SOAP::Lite, and will sit on top of it, -forwarding all the actual request-response to SOAP::Lite - somewhat -like a pre-processor. +Your data is serialized according to the rules in the WSDL. -WSDL support means that you don't have to deal with those bitchy namespaces -some web services set on each and every method call parameter. +The only transport mechanisms currently supported are http and https. -It also means an end to that nasty +=head1 METHODS - SOAP::Data->name( 'Name' )->value( - SOAP::Data->name( 'Sub-Name')->value( 'Subvalue' ) - ); +=head2 new -encoding of complex data. (Another solution for this problem is just iterating -recursively over your data. But that doesn't work if you need more information -[e.g. namespaces etc] than just your data to encode your parameters). - -And it means that you can use ordinary hashes for your parameters - the -encording order will be derived from the WSDL and not from your (unordered) -data, thus the problem of unordered perl-hashes and WSDL EsequenceE -definitions is solved, too. (Another solution for the ordering problem is -tying your hash to a class that provides ordered hashes - Tie::IxHash is -one of them). - -=head2 Why should I use this ? - -SOAP::WSDL eases life for webservice developers who have to communicate with -lots of different web services using a reasonable big number of method calls. - -If you just want to call a hand full of methods of one web service, take -SOAP::Lite's stubmaker and modify the stuff by hand if it doesn't work right -from the start. The overhead SOAP::WSDL imposes on your calls is not worth -the time saving. - -If you need to access many web services offering zillions of methods to you, -this module should be your choice. It automatically encodes your perl data -structures correctly, based on the service's WSDL description, handling -even those complex types SOAP::Lite can't cope with. - -SOAP::WSDL also eliminates most perl E-E .NET interoperability -problems by qualifying method and parameters as they are specified in the -WSDL definition. - -=head1 USAGE - - my $soap=SOAP::WSDL->new( wsdl => 'http://server.com/ws.wsdl' ); - - # or - my $soap=SOAP::WSDL->new() - $soap->wsdl('http://server.com/ws.wsdl'); - - # or - # without dispatching calls to the WebService - # - # useful for testing - my $soap=SOAP::WSDL->new( wsdl => 'http://server.com/ws.wsdl', - no_dispatch => 1 ); - - # never forget to call this !in order to start the parsing procedure - $soap->wsdlinit(); - - # with caching enabled:don't forget the cache directory - $soap->wsdlinit( caching => 1, cache_directory =>"/tmp/cachedir"); - - # optional, set to a false value if you don't want your - # soap message elements to be typed - $soap->autotype(0); - - # you may specify a service and port - if not, SOAP::WSDL will search for - # the first one appearing in the WSDL - $soap->servicename('myservice'); - $soap->portname('myport'); - - my $som=$soap->call( 'method' , - name => 'value' , - name => 'value' ); - - - # with the method overloaded (got it from the standard) - my $som=$soap->call( 'method' , - wsdl_input_name => unique_input_message_name - name => 'value' , - name => 'value' ); - - # with headers (see the SOAP documentation) - - #first define your headers - @header = (SOAP::Header->name("FirstHeader")->value("FirstValue"), - SOAP::Header->name("SecontHeader")->value("SecondValue")); - - #and then do the call. please note the backslash - my $som=$soap->call( 'method' , - name => 'value' , - name => 'value' , - "soap_headers" => \@header); - - -=head1 How it works - -SOAP::WSDL takes the wsdl file specified and looks up the service and the -specified port. - -On calling a SOAP method, it looks up the message encoding and wraps all the -stuff around your data accordingly. - -Most pre-processing is done in I, the rest is done in I, which -overrides the same method from SOAP::Lite. - -=head2 wsdlinit - -SOAP::WSDL loads the wsdl file specified by the wsdl parameter / call using -SOAP::Lite's schema method. It sets up a XPath object of that wsdl file, and -subsequently queries it for namespaces, service, and port elements. - -SOAP::WSDL automatically uses the first service and port found in the WSDL. - -If you want to chose a different one, you can specify the service by calling - - $soap->servicename('ServiceToUse'); - $soap->portname('PortToUse'); +Constructor. All parameters passed are passed to the corresponding methods. =head2 call -The call method examines the wsdl file to find out how to encode the SOAP -message for your method. Lookups are done in real-time using XPath, so this -incorporates a small delay to your calls (see -L below. +Performs a SOAP call. The result is either an object tree (with outputtree), +a hash reference (with outputhash), plain XML (with outputxml) or a SOAP::SOM +object (with neither of the above set). -The SOAP message will include the types for each element, unless you have -set autotype to a false value by calling +call() can be called in different ways: - $soap->autotype(0); +=over -After wrapping your call into what is appropriate, SOAP::WSDL uses the -I method from SOAP::Lite to dispatch your call. +=item * Old-style idiom -call takes the method name as first argument, and the parameters passed to -that method as following arguments. + my $result = $soap->call('method', %data); -B +Does not support SOAP header data. - $som=$soap->call( "SomeMethod" , "test" => "testvalue" ); +=item * New-style idiom - $som=$soap->call( "SomeMethod" => %args ); + my $result = $soap->call('method', $body_ref, $header_ref ); -=head1 Caching +Does support SOAP header data. $body_ref and $header ref may either be +hash refs or SOAP::WSDL::XSD::Typelib::* derived objects. -SOAP::WSDL uses a two-stage caching mechanism to achieve best performance. +Result headers are accessible via the result SOAP::SOM object. -First, there's a pretty simple caching mechanisms for storing XPath query -results. +If outputtree or outputhash are set, you may also use the following to +access response header data: -They are just stored in a hash with the XPath path as key (until recently, -only results of "find" or "findnodes" are cached). I did not use the obvious -L or L module here, because these -use L to store complex objects and thus incorporate a -performance loss heavier than using no cache at all. + my ($body, $header) = $soap->call('method', $body_ref, $header_ref ); -Second, the XPath object and the XPath results cache are be stored on disk -using the L implementation. - -A filesystem cache is only used if you - - 1) enable caching - 2) set wsdl_cache_directory - -The cache directory must be, of course, read- and writeable. - -XPath result caching doubles performance, but increases memory consumption -- if you lack of memory, you should not enable caching (disabled by default). - -Filesystem caching triples performance for wsdlinit and doubles performance -for the first method call. - -The file system cache is written to disk when the SOAP::WSDL object is -destroyed. - -It may be written to disk any time by calling the L method. - -Using both filesystem and in-memory caching is recommended for best -performance and smallest startup costs. - -=head2 Sharing cache between applications - -Sharing a file system cache among applications accessing the same web -service is generally possible, but may under some circumstances reduce -performance, and under some special circumstances even lead to errors. -This is due to the cache key algorithm used. - -SOAP::WSDL uses the WSDL's URL to store the XML::XPath object of the -wsdl file. If you're using more than one WSDL definition on the same URL, -this may lead to errors when two or more applications using SOAP::WSDL -share a file system cache. - -SOAP::WSDL stores the XPath results in-memory-cache in the filesystem cache, -using the URL wsdl file with C<_cache> appended. Two applications sharing the -file system cache and accessing different methods of one web service could -overwrite each others in-memory-caches when dumping the XPath results to -disk, resulting in a slight performance drawback (even though this only -happens in the rare case of one app being started before the other one has -had a chance to write its cache to disk). - -=head2 Controlling the file system cache - -If you want full controll over the file system cache, you can use wsdl_init_cash to -initialize it. wsdl_init_cash will take the same parameters as Cache::FileCache->new(). -See L and L for details. - -=head2 Notes - -If you plan to write your own caching implementation, you should consider the following: - -The XPath results cache must not survive the XPath object SOAP::WSDL uses to -store the WSDL file in (this could cause memory holes - see -L for details). -This never happens during normal usage - but note that you have been warned -before trying to store and re-read SOAP::WSDL's internal cache. - -=head1 Methods - -=head2 Frequently used methods - -=head3 wsdl - - $soap->wsdl('http://my.web.service.com/wsdl'); - -Use this to specify the WSDL file to use. Must be a valid (and accessible !) -url. - -You must call this before calling L. - -For time saving's sake, this should be a local file - you never know how much -time your WebService needs for delivering a wsdl file. +=back =head2 wsdlinit - $soap->wsdlinit( caching => 1, - cache_directory => '/tmp/cache' ); +Reads the WSDL file and initializes SOAP::WSDL for working with it. -Initializes the WSDL document for usage. +Is called automatically from call() if not called directly before. -wsdlinit will die if it can't set up the WSDL file properly, so you might -want to eval{} it. + servicename + portname + call -On death, $@ will (hopefully) contain some error message like +You may set servicename and portname by passing them as attributes to +wsdlinit: - Error processing WSDL: no element found + $soap->wsdlinit( + servicename => 'MyService', + portname => 'MyPort' + ); -to give you a hint about what went wrong. +=head1 CONFIGURATION METHODS -wsdlinit will accept a hash of parameters with the following keys: +=head2 outputtree -=over 4 +When outputtree is set, SOAP::WSDL will return an object tree instead of a +SOAP::SOM object. -=item * caching +You have to specify a class_resolver for this to work. See +L -enables caching if true +=head2 class_resolver -=item * cache_directory +Set the class resolver class (or object). -The cache directory to use for FS caching +Class resolvers must implement the method get_class which has to return the +name of the class name for deserializing a XML node at the current XPath +location. -=item * url +Class resolvers are typically generated by using the generate_typemap method +of a SOAP::WSDL::Generator subclass. -URL to derive port and service name from. If url is given, wsdlinit will try -to find a matching service and port in the WSDL definition. +Example: -=item * servicename +XML structure (SOAP body content): -like setting the servicename directly. See below. + + Smith + John + -=item * portname +Class resolver -like setting the servicename directly. See below. + package MyResolver; + my %typemap = ( + 'Person' => 'MyPersonClass', + 'Person/Name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + 'Person/FirstName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', + ); + + sub get_class { return $typemap{ $_[1] } }; + 1; + +You'll need a MyPersonClass module in your search path for this to work - see +SOAP::WSDL::XSD::ComplexType on how to build / generate one. + +=head2 servicename + + $soap->servicename('Name'); + +Sets the service to operate on. If no service is set via servicename, the +first service found is used. + +Returns the soap object, so you can chain calls like + + $soap->servicename->('Name')->portname('Port'); + +=head2 portname + + $soap->portname('Name'); + +Sets the port to operate on. If no port is set via portname, the +first port found is used. + +Returns the soap object, so you can chain calls like + + $soap->portname('Port')->call('MyMethod', %data); + +=head2 no_dispatch + +When set, call() returns the plain request XML instead of dispatching the +SOAP call to the SOAP service. Handy for testing/debugging. + +=head1 ACCESS TO SOAP::WSDL's internals + +=head2 get_client / set_client + +Returns the SOAP client implementation used (normally a SOAP::WSDL::Client +object). + +=head1 EXAMPLES + +See the examples/ directory. + +=head1 Differences to previous versions + +=over + +=item * WSDL handling + +SOAP::WSDL 2 is a complete rewrite. While SOAP::WSDL 1.x attempted to +process the WSDL file on the fly by using XPath queries, SOAP:WSDL 2 uses a +Expat handler for parsing the WSDL and building up a object tree representing +it's content. + +The object tree has two main functions: It knows how to serialize data passed +as hash ref, and how to render the WSDL elements found into perl classes. + +Yup your're right, there's a builting code generation facility. Read +L for using it. + +=item * no_dispatch + +call() with no_dispatch set to true now returns the complete SOAP request +envelope, not only the body's content. + +=item * outputxml + +call() with outputxml set to true now returns the complete SOAP response +envelope, not only the body's content. + +=item * servicename/portname + +Both servicename and portname can only be called B calling wsdlinit(). + +You may pass the servicename and portname as attributes to wsdlinit, though. =back -=head3 call +=head1 Differences to SOAP::Lite - $soap->call($method, %data); +=head2 readable -See above. +readable is a no-op in SOAP::WSDL. Actually, the XML output from SOAP::Lite +is hardly readable, either with readable switched on. -call will die if it can't find required elements in the WSDL file or if your data -doesn't meet the WSDL definition's requirements, so you might want to eval{} it. -On death, $@ will (hopefully) contain some error message like +If you need readable XML messages, I suggest using your favorite XML editor +for displaying and formatting. - Error processing WSDL: no element found +=head2 Message style/encoding -to give you a hint about what went wrong. +While SOAP::Lite supports rpc/encoded style/encoding only, SOAP::WSDL currently +supports document/literal style/encoding. -=head2 Configuration methods +=head2 autotype / type information -=head3 servicename +SOAP::Lite defaults to transmitting XML type information by default, where +SOAP::WSDL defaults to leaving it out. - $soap->servicename('Service1'); +autotype(1) might even be broken in SOAP::WSDL - it's not well-tested, yet. -Use this to specify a service by name. -Your wsdl contains definitions for one or more services - hou have to tell -SOAP::WSDL which one to use. +=head2 Output formats -You can call it before each method call. - -=head3 portname - - $soap->portname('Port1'); - -Your service can have one or many ports attached to it. -Each port has some operation defined in it trough a binding. -You have to tell which port of your service should be used for the -method you are calling. - -You can call it before each method call. - -=head3 wsdl_checkoccurs - -Enables/disables checks for correct number of -occurences of elements in WSDL types. The default is 1 (on). - -Turning off occurance number checking results in a sligt performance gain. - -To turn off checking for correct number of elements, call - - $soap->wsdl_checkoccurs(0); - -=head3 wsdl_encoding - -The encoding style for the SOAP call. - -=head3 cache_directory - -enables filesystem caching (in the directory specified). The directory given must be -existant, read- and writeable. - -=head3 wsdl_cache_directory - - $soap->wsdl_cache_directory( '/tmp/cache' ); - -Sets the directory used for filesystem caching and enables filesystem caching. -Passing the I parameter to wsdlinit has the same effect. - -=head2 Seldomly used methods - -The following methods are mainly used internally in SOAP::WSDL, but may -be useful for debugging and some special purposes (like forcing a cache flush -on disk or custom cache initializations). - -=head3 no_dispatch - -Gets/Sets the I flag. If no_dispatch is set to true value, SOAP::WSDL -will not dispatch your calls to a remote server but return the SOAP::SOM object -containing the call instead. - -=head3 encode - - # this is how call uses encode - # $xpath contains a XPath object of the wsdl document - - my $def=$xpath->find("/definitions")->shift; - my $parts=$def->find("//message[\@name='$messageName']/part"); - - my @param=(); - - while (my $part=$parts->shift) { - my $enc=$self->encode($part, \%data); - push @param, $enc if defined $enc; - } - -Does the actual encoding. Expects a XPath::NodeSet as first, a hashref containing -your data as second parameter. The XPath nodeset must be a node specifying a WSDL -message part. - -You won't need to call I unless you plan to -override I or want to write a new SOAP server implementation. - -=head3 * wsdl_cache_init - -Initialize the WSDL file cache. Normally called from wsdlinit. For custom -cache initailization, you may pass the same parameters as to -Cache::FileCache->new(). - -=head3 wsdl_cache_store - - $soap->wsdl_cache_store(); - -Stores the content of the in-memory-cache (and the XML::XPath representation of -the WSDL file) to disk. This will not have any effect if cache_directory is not set. - -=head1 Notes - -=head2 Why another SOAP module ? - -SOAP::Lite provides only some rudimentary WSDL support. This lack is not just -something unimplemented, but an offspring of the SOAP::Schema -class design. SOAP::Schema uses some complicated format to store XML Schema information -(mostly a big hashref, containing arrays of SOAP::Data and a SOAP::Parser-derived -object). This data structure makes it pretty hard to improve SOAP::Lite's -WSDL support. - -SOAP::WSDL uses XPath for processing WSDL. XPath is a query language standard for -XML, and usually a good choice for XML transformations or XML template processing -(and what else is WSDL-based en-/decoding ?). Besides, there's an excellent XPath -module (L) available from CPAN, and as SOAP::Lite uses XPath to -access elements in SOAP::SOM objects, this seems like a natural choice. - -Fiddling the kind of WSDL support implemented here into SOAP::Lite would mean -a larger set of changes, so I decided to build something to use as add-on. - -=head2 Memory consumption and performance - -SOAP::WSDL uses around twice the memory (or even more) SOAP::Lite uses for the -same task (but remember: SOAP::WSDL does things for you SOAP::Lite can't). -It imposes a slight delay for initialization, and for every SOAP method call, too. - -On my 1.4 GHz Pentium mobile notebook, the init delay with a simple -WSDL file (containing just one operation and some complex types and elements) -was around 50 ms, the delay for the first call around 25 ms and for subsequent -calls to the same method around 7 ms without and around 6 ms with XPath result -caching (on caching, see above). XML::XPath must do some caching, too - -don't know where else the speedup should come from. - -Calling a method of a more complex WSDL file (defining around 10 methods and -numerous complex types on around 500 lines of XML), the delay for the first -call was around 100 ms for the first and 70 ms for subsequent method calls. -wsdlinit took around 150 ms to process the stuff. With XPath result caching enabled, -all but the first call take around 35 ms. - -Using SOAP::WSDL on an idiotically complex WSDL file with just one method, but around -100 parameters for that method, mostly made up by extensions of complex types -(the heaviest XPath operation) takes around 1.2 s for the first call (0.9 with caching) -and around 830 ms for subsequent calls (arount 570 ms with caching). - -The actual performance loss compared to SOAP::Lite should be around 10 % less -than the values above - SOAP::Lite encodes the data for you, too (or you do -it yourself) - and encoding in SOAP::WSDL is already covered by the pre-call -delay time mentioned above. - -If you have lots of WebService methods and call each of them from time to time, -this delay should not affect your perfomance too much. If you have just one method -and keep calling it ever & ever again, you should cosider hardcoding your data -encoding (maybe even with hardcoded XML templates - yes, this may be a BIG speedup). - - -=head1 CAVEATS - -=head2 API change between 1.20 and 1.21 - -Giovanni S. Fois has implemented a new calling convention, which allows to specify the -port type used by SOAP::WSDL. - -While this allows greater flexibillity (and helps around the still missing bindings support), -the following lines have to be added to existing code: - - $soap->servicename( $servicename); - $soap->portname( $porttype ); - -Both lines must appear after calling - - $soap->wsdlinit(); - -=head2 API change between 1.13 and 1.14 - -The SOAP::WSDL API changed significantly between versions 1.13 and 1.14. -From 1.14 on, B expects the following arguments: method name as scalar first, -method parameters as hash following. - -The B no longer recognizes the I option - to get the same behaviour, -pass C 1> to I or call - - $soap->no_dispatch(1); - -=head2 Unstable interface - -This is alpha software - everything may (and most things will) change. -But you don't have to be afraid too much - at least the I synopsis should -be stable from 1.14 on, and that is the part you'll use most frequently. - -=head1 BUGS +In contrast to SOAP::Lite, SOAP::WSDL supports the following output formats: =over -=item * Arrays of complex types are not checked for the correct number of elements +=item * SOAP::SOM objects. -Arrays of complex types are just encoded and not checked for correctness etc. -I don't know if I do this right yet, but output looks good. However, they are not -checked for the correct number of element (does the SOAP spec say how to -specify this ?). +This is the default. SOAP::Lite is required for outputting SOAP::SOM objects. -=item * +trace (and other SOAP::Lite flags) don't work +=item * Object trees. -This may be an issue with older versions of the base module (before 2.?), or with -activestate's activeperl, which do -not call the base modules I method with the flags supplied to the parent. +This is the recommended output format. +You need a class resolver (typemap) for outputting object trees. +See L above. -There's a simple workaround: +=item * Hash refs - use SOAP::WSDL; - import SOAP::Lite +trace; +This is for convnience: A single hash ref containing the content of the +SOAP body. -=item * nothing else known +=item * xml -But I'm sure there are some serious bugs lurking around somewhere. +See below. =back -=head1 TODO +=head2 outputxml + +SOAP::Lite returns only the content of the SOAP body when outputxml is set +to true. SOAP::WSDL returns the complete XML response. + +=head2 Auto-Dispatching + +SOAP::WSDL does B 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 - see L for creating +such interfaces. + +=head2 Debugging / Tracing + +While SOAP::Lite features a global tracing facility, SOAP::WSDL +allows to switch tracing on/of on a per-object base. + +This has to be done in the SOAP client used by SOAP::WSDL - see +L for an example and L for +details. + +=head1 Bugs and Limitations + +=over + +=item * Apache SOAP datatypes are not supported + +You currently can't use SOAP::WSDL with Apache SOAP datatypes like map. + +If you want this changed, email me a copy of the specs, please. + +=item * Incomplete XML Schema definitions support + +XML Schema attribute definitions are not supported yet. + +Importing external definitions is not supported yet. + +The following XML Schema definitions varieties are not supported: + + group + union + simpleContent + +The following XML Schema definition content model is only partially +supported: + + complexContent - only restriction variety supported + +See L for details. + +=item * Serialization of hash refs dos not work for ambiguos values + +If you have list elements with multiple occurences allowed, SOAP::WSDL +has no means of finding out which variant you meant. + +Passing in item => [1,2,3] could serialize to + + 1 23 + 12 3 + +Ambiguos data can be avoided by providing data as objects. + +=item * XML Schema facets + +Almost no XML schema facets are implemented yet. The only facets +currently implemented are: + + fixed + default + +The following facets have no influence yet: + + minLength + maxLength + minInclusive + maxInclusive + minExclusive + maxExclusive + pattern + enumeration + +=back + +=head1 SEE ALSO + +=head2 Related projects =over -=item Allow use of alternative XPath implementations +=item * L -XML::XPath is a great module, but it's not a race-winning one. -XML::LibXML offers a promising-looking XPath interface. SOAP::WSDL should -support both, defaulting to the faster one, and leaving the final choice -to the user. +Full featured SOAP-library, little WSDL support. Supports rpc-encoded style only. Many protocols supported. + +=item * + +A promising-looking approach derived from a cool functional DOM-based XML schema parser. + +Will support encoding/decoding of SOAP messages based on WSDL definitions. + +Not yet finished at the time of writing - but you may wish to give it a try, especially +if you need to adhere very closely to the XML Schema / WSDL specs. =back -=head1 CHANGES +=head2 Sources of documentation -See CHANGES file. +=over -=head1 COPYRIGHT +=item * SOAP::WSDL homepage at sourceforge.net -This library is free software, you can distribute / modify it under the same -terms as perl itself. +L -=head1 AUTHOR> +=item * SOAP::WSDL forum at CPAN::Forum -Replace whitespace by '@' in E-Mail addresses. +L - Martin Kutter - Giovanni S. Fois +=back -=head1 SVN information +=head1 ACKNOWLEDGMENTS +There are many people out there who fostered SOAP::WSDL's developement. +I would like to thank them all (and apologize to all those I have forgotten). + +Giovanni S. Fois wrote a improved version of SOAP::WSDL (which eventually +became v1.23) + +David Bussenschutt, Damian A. Martinez Gelabert, Dennis S. Hennen, Dan Horne, +Peter Orvos, Mark Overmeer, Jon Robens, Isidro Vila Verde and Glenn Wood +spotted bugs and/or suggested improvements in the 1.2x releases. + +Andreas 'ac0v' Specht constantly asked for better performance. + +JT Justman provided some early feedback for the 2.xx pre-releases. + +Numerous people sent me their real-world WSDL files for testing. Thank you. + +Paul Kulchenko and Byrne Reese wrote and maintained SOAP::Lite and +thus provided a base (and counterpart) for SOAP::WSDL. + +=head1 LICENSE + +Copyright 2004-2007 Martin Kutter. + +This file is part of SOAP-WSDL. You may distribute/modify it under +the same terms as perl itself + +=head1 AUTHOR + +Martin Kutter Emartin.kutter fen-net.deE + +=head1 REPOSITORY INFORMATION + + $Rev: 308 $ $LastChangedBy: kutterma $ - $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/branches/1.21/lib/SOAP/WSDL.pm $ - $Rev: 278 $ - + $Id: WSDL.pm 308 2007-10-05 17:35:28Z kutterma $ + $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm $ + =cut + diff --git a/lib/SOAP/WSDL/Base.pm b/lib/SOAP/WSDL/Base.pm new file mode 100644 index 0000000..eea7126 --- /dev/null +++ b/lib/SOAP/WSDL/Base.pm @@ -0,0 +1,130 @@ +package SOAP::WSDL::Base; +use strict; +use warnings; +use Class::Std::Storable; +use List::Util qw(first); +use Carp qw(confess); + +our $VERSION='2.00_17'; + +my %id_of :ATTR(:name :default<()>); +my %name_of :ATTR(:name :default<()>); +my %documentation_of :ATTR(:name :default<()>); +my %targetNamespace_of :ATTR(:name :default<()>); +my %xmlns_of :ATTR(:name :default<{}>); +my %parent_of :ATTR(:name :default<()>); + +sub DEMOLISH { + my $self = shift; + # delete upward references + delete $parent_of{ ident $self }; +} + +sub STORABLE_freeze_pre :CUMULATIVE {}; +sub STORABLE_freeze_post :CUMULATIVE {}; +sub STORABLE_thaw_pre :CUMULATIVE {}; +sub STORABLE_thaw_post :CUMULATIVE { return $_[0] }; + +sub _accept { + my $self = shift; + my $class = ref $self; + $class =~ s{ \A SOAP::WSDL:: }{}xms; + $class =~ s{ (:? :: ) }{_}gxms; + my $method = "visit_$class"; + no strict qw(refs); + shift->$method( $self ); +} + +# 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) { + my $getter = "get_$subname"; + my $setter = "set_$subname"; + ## Checking here is paranoid - will fail fatally if + ## there is no setter... + ## And we would have to check getters, too. + ## Maybe do it the Conway way via the Symbol table... + ## ... can is way slow... + 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) { + @values = @{ $values[0] } if ref $values[0] eq 'ARRAY'; + return sub { + return first { + $_->get_targetNamespace() eq $values[0] && + $_->get_name() eq $values[1] + } + @{ $self->$subname() }; + } + } + 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]; + }; + } + confess "$subname not found in class " . (ref $self || $self) ; +} + +sub init { + my $self = shift; + my @args = @_; + foreach my $value (@args) + { + die @args if (not defined ($value->{ Name })); + if ($value->{ Name } =~m{^xmlns\:}xms) { + die $xmlns_of{ ident $self } + if ref $xmlns_of{ ident $self } ne 'HASH'; + + # add namespaces + $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 } ); + } + return $self; +} + +sub expand { + my ($self, , $qname) = @_; + my ($prefix, $localname) = split /:/, $qname; + my %ns_map = reverse %{ $self->get_xmlns() }; + return ($ns_map{ $prefix }, $localname) if ($ns_map{ $prefix }); + + if (my $parent = $self->get_parent()) { + return $parent->expand($qname); + } + confess "unbound prefix $prefix found for $prefix:$localname"; +} +sub _expand; +*_expand = \&expand; + +1; diff --git a/lib/SOAP/WSDL/Binding.pm b/lib/SOAP/WSDL/Binding.pm new file mode 100644 index 0000000..6d4e5b1 --- /dev/null +++ b/lib/SOAP/WSDL/Binding.pm @@ -0,0 +1,13 @@ +package SOAP::WSDL::Binding; +use strict; +use warnings; +use Class::Std::Storable; +use List::Util qw(first); +use base qw(SOAP::WSDL::Base); + +my %operation_of :ATTR(:name :default<()>); +my %type_of :ATTR(:name :default<()>); +my %transport_of :ATTR(:name :default<()>); +my %style_of :ATTR(:name