soap4r 1.5.5.20061022
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/wsdl2ruby.rb +131 -0
- data/bin/xsd2ruby.rb +82 -0
- data/lib/soap/XMLSchemaDatatypes.rb +9 -0
- data/lib/soap/XMLSchemaDatatypes1999.rb +10 -0
- data/lib/soap/attachment.rb +108 -0
- data/lib/soap/baseData.rb +992 -0
- data/lib/soap/cgistub.rb +9 -0
- data/lib/soap/charset.rb +9 -0
- data/lib/soap/compat.rb +182 -0
- data/lib/soap/driver.rb +9 -0
- data/lib/soap/element.rb +266 -0
- data/lib/soap/encodingstyle/aspDotNetHandler.rb +207 -0
- data/lib/soap/encodingstyle/handler.rb +109 -0
- data/lib/soap/encodingstyle/literalHandler.rb +241 -0
- data/lib/soap/encodingstyle/soapHandler.rb +598 -0
- data/lib/soap/generator.rb +264 -0
- data/lib/soap/header/handler.rb +60 -0
- data/lib/soap/header/handlerset.rb +70 -0
- data/lib/soap/header/simplehandler.rb +44 -0
- data/lib/soap/httpconfigloader.rb +119 -0
- data/lib/soap/mapping.rb +12 -0
- data/lib/soap/mapping/encodedregistry.rb +531 -0
- data/lib/soap/mapping/factory.rb +372 -0
- data/lib/soap/mapping/literalregistry.rb +321 -0
- data/lib/soap/mapping/mapping.rb +561 -0
- data/lib/soap/mapping/registry.rb +258 -0
- data/lib/soap/mapping/rubytypeFactory.rb +475 -0
- data/lib/soap/mapping/typeMap.rb +82 -0
- data/lib/soap/mapping/wsdlencodedregistry.rb +253 -0
- data/lib/soap/mapping/wsdlliteralregistry.rb +246 -0
- data/lib/soap/mappingRegistry.rb +9 -0
- data/lib/soap/marshal.rb +59 -0
- data/lib/soap/mimemessage.rb +241 -0
- data/lib/soap/namespace.rb +9 -0
- data/lib/soap/netHttpClient.rb +204 -0
- data/lib/soap/parser.rb +251 -0
- data/lib/soap/processor.rb +66 -0
- data/lib/soap/property.rb +333 -0
- data/lib/soap/proxy.rb +14 -0
- data/lib/soap/qname.rb +9 -0
- data/lib/soap/rpc/cgistub.rb +214 -0
- data/lib/soap/rpc/driver.rb +245 -0
- data/lib/soap/rpc/element.rb +330 -0
- data/lib/soap/rpc/httpserver.rb +143 -0
- data/lib/soap/rpc/proxy.rb +563 -0
- data/lib/soap/rpc/router.rb +602 -0
- data/lib/soap/rpc/rpc.rb +25 -0
- data/lib/soap/rpc/soaplet.rb +162 -0
- data/lib/soap/rpc/standaloneServer.rb +43 -0
- data/lib/soap/rpcRouter.rb +9 -0
- data/lib/soap/rpcUtils.rb +9 -0
- data/lib/soap/server.rb +9 -0
- data/lib/soap/soap.rb +150 -0
- data/lib/soap/standaloneServer.rb +9 -0
- data/lib/soap/streamHandler.rb +258 -0
- data/lib/soap/wsdlDriver.rb +580 -0
- data/lib/wsdl/binding.rb +65 -0
- data/lib/wsdl/data.rb +64 -0
- data/lib/wsdl/definitions.rb +250 -0
- data/lib/wsdl/documentation.rb +32 -0
- data/lib/wsdl/import.rb +80 -0
- data/lib/wsdl/importer.rb +38 -0
- data/lib/wsdl/info.rb +39 -0
- data/lib/wsdl/message.rb +54 -0
- data/lib/wsdl/operation.rb +175 -0
- data/lib/wsdl/operationBinding.rb +116 -0
- data/lib/wsdl/param.rb +85 -0
- data/lib/wsdl/parser.rb +163 -0
- data/lib/wsdl/part.rb +52 -0
- data/lib/wsdl/port.rb +84 -0
- data/lib/wsdl/portType.rb +75 -0
- data/lib/wsdl/service.rb +61 -0
- data/lib/wsdl/soap/address.rb +40 -0
- data/lib/wsdl/soap/binding.rb +49 -0
- data/lib/wsdl/soap/body.rb +56 -0
- data/lib/wsdl/soap/cgiStubCreator.rb +88 -0
- data/lib/wsdl/soap/classDefCreator.rb +340 -0
- data/lib/wsdl/soap/classDefCreatorSupport.rb +131 -0
- data/lib/wsdl/soap/clientSkeltonCreator.rb +93 -0
- data/lib/wsdl/soap/complexType.rb +166 -0
- data/lib/wsdl/soap/data.rb +42 -0
- data/lib/wsdl/soap/definitions.rb +151 -0
- data/lib/wsdl/soap/driverCreator.rb +110 -0
- data/lib/wsdl/soap/element.rb +28 -0
- data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +117 -0
- data/lib/wsdl/soap/fault.rb +56 -0
- data/lib/wsdl/soap/header.rb +86 -0
- data/lib/wsdl/soap/headerfault.rb +56 -0
- data/lib/wsdl/soap/literalMappingRegistryCreator.rb +188 -0
- data/lib/wsdl/soap/mappingRegistryCreator.rb +53 -0
- data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +233 -0
- data/lib/wsdl/soap/methodDefCreator.rb +253 -0
- data/lib/wsdl/soap/operation.rb +122 -0
- data/lib/wsdl/soap/servantSkeltonCreator.rb +78 -0
- data/lib/wsdl/soap/standaloneServerStubCreator.rb +98 -0
- data/lib/wsdl/soap/wsdl2ruby.rb +196 -0
- data/lib/wsdl/types.rb +44 -0
- data/lib/wsdl/wsdl.rb +23 -0
- data/lib/wsdl/xmlSchema/all.rb +24 -0
- data/lib/wsdl/xmlSchema/annotation.rb +34 -0
- data/lib/wsdl/xmlSchema/any.rb +56 -0
- data/lib/wsdl/xmlSchema/attribute.rb +123 -0
- data/lib/wsdl/xmlSchema/choice.rb +55 -0
- data/lib/wsdl/xmlSchema/complexContent.rb +88 -0
- data/lib/wsdl/xmlSchema/complexExtension.rb +104 -0
- data/lib/wsdl/xmlSchema/complexRestriction.rb +92 -0
- data/lib/wsdl/xmlSchema/complexType.rb +152 -0
- data/lib/wsdl/xmlSchema/content.rb +74 -0
- data/lib/wsdl/xmlSchema/data.rb +90 -0
- data/lib/wsdl/xmlSchema/element.rb +158 -0
- data/lib/wsdl/xmlSchema/enumeration.rb +36 -0
- data/lib/wsdl/xmlSchema/import.rb +65 -0
- data/lib/wsdl/xmlSchema/importer.rb +87 -0
- data/lib/wsdl/xmlSchema/include.rb +54 -0
- data/lib/wsdl/xmlSchema/length.rb +35 -0
- data/lib/wsdl/xmlSchema/list.rb +48 -0
- data/lib/wsdl/xmlSchema/maxlength.rb +35 -0
- data/lib/wsdl/xmlSchema/minlength.rb +35 -0
- data/lib/wsdl/xmlSchema/parser.rb +166 -0
- data/lib/wsdl/xmlSchema/pattern.rb +36 -0
- data/lib/wsdl/xmlSchema/schema.rb +144 -0
- data/lib/wsdl/xmlSchema/sequence.rb +51 -0
- data/lib/wsdl/xmlSchema/simpleContent.rb +69 -0
- data/lib/wsdl/xmlSchema/simpleExtension.rb +54 -0
- data/lib/wsdl/xmlSchema/simpleRestriction.rb +91 -0
- data/lib/wsdl/xmlSchema/simpleType.rb +80 -0
- data/lib/wsdl/xmlSchema/unique.rb +34 -0
- data/lib/wsdl/xmlSchema/xsd2ruby.rb +107 -0
- data/lib/xsd/charset.rb +187 -0
- data/lib/xsd/codegen.rb +12 -0
- data/lib/xsd/codegen/classdef.rb +203 -0
- data/lib/xsd/codegen/commentdef.rb +34 -0
- data/lib/xsd/codegen/gensupport.rb +168 -0
- data/lib/xsd/codegen/methoddef.rb +70 -0
- data/lib/xsd/codegen/moduledef.rb +191 -0
- data/lib/xsd/datatypes.rb +1282 -0
- data/lib/xsd/datatypes1999.rb +20 -0
- data/lib/xsd/iconvcharset.rb +33 -0
- data/lib/xsd/mapping.rb +42 -0
- data/lib/xsd/namedelements.rb +124 -0
- data/lib/xsd/ns.rb +146 -0
- data/lib/xsd/qname.rb +78 -0
- data/lib/xsd/xmlparser.rb +61 -0
- data/lib/xsd/xmlparser/parser.rb +96 -0
- data/lib/xsd/xmlparser/rexmlparser.rb +54 -0
- data/lib/xsd/xmlparser/xmlparser.rb +50 -0
- data/lib/xsd/xmlparser/xmlscanner.rb +147 -0
- data/test/16runner.rb +68 -0
- data/test/interopR2/README.txt +2 -0
- data/test/interopR2/SOAPBuildersInterop_R2.wsdl +461 -0
- data/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl +19 -0
- data/test/interopR2/base.rb +288 -0
- data/test/interopR2/client.NetRemoting.rb +17 -0
- data/test/interopR2/client.NetRemoting.rb.result +3410 -0
- data/test/interopR2/client.NetRemoting_Base.log +6279 -0
- data/test/interopR2/client.NetRemoting_GroupB.log +1188 -0
- data/test/interopR2/client.rb +1228 -0
- data/test/interopR2/client4S4C.rb +15 -0
- data/test/interopR2/client4S4C2.rb +14 -0
- data/test/interopR2/client4S4C2_Base.log +4955 -0
- data/test/interopR2/client4S4C2_GroupB.log +1000 -0
- data/test/interopR2/client4S4C_Base.log +4635 -0
- data/test/interopR2/client4S4C_GroupB.log +900 -0
- data/test/interopR2/clientASP.NET.rb +17 -0
- data/test/interopR2/clientASP.NET_Base.log +5468 -0
- data/test/interopR2/clientASP.NET_GroupB.log +977 -0
- data/test/interopR2/clientApacheAxis.rb +16 -0
- data/test/interopR2/clientApacheAxis_Base.log +3171 -0
- data/test/interopR2/clientApacheAxis_GroupB.log +498 -0
- data/test/interopR2/clientApacheSOAP.rb +17 -0
- data/test/interopR2/clientApacheSOAP_Base.log +3171 -0
- data/test/interopR2/clientBEAWebLogic.rb +17 -0
- data/test/interopR2/clientBEAWebLogic_Base.log +3171 -0
- data/test/interopR2/clientBEAWebLogic_GroupB.log +498 -0
- data/test/interopR2/clientBase.rb +1970 -0
- data/test/interopR2/clientCapeConnect.rb +18 -0
- data/test/interopR2/clientCapeConnect_Base.log +2126 -0
- data/test/interopR2/clientDelphi.rb +19 -0
- data/test/interopR2/clientDelphi_Base.log +0 -0
- data/test/interopR2/clientEasySoap.rb +14 -0
- data/test/interopR2/clientEasySoap_Base.log +6187 -0
- data/test/interopR2/clientEasySoap_GroupB.log +1076 -0
- data/test/interopR2/clientFrontier.rb +25 -0
- data/test/interopR2/clientFrontier_Base.log +5188 -0
- data/test/interopR2/clientGLUE.rb +32 -0
- data/test/interopR2/clientHP.rb +13 -0
- data/test/interopR2/clientHP_Base.log +3171 -0
- data/test/interopR2/clientHP_GroupB.log +498 -0
- data/test/interopR2/clientJAX-RPC.rb +19 -0
- data/test/interopR2/clientJSOAP.rb +14 -0
- data/test/interopR2/clientJSOAP_Base.log +4465 -0
- data/test/interopR2/clientJSOAP_GroupB.log +824 -0
- data/test/interopR2/clientKafkaXSLT.rb +15 -0
- data/test/interopR2/clientKafkaXSLT_Base.log +10299 -0
- data/test/interopR2/clientKafkaXSLT_GroupB.log +1739 -0
- data/test/interopR2/clientMSSOAPToolkit2.0.rb +17 -0
- data/test/interopR2/clientMSSOAPToolkit2.0_Base.log +4805 -0
- data/test/interopR2/clientMSSOAPToolkit2.0_GroupB.log +871 -0
- data/test/interopR2/clientMSSOAPToolkit3.0.rb +17 -0
- data/test/interopR2/clientMSSOAPToolkit3.0_Base.log +5076 -0
- data/test/interopR2/clientMSSOAPToolkit3.0_GroupB.log +908 -0
- data/test/interopR2/clientNuSOAP.rb +19 -0
- data/test/interopR2/clientNuSOAP_Base.log +5076 -0
- data/test/interopR2/clientNuSOAP_GroupB.log +958 -0
- data/test/interopR2/clientNuWave.rb +15 -0
- data/test/interopR2/clientNuWave_Base.log +2019 -0
- data/test/interopR2/clientOpenLink.rb +15 -0
- data/test/interopR2/clientOpenLink_Base.log +6171 -0
- data/test/interopR2/clientOpenLink_GroupB.log +1094 -0
- data/test/interopR2/clientOracle.rb +15 -0
- data/test/interopR2/clientOracle_Base.log +5594 -0
- data/test/interopR2/clientPEAR.rb +18 -0
- data/test/interopR2/clientPEAR_Base.log +6261 -0
- data/test/interopR2/clientPEAR_GroupB.log +1106 -0
- data/test/interopR2/clientPhalanx.rb +18 -0
- data/test/interopR2/clientPhalanx_Base.log +41036 -0
- data/test/interopR2/clientPhalanx_GroupB.log +6519 -0
- data/test/interopR2/clientSIMACE.rb +18 -0
- data/test/interopR2/clientSIMACE_Base.log +6171 -0
- data/test/interopR2/clientSIMACE_GroupB.log +1093 -0
- data/test/interopR2/clientSOAP4R.rb +18 -0
- data/test/interopR2/clientSOAP4R.rb.result +3409 -0
- data/test/interopR2/clientSOAP4R_Base.log +6366 -0
- data/test/interopR2/clientSOAP4R_GroupB.log +1112 -0
- data/test/interopR2/clientSOAP__Lite.rb +14 -0
- data/test/interopR2/clientSQLData.rb +18 -0
- data/test/interopR2/clientSQLData_Base.log +4857 -0
- data/test/interopR2/clientSQLData_GroupB.log +770 -0
- data/test/interopR2/clientSilverStream.rb +17 -0
- data/test/interopR2/clientSilverStream_Base.log +3171 -0
- data/test/interopR2/clientSpray2001.rb +17 -0
- data/test/interopR2/clientSpray2001_Base.log +8187 -0
- data/test/interopR2/clientSpray2001_GroupB.log +1408 -0
- data/test/interopR2/clientSun.rb +19 -0
- data/test/interopR2/clientSun_Base.log +4641 -0
- data/test/interopR2/clientSun_GroupB.log +856 -0
- data/test/interopR2/clientVWOpentalkSoap.rb +19 -0
- data/test/interopR2/clientVWOpentalkSoap_Base.log +5402 -0
- data/test/interopR2/clientVWOpentalkSoap_GroupB.log +972 -0
- data/test/interopR2/clientWASP.rb +19 -0
- data/test/interopR2/clientWASPC.rb +18 -0
- data/test/interopR2/clientWASPC_Base.log +4187 -0
- data/test/interopR2/clientWASPC_GroupB.log +763 -0
- data/test/interopR2/clientWASP_Base.log +5414 -0
- data/test/interopR2/clientWASP_GroupB.log +970 -0
- data/test/interopR2/clientWebMethods.rb +15 -0
- data/test/interopR2/clientWebMethods_Base.log +3075 -0
- data/test/interopR2/clientWebMethods_GroupB.log +483 -0
- data/test/interopR2/clientWhiteMesa.rb +28 -0
- data/test/interopR2/clientWhiteMesa_Base.log +4359 -0
- data/test/interopR2/clientWhiteMesa_GroupB.log +808 -0
- data/test/interopR2/clientWingfoot.rb +15 -0
- data/test/interopR2/clientWingfoot_Base.log +4445 -0
- data/test/interopR2/clientWingfoot_GroupB.log +848 -0
- data/test/interopR2/clientXMLBus.rb +19 -0
- data/test/interopR2/clientXMLBus_Base.log +3075 -0
- data/test/interopR2/clientXMLBus_GroupB.log +483 -0
- data/test/interopR2/clientXMLRPC-EPI.rb +17 -0
- data/test/interopR2/clientXSOAP.rb +14 -0
- data/test/interopR2/clientXSOAP_Base.log +4445 -0
- data/test/interopR2/clientZSI.rb +19 -0
- data/test/interopR2/clienteSOAP.rb +18 -0
- data/test/interopR2/clienteSOAP_Base.log +8728 -0
- data/test/interopR2/clientgSOAP.rb +18 -0
- data/test/interopR2/clientgSOAP_Base.log +4689 -0
- data/test/interopR2/clientgSOAP_GroupB.log +1014 -0
- data/test/interopR2/clientkSOAP.rb +17 -0
- data/test/interopR2/clientkSOAP_Base.log +5625 -0
- data/test/interopR2/iSimonReg.rb +112 -0
- data/test/interopR2/interopResultBase.rb +114 -0
- data/test/interopR2/interopService.rb +247 -0
- data/test/interopR2/result_client.NetRemoting.txt +4593 -0
- data/test/interopR2/rwikiInteropService.rb +105 -0
- data/test/interopR2/server.cgi +270 -0
- data/test/interopR2/server.rb +274 -0
- data/test/interopR2/simonReg.rb +123 -0
- data/test/interopR2/test.sh +49 -0
- data/test/interopR4/client.rb +112 -0
- data/test/runner.rb +9 -0
- data/test/sm11/classDef.rb +156 -0
- data/test/sm11/client.rb +542 -0
- data/test/sm11/driver.rb +183 -0
- data/test/sm11/servant.rb +1067 -0
- data/test/sm11/server.rb +25 -0
- data/test/soap/asp.net/hello.wsdl +96 -0
- data/test/soap/asp.net/test_aspdotnet.rb +112 -0
- data/test/soap/calc/calc.rb +17 -0
- data/test/soap/calc/calc2.rb +29 -0
- data/test/soap/calc/server.cgi +13 -0
- data/test/soap/calc/server.rb +17 -0
- data/test/soap/calc/server2.rb +20 -0
- data/test/soap/calc/test_calc.rb +49 -0
- data/test/soap/calc/test_calc2.rb +53 -0
- data/test/soap/calc/test_calc_cgi.rb +69 -0
- data/test/soap/fault/test_customfault.rb +58 -0
- data/test/soap/header/server.cgi +119 -0
- data/test/soap/header/test_authheader.rb +240 -0
- data/test/soap/header/test_authheader_cgi.rb +121 -0
- data/test/soap/header/test_simplehandler.rb +116 -0
- data/test/soap/helloworld/hw_s.rb +16 -0
- data/test/soap/helloworld/test_helloworld.rb +41 -0
- data/test/soap/literalArrayMapping/amazonEc.rb +4778 -0
- data/test/soap/literalArrayMapping/amazonEcDriver.rb +172 -0
- data/test/soap/literalArrayMapping/amazonresponse.xml +100 -0
- data/test/soap/literalArrayMapping/test_definedarray.rb +36 -0
- data/test/soap/marshal/marshaltestlib.rb +494 -0
- data/test/soap/marshal/test_digraph.rb +56 -0
- data/test/soap/marshal/test_marshal.rb +26 -0
- data/test/soap/marshal/test_struct.rb +47 -0
- data/test/soap/ssl/README +1 -0
- data/test/soap/ssl/ca.cert +23 -0
- data/test/soap/ssl/client.cert +19 -0
- data/test/soap/ssl/client.key +15 -0
- data/test/soap/ssl/server.cert +19 -0
- data/test/soap/ssl/server.key +15 -0
- data/test/soap/ssl/sslsvr.rb +57 -0
- data/test/soap/ssl/subca.cert +21 -0
- data/test/soap/ssl/test_ssl.rb +245 -0
- data/test/soap/struct/test_struct.rb +77 -0
- data/test/soap/styleuse/client.rb +20 -0
- data/test/soap/styleuse/server.rb +86 -0
- data/test/soap/swa/test_file.rb +73 -0
- data/test/soap/test_basetype.rb +976 -0
- data/test/soap/test_custommap.rb +108 -0
- data/test/soap/test_empty.rb +79 -0
- data/test/soap/test_envelopenamespace.rb +92 -0
- data/test/soap/test_httpconfigloader.rb +39 -0
- data/test/soap/test_mapping.rb +59 -0
- data/test/soap/test_no_indent.rb +86 -0
- data/test/soap/test_property.rb +424 -0
- data/test/soap/test_response_as_xml.rb +95 -0
- data/test/soap/test_soapelement.rb +120 -0
- data/test/soap/test_streamhandler.rb +262 -0
- data/test/soap/test_styleuse.rb +333 -0
- data/test/soap/wsdlDriver/README.txt +2 -0
- data/test/soap/wsdlDriver/calc.wsdl +126 -0
- data/test/soap/wsdlDriver/document.wsdl +54 -0
- data/test/soap/wsdlDriver/echo_version.rb +29 -0
- data/test/soap/wsdlDriver/simpletype.wsdl +63 -0
- data/test/soap/wsdlDriver/test_calc.rb +100 -0
- data/test/soap/wsdlDriver/test_document.rb +78 -0
- data/test/soap/wsdlDriver/test_simpletype.rb +87 -0
- data/test/wsdl/abstract/abstract.wsdl +97 -0
- data/test/wsdl/abstract/test_abstract.rb +130 -0
- data/test/wsdl/any/any.wsdl +51 -0
- data/test/wsdl/any/expectedDriver.rb +46 -0
- data/test/wsdl/any/expectedEcho.rb +18 -0
- data/test/wsdl/any/expectedService.rb +42 -0
- data/test/wsdl/any/test_any.rb +193 -0
- data/test/wsdl/axisArray/axisArray.wsdl +60 -0
- data/test/wsdl/axisArray/itemList.rb +14 -0
- data/test/wsdl/axisArray/test_axisarray.rb +69 -0
- data/test/wsdl/choice/choice.wsdl +91 -0
- data/test/wsdl/choice/test_choice.rb +134 -0
- data/test/wsdl/complexcontent/complexContent.wsdl +83 -0
- data/test/wsdl/complexcontent/test_echo.rb +101 -0
- data/test/wsdl/datetime/DatetimeService.rb +44 -0
- data/test/wsdl/datetime/datetime.rb +0 -0
- data/test/wsdl/datetime/datetime.wsdl +45 -0
- data/test/wsdl/datetime/datetimeServant.rb +21 -0
- data/test/wsdl/datetime/test_datetime.rb +82 -0
- data/test/wsdl/document/array/double.wsdl +72 -0
- data/test/wsdl/document/array/test_array.rb +117 -0
- data/test/wsdl/document/document.wsdl +74 -0
- data/test/wsdl/document/number.wsdl +54 -0
- data/test/wsdl/document/ping_nosoapaction.wsdl +66 -0
- data/test/wsdl/document/test_nosoapaction.rb +109 -0
- data/test/wsdl/document/test_number.rb +99 -0
- data/test/wsdl/document/test_rpc.rb +211 -0
- data/test/wsdl/emptycomplextype.wsdl +31 -0
- data/test/wsdl/list/list.wsdl +93 -0
- data/test/wsdl/list/test_list.rb +134 -0
- data/test/wsdl/map/map.wsdl +92 -0
- data/test/wsdl/map/map.xml +43 -0
- data/test/wsdl/map/test_map.rb +99 -0
- data/test/wsdl/marshal/person.wsdl +21 -0
- data/test/wsdl/marshal/person_org.rb +18 -0
- data/test/wsdl/marshal/test_wsdlmarshal.rb +79 -0
- data/test/wsdl/multiplefault.wsdl +68 -0
- data/test/wsdl/overload/overload.wsdl +80 -0
- data/test/wsdl/overload/test_overload.rb +118 -0
- data/test/wsdl/qualified/lp.wsdl +47 -0
- data/test/wsdl/qualified/lp.xsd +26 -0
- data/test/wsdl/qualified/np.wsdl +51 -0
- data/test/wsdl/qualified/test_qualified.rb +145 -0
- data/test/wsdl/qualified/test_unqualified.rb +159 -0
- data/test/wsdl/raa/RAA.rb +120 -0
- data/test/wsdl/raa/RAAServant.rb +107 -0
- data/test/wsdl/raa/RAAService.rb +120 -0
- data/test/wsdl/raa/README.txt +8 -0
- data/test/wsdl/raa/raa.wsdl +264 -0
- data/test/wsdl/raa/server.rb +103 -0
- data/test/wsdl/raa/test_raa.rb +91 -0
- data/test/wsdl/ref/expectedProduct.rb +158 -0
- data/test/wsdl/ref/product.wsdl +147 -0
- data/test/wsdl/ref/test_ref.rb +289 -0
- data/test/wsdl/rpc/rpc.wsdl +83 -0
- data/test/wsdl/rpc/test-rpc-lit.wsdl +364 -0
- data/test/wsdl/rpc/test_rpc.rb +173 -0
- data/test/wsdl/rpc/test_rpc_lit.rb +407 -0
- data/test/wsdl/simplecontent/simplecontent.wsdl +83 -0
- data/test/wsdl/simplecontent/test_simplecontent.rb +116 -0
- data/test/wsdl/simpletype/rpc/expectedClient.rb +34 -0
- data/test/wsdl/simpletype/rpc/expectedDriver.rb +55 -0
- data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +19 -0
- data/test/wsdl/simpletype/rpc/expectedServant.rb +32 -0
- data/test/wsdl/simpletype/rpc/expectedService.rb +51 -0
- data/test/wsdl/simpletype/rpc/rpc.wsdl +80 -0
- data/test/wsdl/simpletype/rpc/test_rpc.rb +62 -0
- data/test/wsdl/simpletype/simpletype.wsdl +95 -0
- data/test/wsdl/simpletype/test_simpletype.rb +99 -0
- data/test/wsdl/soap/soapbodyparts.wsdl +103 -0
- data/test/wsdl/soap/test_soapbodyparts.rb +79 -0
- data/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb +19 -0
- data/test/wsdl/soap/wsdl2ruby/expectedClient.rb +34 -0
- data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +55 -0
- data/test/wsdl/soap/wsdl2ruby/expectedServant.rb +32 -0
- data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +44 -0
- data/test/wsdl/soap/wsdl2ruby/expectedService.rb +51 -0
- data/test/wsdl/soap/wsdl2ruby/rpc.wsdl +80 -0
- data/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb +31 -0
- data/test/wsdl/soap/wsdl2ruby/section/section.xsd +31 -0
- data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +54 -0
- data/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl +64 -0
- data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +96 -0
- data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +79 -0
- data/test/wsdl/soaptype/soaptype.wsdl +61 -0
- data/test/wsdl/soaptype/test_soaptype.rb +160 -0
- data/test/wsdl/test_emptycomplextype.rb +21 -0
- data/test/wsdl/test_fault.rb +50 -0
- data/test/wsdl/test_multiplefault.rb +39 -0
- data/test/xsd/codegen/test_classdef.rb +214 -0
- data/test/xsd/noencoding.xml +4 -0
- data/test/xsd/test_noencoding.rb +32 -0
- data/test/xsd/test_ns.rb +20 -0
- data/test/xsd/test_xmlschemaparser.rb +22 -0
- data/test/xsd/test_xsd.rb +1523 -0
- data/test/xsd/xmllang.xml +43 -0
- data/test/xsd/xmlschema.xml +12 -0
- metadata +539 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'soap/rpc/httpserver'
|
3
|
+
require 'soap/rpc/driver'
|
4
|
+
|
5
|
+
|
6
|
+
module SOAP; module Struct
|
7
|
+
|
8
|
+
|
9
|
+
class TestStruct < Test::Unit::TestCase
|
10
|
+
Namespace = "urn:example.com:simpletype-rpc"
|
11
|
+
class Server < ::SOAP::RPC::HTTPServer
|
12
|
+
@@test_struct = ::Struct.new(:one, :two)
|
13
|
+
|
14
|
+
def on_init
|
15
|
+
add_method(self, 'a_method')
|
16
|
+
end
|
17
|
+
|
18
|
+
def a_method
|
19
|
+
@@test_struct.new("string", 1)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Port = 17171
|
24
|
+
|
25
|
+
def setup
|
26
|
+
setup_server
|
27
|
+
setup_client
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_server
|
31
|
+
@server = Server.new(
|
32
|
+
:Port => Port,
|
33
|
+
:BindAddress => "0.0.0.0",
|
34
|
+
:AccessLog => [],
|
35
|
+
:SOAPDefaultNamespace => Namespace
|
36
|
+
)
|
37
|
+
@server.level = Logger::Severity::ERROR
|
38
|
+
@server_thread = start_server_thread(@server)
|
39
|
+
end
|
40
|
+
|
41
|
+
def setup_client
|
42
|
+
@client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace)
|
43
|
+
@client.wiredump_dev = STDERR if $DEBUG
|
44
|
+
@client.add_method('a_method')
|
45
|
+
end
|
46
|
+
|
47
|
+
def teardown
|
48
|
+
teardown_server
|
49
|
+
teardown_client
|
50
|
+
end
|
51
|
+
|
52
|
+
def teardown_server
|
53
|
+
@server.shutdown
|
54
|
+
@server_thread.kill
|
55
|
+
@server_thread.join
|
56
|
+
end
|
57
|
+
|
58
|
+
def teardown_client
|
59
|
+
@client.reset_stream
|
60
|
+
end
|
61
|
+
|
62
|
+
def start_server_thread(server)
|
63
|
+
t = Thread.new {
|
64
|
+
Thread.current.abort_on_exception = true
|
65
|
+
server.start
|
66
|
+
}
|
67
|
+
t
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_struct
|
71
|
+
assert_equal("string", @client.a_method.one)
|
72
|
+
assert_equal(1, @client.a_method.two)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
end; end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'soap/rpc/driver'
|
2
|
+
|
3
|
+
server = 'http://localhost:7000/'
|
4
|
+
|
5
|
+
app = SOAP::RPC::Driver.new(server, 'urn:styleuse')
|
6
|
+
app.add_rpc_method('rpc_serv', 'obj1', 'obj2')
|
7
|
+
app.add_document_method('doc_serv', 'urn:doc_serv#doc_serv',
|
8
|
+
[XSD::QName.new('urn:styleuse', 'req')],
|
9
|
+
[XSD::QName.new('urn:styleuse', 'res')])
|
10
|
+
app.add_document_method('doc_serv2', 'urn:doc_serv#doc_serv2',
|
11
|
+
[XSD::QName.new('urn:styleuse', 'req')],
|
12
|
+
[XSD::QName.new('urn:styleuse', 'res')])
|
13
|
+
app.wiredump_dev = STDOUT
|
14
|
+
|
15
|
+
p app.rpc_serv(true, false)
|
16
|
+
p app.rpc_serv("foo", "bar")
|
17
|
+
p app.doc_serv({"a" => "2"})
|
18
|
+
p app.doc_serv({"a" => {"b" => "2"}})
|
19
|
+
p app.doc_serv2({"a" => "2"})
|
20
|
+
p app.doc_serv2({"a" => {"b" => "2"}})
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'soap/rpc/standaloneServer'
|
4
|
+
|
5
|
+
class Server < SOAP::RPC::StandaloneServer
|
6
|
+
class RpcServant
|
7
|
+
def rpc_serv(obj1, obj2)
|
8
|
+
[obj1, obj2]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class DocumentServant
|
13
|
+
def doc_serv(hash)
|
14
|
+
hash
|
15
|
+
end
|
16
|
+
|
17
|
+
def doc_serv2(hash)
|
18
|
+
{ 'newroot' => hash }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class GenericServant
|
23
|
+
|
24
|
+
# method name style: requeststyle_requestuse_responsestyle_responseuse
|
25
|
+
|
26
|
+
def rpc_enc_rpc_enc(obj1, obj2)
|
27
|
+
[obj1, obj2]
|
28
|
+
end
|
29
|
+
|
30
|
+
alias rpc_enc_rpc_lit rpc_enc_rpc_enc
|
31
|
+
|
32
|
+
def rpc_enc_doc_enc(obj1, obj2)
|
33
|
+
obj1
|
34
|
+
end
|
35
|
+
|
36
|
+
alias rpc_enc_doc_lit rpc_enc_doc_enc
|
37
|
+
|
38
|
+
def doc_enc_rpc_enc(obj)
|
39
|
+
[obj, obj]
|
40
|
+
end
|
41
|
+
|
42
|
+
alias doc_enc_rpc_lit doc_enc_rpc_enc
|
43
|
+
|
44
|
+
def doc_enc_doc_enc(obj)
|
45
|
+
obj
|
46
|
+
end
|
47
|
+
|
48
|
+
alias doc_enc_doc_lit doc_enc_doc_enc
|
49
|
+
end
|
50
|
+
|
51
|
+
def initialize(*arg)
|
52
|
+
super
|
53
|
+
rpcservant = RpcServant.new
|
54
|
+
docservant = DocumentServant.new
|
55
|
+
add_rpc_servant(rpcservant)
|
56
|
+
add_document_method(docservant, 'urn:doc_serv#doc_serv', 'doc_serv',
|
57
|
+
[XSD::QName.new('urn:styleuse', 'req')],
|
58
|
+
[XSD::QName.new('urn:styleuse', 'res')])
|
59
|
+
add_document_method(docservant, 'urn:doc_serv#doc_serv2', 'doc_serv2',
|
60
|
+
[XSD::QName.new('urn:styleuse', 'req')],
|
61
|
+
[XSD::QName.new('urn:styleuse', 'res')])
|
62
|
+
|
63
|
+
#servant = Servant.new
|
64
|
+
# ToDo: too plain: should add bare test case
|
65
|
+
#qname ||= XSD::QName.new(@default_namespace, name)
|
66
|
+
#add_operation(qname, nil, servant, "rpc_enc_rpc_enc", param_def,
|
67
|
+
# opt(:rpc, :rpc, :encoded, :encoded))
|
68
|
+
end
|
69
|
+
|
70
|
+
def opt(request_style, request_use, response_style, response_use)
|
71
|
+
{
|
72
|
+
:request_style => request_style,
|
73
|
+
:request_use => request_use,
|
74
|
+
:response_style => response_style,
|
75
|
+
:response_use => response_use
|
76
|
+
}
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if $0 == __FILE__
|
81
|
+
server = Server.new('Server', 'urn:styleuse', '0.0.0.0', 7000)
|
82
|
+
trap(:INT) do
|
83
|
+
server.shutdown
|
84
|
+
end
|
85
|
+
server.start
|
86
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'soap/rpc/driver'
|
3
|
+
require 'soap/rpc/standaloneServer'
|
4
|
+
require 'soap/attachment'
|
5
|
+
|
6
|
+
|
7
|
+
module SOAP
|
8
|
+
module SWA
|
9
|
+
|
10
|
+
|
11
|
+
class TestFile < Test::Unit::TestCase
|
12
|
+
Port = 17171
|
13
|
+
THIS_FILE = File.expand_path(__FILE__)
|
14
|
+
|
15
|
+
class SwAService
|
16
|
+
def get_file
|
17
|
+
return {
|
18
|
+
'name' => $0,
|
19
|
+
'file' => SOAP::Attachment.new(File.open(THIS_FILE)) # closed when GCed.
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def put_file(name, file)
|
24
|
+
"File '#{name}' was received ok."
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def setup
|
29
|
+
@server = SOAP::RPC::StandaloneServer.new('SwAServer',
|
30
|
+
'http://www.acmetron.com/soap', '0.0.0.0', Port)
|
31
|
+
@server.add_servant(SwAService.new)
|
32
|
+
@server.level = Logger::Severity::ERROR
|
33
|
+
@t = Thread.new {
|
34
|
+
@server.start
|
35
|
+
}
|
36
|
+
@endpoint = "http://localhost:#{Port}/"
|
37
|
+
@client = SOAP::RPC::Driver.new(@endpoint, 'http://www.acmetron.com/soap')
|
38
|
+
@client.add_method('get_file')
|
39
|
+
@client.add_method('put_file', 'name', 'file')
|
40
|
+
@client.wiredump_dev = STDERR if $DEBUG
|
41
|
+
end
|
42
|
+
|
43
|
+
def teardown
|
44
|
+
@server.shutdown
|
45
|
+
@t.kill
|
46
|
+
@t.join
|
47
|
+
@client.reset_stream
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_get_file
|
51
|
+
assert_equal(
|
52
|
+
File.open(THIS_FILE) { |f| f.read },
|
53
|
+
@client.get_file['file'].content
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_put_file
|
58
|
+
assert_equal(
|
59
|
+
"File 'foo' was received ok.",
|
60
|
+
@client.put_file('foo',
|
61
|
+
SOAP::Attachment.new(File.open(THIS_FILE)))
|
62
|
+
)
|
63
|
+
assert_equal(
|
64
|
+
"File 'bar' was received ok.",
|
65
|
+
@client.put_file('bar',
|
66
|
+
SOAP::Attachment.new(File.open(THIS_FILE) { |f| f.read }))
|
67
|
+
)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,976 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'soap/baseData'
|
3
|
+
|
4
|
+
|
5
|
+
module SOAP
|
6
|
+
|
7
|
+
|
8
|
+
class TestSOAP < Test::Unit::TestCase
|
9
|
+
NegativeZero = (-1.0 / (1.0 / 0.0))
|
10
|
+
|
11
|
+
def setup
|
12
|
+
# Nothing to do.
|
13
|
+
end
|
14
|
+
|
15
|
+
def teardown
|
16
|
+
# Nothing to do.
|
17
|
+
end
|
18
|
+
|
19
|
+
def assert_parsed_result(klass, str)
|
20
|
+
o = klass.new(str)
|
21
|
+
assert_equal(str, o.to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_SOAPNil
|
25
|
+
o = SOAP::SOAPNil.new
|
26
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
27
|
+
assert_equal(XSD::NilLiteral, o.type.name)
|
28
|
+
assert_equal(nil, o.data)
|
29
|
+
assert_equal(true, o.is_nil)
|
30
|
+
|
31
|
+
o = SOAP::SOAPNil.new(nil)
|
32
|
+
assert_equal(true, o.is_nil)
|
33
|
+
assert_equal(nil, o.data)
|
34
|
+
assert_equal("", o.to_s)
|
35
|
+
o = SOAP::SOAPNil.new('var')
|
36
|
+
assert_equal(false, o.is_nil)
|
37
|
+
assert_equal('var', o.data)
|
38
|
+
assert_equal('var', o.to_s)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_SOAPString
|
42
|
+
o = SOAP::SOAPString.new
|
43
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
44
|
+
assert_equal(XSD::StringLiteral, o.type.name)
|
45
|
+
assert_equal(nil, o.data)
|
46
|
+
assert_equal(true, o.is_nil)
|
47
|
+
|
48
|
+
str = "abc"
|
49
|
+
assert_equal(str, SOAP::SOAPString.new(str).data)
|
50
|
+
assert_equal(str, SOAP::SOAPString.new(str).to_s)
|
51
|
+
back = XSD::XSDString.strict_ces_validation
|
52
|
+
XSD::XSDString.strict_ces_validation = true
|
53
|
+
begin
|
54
|
+
assert_raises(XSD::ValueSpaceError) do
|
55
|
+
SOAP::SOAPString.new("\0")
|
56
|
+
end
|
57
|
+
assert_raises(XSD::ValueSpaceError) do
|
58
|
+
SOAP::SOAPString.new("\xC0\xC0").to_s
|
59
|
+
end
|
60
|
+
ensure
|
61
|
+
XSD::XSDString.strict_ces_validation = back
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_SOAPBoolean
|
66
|
+
o = SOAP::SOAPBoolean.new
|
67
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
68
|
+
assert_equal(XSD::BooleanLiteral, o.type.name)
|
69
|
+
assert_equal(nil, o.data)
|
70
|
+
assert_equal(true, o.is_nil)
|
71
|
+
|
72
|
+
targets = [
|
73
|
+
["true", true],
|
74
|
+
["1", true],
|
75
|
+
["false", false],
|
76
|
+
["0", false],
|
77
|
+
]
|
78
|
+
targets.each do |data, expected|
|
79
|
+
assert_equal(expected, SOAP::SOAPBoolean.new(data).data)
|
80
|
+
assert_equal(expected.to_s, SOAP::SOAPBoolean.new(data).to_s)
|
81
|
+
end
|
82
|
+
|
83
|
+
assert_raises(XSD::ValueSpaceError) do
|
84
|
+
SOAP::SOAPBoolean.new("nil").to_s
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_SOAPDecimal
|
89
|
+
o = SOAP::SOAPDecimal.new
|
90
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
91
|
+
assert_equal(XSD::DecimalLiteral, o.type.name)
|
92
|
+
assert_equal(nil, o.data)
|
93
|
+
assert_equal(true, o.is_nil)
|
94
|
+
|
95
|
+
targets = [
|
96
|
+
0,
|
97
|
+
1000000000,
|
98
|
+
-9999999999,
|
99
|
+
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
|
100
|
+
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
|
101
|
+
-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
|
102
|
+
]
|
103
|
+
targets.each do |dec|
|
104
|
+
assert_equal(dec.to_s, SOAP::SOAPDecimal.new(dec).data)
|
105
|
+
end
|
106
|
+
|
107
|
+
targets = [
|
108
|
+
"0",
|
109
|
+
"0.00000001",
|
110
|
+
"1000000000",
|
111
|
+
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
112
|
+
"-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
|
113
|
+
]
|
114
|
+
targets.each do |str|
|
115
|
+
assert_equal(str, SOAP::SOAPDecimal.new(str).to_s)
|
116
|
+
end
|
117
|
+
|
118
|
+
targets = [
|
119
|
+
["-0", "0"],
|
120
|
+
["+0", "0"],
|
121
|
+
["0.0", "0"],
|
122
|
+
["-0.0", "0"],
|
123
|
+
["+0.0", "0"],
|
124
|
+
["0.", "0"],
|
125
|
+
[".0", "0"],
|
126
|
+
[
|
127
|
+
"+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
128
|
+
"0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
|
129
|
+
],
|
130
|
+
[
|
131
|
+
".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
132
|
+
"0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
|
133
|
+
],
|
134
|
+
[
|
135
|
+
"-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
|
136
|
+
"-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
|
137
|
+
],
|
138
|
+
]
|
139
|
+
targets.each do |data, expected|
|
140
|
+
assert_equal(expected, SOAP::SOAPDecimal.new(data).to_s)
|
141
|
+
end
|
142
|
+
|
143
|
+
targets = [
|
144
|
+
"0.000000000000a",
|
145
|
+
"00a.0000000000001",
|
146
|
+
"+-5",
|
147
|
+
]
|
148
|
+
targets.each do |d|
|
149
|
+
assert_raises(XSD::ValueSpaceError) do
|
150
|
+
SOAP::SOAPDecimal.new(d)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_SOAPFloat
|
156
|
+
o = SOAP::SOAPFloat.new
|
157
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
158
|
+
assert_equal(XSD::FloatLiteral, o.type.name)
|
159
|
+
assert_equal(nil, o.data)
|
160
|
+
assert_equal(true, o.is_nil)
|
161
|
+
|
162
|
+
targets = [
|
163
|
+
3.14159265358979,
|
164
|
+
12.34e36,
|
165
|
+
1.402e-45,
|
166
|
+
-1.402e-45,
|
167
|
+
]
|
168
|
+
targets.each do |f|
|
169
|
+
assert_equal(f, SOAP::SOAPFloat.new(f).data)
|
170
|
+
end
|
171
|
+
|
172
|
+
targets = [
|
173
|
+
"+3.141592654",
|
174
|
+
"+1.234e+37",
|
175
|
+
"+1.402e-45",
|
176
|
+
"-1.402e-45",
|
177
|
+
]
|
178
|
+
targets.each do |f|
|
179
|
+
assert_equal(f, SOAP::SOAPFloat.new(f).to_s)
|
180
|
+
end
|
181
|
+
|
182
|
+
targets = [
|
183
|
+
[3, "+3"], # should be 3.0?
|
184
|
+
[-2, "-2"], # ditto
|
185
|
+
[3.14159265358979, "+3.141592654"],
|
186
|
+
[12.34e36, "+1.234e+37"],
|
187
|
+
[1.402e-45, "+1.402e-45"],
|
188
|
+
[-1.402e-45, "-1.402e-45"],
|
189
|
+
["1.402e", "+1.402"],
|
190
|
+
["12.34E36", "+1.234e+37"],
|
191
|
+
["1.402E-45", "+1.402e-45"],
|
192
|
+
["-1.402E-45", "-1.402e-45"],
|
193
|
+
["1.402E", "+1.402"],
|
194
|
+
]
|
195
|
+
targets.each do |f, str|
|
196
|
+
assert_equal(str, SOAP::SOAPFloat.new(f).to_s)
|
197
|
+
end
|
198
|
+
|
199
|
+
assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
|
200
|
+
assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
|
201
|
+
assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?)
|
202
|
+
assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s)
|
203
|
+
assert_equal(1, SOAP::SOAPFloat.new(1.0/0.0).data.infinite?)
|
204
|
+
assert_equal("-INF", SOAP::SOAPFloat.new(-1.0/0.0).to_s)
|
205
|
+
assert_equal(-1, SOAP::SOAPFloat.new(-1.0/0.0).data.infinite?)
|
206
|
+
|
207
|
+
targets = [
|
208
|
+
"0.000000000000a",
|
209
|
+
"00a.0000000000001",
|
210
|
+
"+-5",
|
211
|
+
"5_0",
|
212
|
+
]
|
213
|
+
targets.each do |d|
|
214
|
+
assert_raises(XSD::ValueSpaceError) do
|
215
|
+
SOAP::SOAPFloat.new(d)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
def test_SOAPDouble
|
221
|
+
o = SOAP::SOAPDouble.new
|
222
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
223
|
+
assert_equal(XSD::DoubleLiteral, o.type.name)
|
224
|
+
assert_equal(nil, o.data)
|
225
|
+
assert_equal(true, o.is_nil)
|
226
|
+
|
227
|
+
targets = [
|
228
|
+
3.14159265358979,
|
229
|
+
12.34e36,
|
230
|
+
1.402e-45,
|
231
|
+
-1.402e-45,
|
232
|
+
]
|
233
|
+
targets.each do |f|
|
234
|
+
assert_equal(f, SOAP::SOAPDouble.new(f).data)
|
235
|
+
end
|
236
|
+
|
237
|
+
targets = [
|
238
|
+
"+3.14159265358979",
|
239
|
+
"+1.234e+37",
|
240
|
+
"+1.402e-45",
|
241
|
+
"-1.402e-45",
|
242
|
+
]
|
243
|
+
targets.each do |f|
|
244
|
+
assert_equal(f, SOAP::SOAPDouble.new(f).to_s)
|
245
|
+
end
|
246
|
+
|
247
|
+
targets = [
|
248
|
+
[3, "+3"], # should be 3.0?
|
249
|
+
[-2, "-2"], # ditto.
|
250
|
+
[3.14159265358979, "+3.14159265358979"],
|
251
|
+
[12.34e36, "+1.234e+37"],
|
252
|
+
[1.402e-45, "+1.402e-45"],
|
253
|
+
[-1.402e-45, "-1.402e-45"],
|
254
|
+
["1.402e", "+1.402"],
|
255
|
+
["12.34E36", "+1.234e+37"],
|
256
|
+
["1.402E-45", "+1.402e-45"],
|
257
|
+
["-1.402E-45", "-1.402e-45"],
|
258
|
+
["1.402E", "+1.402"],
|
259
|
+
]
|
260
|
+
targets.each do |f, str|
|
261
|
+
assert_equal(str, SOAP::SOAPDouble.new(f).to_s)
|
262
|
+
end
|
263
|
+
|
264
|
+
assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
|
265
|
+
assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
|
266
|
+
assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s)
|
267
|
+
assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?)
|
268
|
+
assert_equal("INF", SOAP::SOAPDouble.new(1.0/0.0).to_s)
|
269
|
+
assert_equal(1, SOAP::SOAPDouble.new(1.0/0.0).data.infinite?)
|
270
|
+
assert_equal("-INF", SOAP::SOAPDouble.new(-1.0/0.0).to_s)
|
271
|
+
assert_equal(-1, SOAP::SOAPDouble.new(-1.0/0.0).data.infinite?)
|
272
|
+
|
273
|
+
targets = [
|
274
|
+
"0.000000000000a",
|
275
|
+
"00a.0000000000001",
|
276
|
+
"+-5",
|
277
|
+
]
|
278
|
+
targets.each do |d|
|
279
|
+
assert_raises(XSD::ValueSpaceError) do
|
280
|
+
SOAP::SOAPDouble.new(d)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
def test_SOAPDuration
|
286
|
+
o = SOAP::SOAPDuration.new
|
287
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
288
|
+
assert_equal(XSD::DurationLiteral, o.type.name)
|
289
|
+
assert_equal(nil, o.data)
|
290
|
+
assert_equal(true, o.is_nil)
|
291
|
+
|
292
|
+
targets = [
|
293
|
+
"P1Y2M3DT4H5M6S",
|
294
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S",
|
295
|
+
"P0DT3456H7890M1234.5678S",
|
296
|
+
"P1234Y5678M9012D",
|
297
|
+
"-P1234Y5678M9012DT3456H7890M1234.5678S",
|
298
|
+
"P5678M9012DT3456H7890M1234.5678S",
|
299
|
+
"-P1234Y9012DT3456H7890M1234.5678S",
|
300
|
+
"+P1234Y5678MT3456H7890M1234.5678S",
|
301
|
+
"P1234Y5678M9012DT7890M1234.5678S",
|
302
|
+
"-P1234Y5678M9012DT3456H1234.5678S",
|
303
|
+
"+P1234Y5678M9012DT3456H7890M",
|
304
|
+
"P123400000000000Y",
|
305
|
+
"-P567800000000000M",
|
306
|
+
"+P901200000000000D",
|
307
|
+
"P0DT345600000000000H",
|
308
|
+
"-P0DT789000000000000M",
|
309
|
+
"+P0DT123400000000000.000000000005678S",
|
310
|
+
"P1234YT1234.5678S",
|
311
|
+
"-P5678MT7890M",
|
312
|
+
"+P9012DT3456H",
|
313
|
+
]
|
314
|
+
targets.each do |str|
|
315
|
+
assert_parsed_result(SOAP::SOAPDuration, str)
|
316
|
+
end
|
317
|
+
|
318
|
+
targets = [
|
319
|
+
["P0Y0M0DT0H0M0S",
|
320
|
+
"P0D"],
|
321
|
+
["-P0DT0S",
|
322
|
+
"-P0D"],
|
323
|
+
["P01234Y5678M9012DT3456H7890M1234.5678S",
|
324
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
325
|
+
["P1234Y005678M9012DT3456H7890M1234.5678S",
|
326
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
327
|
+
["P1234Y5678M0009012DT3456H7890M1234.5678S",
|
328
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
329
|
+
["P1234Y5678M9012DT00003456H7890M1234.5678S",
|
330
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
331
|
+
["P1234Y5678M9012DT3456H000007890M1234.5678S",
|
332
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
333
|
+
["P1234Y5678M9012DT3456H7890M0000001234.5678S",
|
334
|
+
"P1234Y5678M9012DT3456H7890M1234.5678S"],
|
335
|
+
]
|
336
|
+
targets.each do |data, expected|
|
337
|
+
assert_equal(expected, SOAP::SOAPDuration.new(data).to_s)
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
def test_SOAPDateTime
|
342
|
+
o = SOAP::SOAPDateTime.new
|
343
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
344
|
+
assert_equal(XSD::DateTimeLiteral, o.type.name)
|
345
|
+
assert_equal(nil, o.data)
|
346
|
+
assert_equal(true, o.is_nil)
|
347
|
+
|
348
|
+
targets = [
|
349
|
+
"2002-05-18T16:52:20Z",
|
350
|
+
"0001-01-01T00:00:00Z",
|
351
|
+
"9999-12-31T23:59:59Z",
|
352
|
+
"19999-12-31T23:59:59Z",
|
353
|
+
"2002-12-31T23:59:59.999Z",
|
354
|
+
"2002-12-31T23:59:59.001Z",
|
355
|
+
"2002-12-31T23:59:59.99999999999999999999Z",
|
356
|
+
"2002-12-31T23:59:59.00000000000000000001Z",
|
357
|
+
"2002-12-31T23:59:59+09:00",
|
358
|
+
"2002-12-31T23:59:59+00:01",
|
359
|
+
"2002-12-31T23:59:59-00:01",
|
360
|
+
"2002-12-31T23:59:59-23:59",
|
361
|
+
"2002-12-31T23:59:59.00000000000000000001+13:30",
|
362
|
+
"2002-12-31T23:59:59.51375Z",
|
363
|
+
"2002-12-31T23:59:59.51345+12:34",
|
364
|
+
"-2002-05-18T16:52:20Z",
|
365
|
+
"-4711-12-31T23:59:59Z",
|
366
|
+
"-4713-01-01T12:00:00Z",
|
367
|
+
"-19999-12-31T23:59:59Z",
|
368
|
+
"-2002-12-31T23:59:59+00:01",
|
369
|
+
"-0001-12-31T23:59:59.00000000000000000001+13:30",
|
370
|
+
]
|
371
|
+
targets.each do |str|
|
372
|
+
assert_parsed_result(SOAP::SOAPDateTime, str)
|
373
|
+
end
|
374
|
+
|
375
|
+
targets = [
|
376
|
+
["2002-12-31T23:59:59.00",
|
377
|
+
"2002-12-31T23:59:59Z"],
|
378
|
+
["2002-12-31T23:59:59+00:00",
|
379
|
+
"2002-12-31T23:59:59Z"],
|
380
|
+
["2002-12-31T23:59:59-00:00",
|
381
|
+
"2002-12-31T23:59:59Z"],
|
382
|
+
["-2002-12-31T23:59:59.00",
|
383
|
+
"-2002-12-31T23:59:59Z"],
|
384
|
+
["-2002-12-31T23:59:59+00:00",
|
385
|
+
"-2002-12-31T23:59:59Z"],
|
386
|
+
["-2002-12-31T23:59:59-00:00",
|
387
|
+
"-2002-12-31T23:59:59Z"],
|
388
|
+
]
|
389
|
+
targets.each do |data, expected|
|
390
|
+
assert_equal(expected, SOAP::SOAPDateTime.new(data).to_s)
|
391
|
+
d = DateTime.parse(data)
|
392
|
+
d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
|
393
|
+
assert_equal(expected, SOAP::SOAPDateTime.new(d).to_s)
|
394
|
+
end
|
395
|
+
|
396
|
+
targets = [
|
397
|
+
"1-05-18T16:52:20Z",
|
398
|
+
"05-18T16:52:20Z",
|
399
|
+
"2002-05T16:52:20Z",
|
400
|
+
"2002-05-18T16:52Z",
|
401
|
+
"",
|
402
|
+
]
|
403
|
+
targets.each do |d|
|
404
|
+
assert_raises(XSD::ValueSpaceError, d.to_s) do
|
405
|
+
SOAP::SOAPDateTime.new(d)
|
406
|
+
end
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
def test_SOAPTime
|
411
|
+
o = SOAP::SOAPTime.new
|
412
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
413
|
+
assert_equal(XSD::TimeLiteral, o.type.name)
|
414
|
+
assert_equal(nil, o.data)
|
415
|
+
assert_equal(true, o.is_nil)
|
416
|
+
|
417
|
+
targets = [
|
418
|
+
"16:52:20Z",
|
419
|
+
"00:00:00Z",
|
420
|
+
"23:59:59Z",
|
421
|
+
"23:59:59.999Z",
|
422
|
+
"23:59:59.001Z",
|
423
|
+
"23:59:59.99999999999999999999Z",
|
424
|
+
"23:59:59.00000000000000000001Z",
|
425
|
+
"23:59:59+09:00",
|
426
|
+
"23:59:59+00:01",
|
427
|
+
"23:59:59-00:01",
|
428
|
+
"23:59:59-23:59",
|
429
|
+
"23:59:59.00000000000000000001+13:30",
|
430
|
+
"23:59:59.51375Z",
|
431
|
+
"23:59:59.51375+12:34",
|
432
|
+
"23:59:59+00:01",
|
433
|
+
]
|
434
|
+
targets.each do |str|
|
435
|
+
assert_parsed_result(SOAP::SOAPTime, str)
|
436
|
+
end
|
437
|
+
|
438
|
+
targets = [
|
439
|
+
["23:59:59.00",
|
440
|
+
"23:59:59Z"],
|
441
|
+
["23:59:59+00:00",
|
442
|
+
"23:59:59Z"],
|
443
|
+
["23:59:59-00:00",
|
444
|
+
"23:59:59Z"],
|
445
|
+
]
|
446
|
+
targets.each do |data, expected|
|
447
|
+
assert_equal(expected, SOAP::SOAPTime.new(data).to_s)
|
448
|
+
end
|
449
|
+
end
|
450
|
+
|
451
|
+
def test_SOAPDate
|
452
|
+
o = SOAP::SOAPDate.new
|
453
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
454
|
+
assert_equal(XSD::DateLiteral, o.type.name)
|
455
|
+
assert_equal(nil, o.data)
|
456
|
+
assert_equal(true, o.is_nil)
|
457
|
+
|
458
|
+
targets = [
|
459
|
+
"2002-05-18Z",
|
460
|
+
"0001-01-01Z",
|
461
|
+
"9999-12-31Z",
|
462
|
+
"19999-12-31Z",
|
463
|
+
"2002-12-31+09:00",
|
464
|
+
"2002-12-31+00:01",
|
465
|
+
"2002-12-31-00:01",
|
466
|
+
"2002-12-31-23:59",
|
467
|
+
"2002-12-31+13:30",
|
468
|
+
"-2002-05-18Z",
|
469
|
+
"-19999-12-31Z",
|
470
|
+
"-2002-12-31+00:01",
|
471
|
+
"-0001-12-31+13:30",
|
472
|
+
]
|
473
|
+
targets.each do |str|
|
474
|
+
assert_parsed_result(SOAP::SOAPDate, str)
|
475
|
+
end
|
476
|
+
|
477
|
+
targets = [
|
478
|
+
["2002-12-31",
|
479
|
+
"2002-12-31Z"],
|
480
|
+
["2002-12-31+00:00",
|
481
|
+
"2002-12-31Z"],
|
482
|
+
["2002-12-31-00:00",
|
483
|
+
"2002-12-31Z"],
|
484
|
+
["-2002-12-31",
|
485
|
+
"-2002-12-31Z"],
|
486
|
+
["-2002-12-31+00:00",
|
487
|
+
"-2002-12-31Z"],
|
488
|
+
["-2002-12-31-00:00",
|
489
|
+
"-2002-12-31Z"],
|
490
|
+
]
|
491
|
+
targets.each do |data, expected|
|
492
|
+
assert_equal(expected, SOAP::SOAPDate.new(data).to_s)
|
493
|
+
d = Date.parse(data)
|
494
|
+
d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
|
495
|
+
assert_equal(expected, SOAP::SOAPDate.new(d).to_s)
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
def test_SOAPGYearMonth
|
500
|
+
o = SOAP::SOAPGYearMonth.new
|
501
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
502
|
+
assert_equal(XSD::GYearMonthLiteral, o.type.name)
|
503
|
+
assert_equal(nil, o.data)
|
504
|
+
assert_equal(true, o.is_nil)
|
505
|
+
|
506
|
+
targets = [
|
507
|
+
"2002-05Z",
|
508
|
+
"0001-01Z",
|
509
|
+
"9999-12Z",
|
510
|
+
"19999-12Z",
|
511
|
+
"2002-12+09:00",
|
512
|
+
"2002-12+00:01",
|
513
|
+
"2002-12-00:01",
|
514
|
+
"2002-12-23:59",
|
515
|
+
"2002-12+13:30",
|
516
|
+
"-2002-05Z",
|
517
|
+
"-19999-12Z",
|
518
|
+
"-2002-12+00:01",
|
519
|
+
"-0001-12+13:30",
|
520
|
+
]
|
521
|
+
targets.each do |str|
|
522
|
+
assert_parsed_result(SOAP::SOAPGYearMonth, str)
|
523
|
+
end
|
524
|
+
|
525
|
+
targets = [
|
526
|
+
["2002-12",
|
527
|
+
"2002-12Z"],
|
528
|
+
["2002-12+00:00",
|
529
|
+
"2002-12Z"],
|
530
|
+
["2002-12-00:00",
|
531
|
+
"2002-12Z"],
|
532
|
+
["-2002-12",
|
533
|
+
"-2002-12Z"],
|
534
|
+
["-2002-12+00:00",
|
535
|
+
"-2002-12Z"],
|
536
|
+
["-2002-12-00:00",
|
537
|
+
"-2002-12Z"],
|
538
|
+
]
|
539
|
+
targets.each do |data, expected|
|
540
|
+
assert_equal(expected, SOAP::SOAPGYearMonth.new(data).to_s)
|
541
|
+
end
|
542
|
+
end
|
543
|
+
|
544
|
+
def test_SOAPGYear
|
545
|
+
o = SOAP::SOAPGYear.new
|
546
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
547
|
+
assert_equal(XSD::GYearLiteral, o.type.name)
|
548
|
+
assert_equal(nil, o.data)
|
549
|
+
assert_equal(true, o.is_nil)
|
550
|
+
|
551
|
+
targets = [
|
552
|
+
"2002Z",
|
553
|
+
"0001Z",
|
554
|
+
"9999Z",
|
555
|
+
"19999Z",
|
556
|
+
"2002+09:00",
|
557
|
+
"2002+00:01",
|
558
|
+
"2002-00:01",
|
559
|
+
"2002-23:59",
|
560
|
+
"2002+13:30",
|
561
|
+
"-2002Z",
|
562
|
+
"-19999Z",
|
563
|
+
"-2002+00:01",
|
564
|
+
"-0001+13:30",
|
565
|
+
]
|
566
|
+
targets.each do |str|
|
567
|
+
assert_parsed_result(SOAP::SOAPGYear, str)
|
568
|
+
end
|
569
|
+
|
570
|
+
targets = [
|
571
|
+
["2002",
|
572
|
+
"2002Z"],
|
573
|
+
["2002+00:00",
|
574
|
+
"2002Z"],
|
575
|
+
["2002-00:00",
|
576
|
+
"2002Z"],
|
577
|
+
["-2002",
|
578
|
+
"-2002Z"],
|
579
|
+
["-2002+00:00",
|
580
|
+
"-2002Z"],
|
581
|
+
["-2002-00:00",
|
582
|
+
"-2002Z"],
|
583
|
+
]
|
584
|
+
targets.each do |data, expected|
|
585
|
+
assert_equal(expected, SOAP::SOAPGYear.new(data).to_s)
|
586
|
+
end
|
587
|
+
end
|
588
|
+
|
589
|
+
def test_SOAPGMonthDay
|
590
|
+
o = SOAP::SOAPGMonthDay.new
|
591
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
592
|
+
assert_equal(XSD::GMonthDayLiteral, o.type.name)
|
593
|
+
assert_equal(nil, o.data)
|
594
|
+
assert_equal(true, o.is_nil)
|
595
|
+
|
596
|
+
targets = [
|
597
|
+
"05-18Z",
|
598
|
+
"01-01Z",
|
599
|
+
"12-31Z",
|
600
|
+
"12-31+09:00",
|
601
|
+
"12-31+00:01",
|
602
|
+
"12-31-00:01",
|
603
|
+
"12-31-23:59",
|
604
|
+
"12-31+13:30",
|
605
|
+
]
|
606
|
+
targets.each do |str|
|
607
|
+
assert_parsed_result(SOAP::SOAPGMonthDay, str)
|
608
|
+
end
|
609
|
+
|
610
|
+
targets = [
|
611
|
+
["12-31",
|
612
|
+
"12-31Z"],
|
613
|
+
["12-31+00:00",
|
614
|
+
"12-31Z"],
|
615
|
+
["12-31-00:00",
|
616
|
+
"12-31Z"],
|
617
|
+
]
|
618
|
+
targets.each do |data, expected|
|
619
|
+
assert_equal(expected, SOAP::SOAPGMonthDay.new(data).to_s)
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
def test_SOAPGDay
|
624
|
+
o = SOAP::SOAPGDay.new
|
625
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
626
|
+
assert_equal(XSD::GDayLiteral, o.type.name)
|
627
|
+
assert_equal(nil, o.data)
|
628
|
+
assert_equal(true, o.is_nil)
|
629
|
+
|
630
|
+
targets = [
|
631
|
+
"18Z",
|
632
|
+
"01Z",
|
633
|
+
"31Z",
|
634
|
+
"31+09:00",
|
635
|
+
"31+00:01",
|
636
|
+
"31-00:01",
|
637
|
+
"31-23:59",
|
638
|
+
"31+13:30",
|
639
|
+
]
|
640
|
+
targets.each do |str|
|
641
|
+
assert_parsed_result(SOAP::SOAPGDay, str)
|
642
|
+
end
|
643
|
+
|
644
|
+
targets = [
|
645
|
+
["31",
|
646
|
+
"31Z"],
|
647
|
+
["31+00:00",
|
648
|
+
"31Z"],
|
649
|
+
["31-00:00",
|
650
|
+
"31Z"],
|
651
|
+
]
|
652
|
+
targets.each do |data, expected|
|
653
|
+
assert_equal(expected, SOAP::SOAPGDay.new(data).to_s)
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
def test_SOAPGMonth
|
658
|
+
o = SOAP::SOAPGMonth.new
|
659
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
660
|
+
assert_equal(XSD::GMonthLiteral, o.type.name)
|
661
|
+
assert_equal(nil, o.data)
|
662
|
+
assert_equal(true, o.is_nil)
|
663
|
+
|
664
|
+
targets = [
|
665
|
+
"05Z",
|
666
|
+
"01Z",
|
667
|
+
"12Z",
|
668
|
+
"12+09:00",
|
669
|
+
"12+00:01",
|
670
|
+
"12-00:01",
|
671
|
+
"12-23:59",
|
672
|
+
"12+13:30",
|
673
|
+
]
|
674
|
+
targets.each do |str|
|
675
|
+
assert_parsed_result(SOAP::SOAPGMonth, str)
|
676
|
+
end
|
677
|
+
|
678
|
+
targets = [
|
679
|
+
["12",
|
680
|
+
"12Z"],
|
681
|
+
["12+00:00",
|
682
|
+
"12Z"],
|
683
|
+
["12-00:00",
|
684
|
+
"12Z"],
|
685
|
+
]
|
686
|
+
targets.each do |data, expected|
|
687
|
+
assert_equal(expected, SOAP::SOAPGMonth.new(data).to_s)
|
688
|
+
end
|
689
|
+
end
|
690
|
+
|
691
|
+
def test_SOAPHexBinary
|
692
|
+
o = SOAP::SOAPHexBinary.new
|
693
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
694
|
+
assert_equal(XSD::HexBinaryLiteral, o.type.name)
|
695
|
+
assert_equal(nil, o.data)
|
696
|
+
assert_equal(true, o.is_nil)
|
697
|
+
|
698
|
+
targets = [
|
699
|
+
"abcdef",
|
700
|
+
"\xe3\x81\xaa\xe3\x81\xb2",
|
701
|
+
"\0",
|
702
|
+
"",
|
703
|
+
]
|
704
|
+
targets.each do |str|
|
705
|
+
assert_equal(str, SOAP::SOAPHexBinary.new(str).string)
|
706
|
+
assert_equal(str.unpack("H*")[0].tr('a-f', 'A-F'),
|
707
|
+
SOAP::SOAPHexBinary.new(str).data)
|
708
|
+
o = SOAP::SOAPHexBinary.new
|
709
|
+
o.set_encoded(str.unpack("H*")[0].tr('a-f', 'A-F'))
|
710
|
+
assert_equal(str, o.string)
|
711
|
+
o.set_encoded(str.unpack("H*")[0].tr('A-F', 'a-f'))
|
712
|
+
assert_equal(str, o.string)
|
713
|
+
end
|
714
|
+
|
715
|
+
targets = [
|
716
|
+
"0FG7",
|
717
|
+
"0fg7",
|
718
|
+
]
|
719
|
+
targets.each do |d|
|
720
|
+
assert_raises(XSD::ValueSpaceError, d.to_s) do
|
721
|
+
o = SOAP::SOAPHexBinary.new
|
722
|
+
o.set_encoded(d)
|
723
|
+
p o.string
|
724
|
+
end
|
725
|
+
end
|
726
|
+
end
|
727
|
+
|
728
|
+
def test_SOAPBase64Binary
|
729
|
+
o = SOAP::SOAPBase64.new
|
730
|
+
assert_equal(SOAP::EncodingNamespace, o.type.namespace)
|
731
|
+
assert_equal(SOAP::Base64Literal, o.type.name)
|
732
|
+
assert_equal(nil, o.data)
|
733
|
+
assert_equal(true, o.is_nil)
|
734
|
+
|
735
|
+
targets = [
|
736
|
+
"abcdef",
|
737
|
+
"\xe3\x81\xaa\xe3\x81\xb2",
|
738
|
+
"\0",
|
739
|
+
"",
|
740
|
+
]
|
741
|
+
targets.each do |str|
|
742
|
+
assert_equal(str, SOAP::SOAPBase64.new(str).string)
|
743
|
+
assert_equal([str].pack("m").chomp, SOAP::SOAPBase64.new(str).data)
|
744
|
+
o = SOAP::SOAPBase64.new
|
745
|
+
o.set_encoded([str].pack("m").chomp)
|
746
|
+
assert_equal(str, o.string)
|
747
|
+
end
|
748
|
+
|
749
|
+
targets = [
|
750
|
+
"-",
|
751
|
+
"*",
|
752
|
+
]
|
753
|
+
targets.each do |d|
|
754
|
+
assert_raises(XSD::ValueSpaceError, d.to_s) do
|
755
|
+
o = SOAP::SOAPBase64.new
|
756
|
+
o.set_encoded(d)
|
757
|
+
p o.string
|
758
|
+
end
|
759
|
+
end
|
760
|
+
end
|
761
|
+
|
762
|
+
def test_SOAPAnyURI
|
763
|
+
o = SOAP::SOAPAnyURI.new
|
764
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
765
|
+
assert_equal(XSD::AnyURILiteral, o.type.name)
|
766
|
+
assert_equal(nil, o.data)
|
767
|
+
assert_equal(true, o.is_nil)
|
768
|
+
|
769
|
+
# Too few tests here I know. Believe uri module. :)
|
770
|
+
targets = [
|
771
|
+
"foo",
|
772
|
+
"http://foo",
|
773
|
+
"http://foo/bar/baz",
|
774
|
+
"http://foo/bar#baz",
|
775
|
+
"http://foo/bar%20%20?a+b",
|
776
|
+
"HTTP://FOO/BAR%20%20?A+B",
|
777
|
+
]
|
778
|
+
targets.each do |str|
|
779
|
+
assert_parsed_result(SOAP::SOAPAnyURI, str)
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
783
|
+
def test_SOAPQName
|
784
|
+
o = SOAP::SOAPQName.new
|
785
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
786
|
+
assert_equal(XSD::QNameLiteral, o.type.name)
|
787
|
+
assert_equal(nil, o.data)
|
788
|
+
assert_equal(true, o.is_nil)
|
789
|
+
|
790
|
+
# More strict test is needed but current implementation allows all non-':'
|
791
|
+
# chars like ' ', C0 or C1...
|
792
|
+
targets = [
|
793
|
+
"foo",
|
794
|
+
"foo:bar",
|
795
|
+
"a:b",
|
796
|
+
]
|
797
|
+
targets.each do |str|
|
798
|
+
assert_parsed_result(SOAP::SOAPQName, str)
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
802
|
+
|
803
|
+
###
|
804
|
+
## Derived types
|
805
|
+
#
|
806
|
+
|
807
|
+
def test_SOAPInteger
|
808
|
+
o = SOAP::SOAPInteger.new
|
809
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
810
|
+
assert_equal(XSD::IntegerLiteral, o.type.name)
|
811
|
+
assert_equal(nil, o.data)
|
812
|
+
assert_equal(true, o.is_nil)
|
813
|
+
|
814
|
+
targets = [
|
815
|
+
0,
|
816
|
+
1000000000,
|
817
|
+
-9999999999,
|
818
|
+
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
|
819
|
+
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
|
820
|
+
-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
|
821
|
+
]
|
822
|
+
targets.each do |int|
|
823
|
+
assert_equal(int, SOAP::SOAPInteger.new(int).data)
|
824
|
+
end
|
825
|
+
|
826
|
+
targets = [
|
827
|
+
"0",
|
828
|
+
"1000000000",
|
829
|
+
"-9999999999",
|
830
|
+
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
831
|
+
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
832
|
+
"-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
|
833
|
+
]
|
834
|
+
targets.each do |str|
|
835
|
+
assert_equal(str, SOAP::SOAPInteger.new(str).to_s)
|
836
|
+
end
|
837
|
+
|
838
|
+
targets = [
|
839
|
+
["-0", "0"],
|
840
|
+
["+0", "0"],
|
841
|
+
["000123", "123"],
|
842
|
+
["-000123", "-123"],
|
843
|
+
[
|
844
|
+
"+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
|
845
|
+
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
|
846
|
+
],
|
847
|
+
]
|
848
|
+
targets.each do |data, expected|
|
849
|
+
assert_equal(expected, SOAP::SOAPInteger.new(data).to_s)
|
850
|
+
end
|
851
|
+
|
852
|
+
targets = [
|
853
|
+
"0.0",
|
854
|
+
"-5.2",
|
855
|
+
"0.000000000000a",
|
856
|
+
"+-5",
|
857
|
+
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
|
858
|
+
]
|
859
|
+
targets.each do |d|
|
860
|
+
assert_raises(XSD::ValueSpaceError) do
|
861
|
+
SOAP::SOAPInteger.new(d)
|
862
|
+
end
|
863
|
+
end
|
864
|
+
end
|
865
|
+
|
866
|
+
def test_SOAPLong
|
867
|
+
o = SOAP::SOAPLong.new
|
868
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
869
|
+
assert_equal(XSD::LongLiteral, o.type.name)
|
870
|
+
assert_equal(nil, o.data)
|
871
|
+
assert_equal(true, o.is_nil)
|
872
|
+
|
873
|
+
targets = [
|
874
|
+
0,
|
875
|
+
123,
|
876
|
+
-123,
|
877
|
+
9223372036854775807,
|
878
|
+
-9223372036854775808,
|
879
|
+
]
|
880
|
+
targets.each do |lng|
|
881
|
+
assert_equal(lng, SOAP::SOAPLong.new(lng).data)
|
882
|
+
end
|
883
|
+
|
884
|
+
targets = [
|
885
|
+
"0",
|
886
|
+
"123",
|
887
|
+
"-123",
|
888
|
+
"9223372036854775807",
|
889
|
+
"-9223372036854775808",
|
890
|
+
]
|
891
|
+
targets.each do |str|
|
892
|
+
assert_equal(str, SOAP::SOAPLong.new(str).to_s)
|
893
|
+
end
|
894
|
+
|
895
|
+
targets = [
|
896
|
+
["-0", "0"],
|
897
|
+
["+0", "0"],
|
898
|
+
["000123", "123"],
|
899
|
+
["-000123", "-123"],
|
900
|
+
]
|
901
|
+
targets.each do |data, expected|
|
902
|
+
assert_equal(expected, SOAP::SOAPLong.new(data).to_s)
|
903
|
+
end
|
904
|
+
|
905
|
+
targets = [
|
906
|
+
9223372036854775808,
|
907
|
+
-9223372036854775809,
|
908
|
+
"0.0",
|
909
|
+
"-5.2",
|
910
|
+
"0.000000000000a",
|
911
|
+
"+-5",
|
912
|
+
]
|
913
|
+
targets.each do |d|
|
914
|
+
assert_raises(XSD::ValueSpaceError) do
|
915
|
+
SOAP::SOAPLong.new(d)
|
916
|
+
end
|
917
|
+
end
|
918
|
+
end
|
919
|
+
|
920
|
+
def test_SOAPInt
|
921
|
+
o = SOAP::SOAPInt.new
|
922
|
+
assert_equal(XSD::Namespace, o.type.namespace)
|
923
|
+
assert_equal(XSD::IntLiteral, o.type.name)
|
924
|
+
assert_equal(nil, o.data)
|
925
|
+
assert_equal(true, o.is_nil)
|
926
|
+
|
927
|
+
targets = [
|
928
|
+
0,
|
929
|
+
123,
|
930
|
+
-123,
|
931
|
+
2147483647,
|
932
|
+
-2147483648,
|
933
|
+
]
|
934
|
+
targets.each do |lng|
|
935
|
+
assert_equal(lng, SOAP::SOAPInt.new(lng).data)
|
936
|
+
end
|
937
|
+
|
938
|
+
targets = [
|
939
|
+
"0",
|
940
|
+
"123",
|
941
|
+
"-123",
|
942
|
+
"2147483647",
|
943
|
+
"-2147483648",
|
944
|
+
]
|
945
|
+
targets.each do |str|
|
946
|
+
assert_equal(str, SOAP::SOAPInt.new(str).to_s)
|
947
|
+
end
|
948
|
+
|
949
|
+
targets = [
|
950
|
+
["-0", "0"],
|
951
|
+
["+0", "0"],
|
952
|
+
["000123", "123"],
|
953
|
+
["-000123", "-123"],
|
954
|
+
]
|
955
|
+
targets.each do |data, expected|
|
956
|
+
assert_equal(expected, SOAP::SOAPInt.new(data).to_s)
|
957
|
+
end
|
958
|
+
|
959
|
+
targets = [
|
960
|
+
2147483648,
|
961
|
+
-2147483649,
|
962
|
+
"0.0",
|
963
|
+
"-5.2",
|
964
|
+
"0.000000000000a",
|
965
|
+
"+-5",
|
966
|
+
]
|
967
|
+
targets.each do |d|
|
968
|
+
assert_raises(XSD::ValueSpaceError) do
|
969
|
+
SOAP::SOAPInt.new(d)
|
970
|
+
end
|
971
|
+
end
|
972
|
+
end
|
973
|
+
end
|
974
|
+
|
975
|
+
|
976
|
+
end
|