soap4r 1.5.5.20061022

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (440) hide show
  1. data/bin/wsdl2ruby.rb +131 -0
  2. data/bin/xsd2ruby.rb +82 -0
  3. data/lib/soap/XMLSchemaDatatypes.rb +9 -0
  4. data/lib/soap/XMLSchemaDatatypes1999.rb +10 -0
  5. data/lib/soap/attachment.rb +108 -0
  6. data/lib/soap/baseData.rb +992 -0
  7. data/lib/soap/cgistub.rb +9 -0
  8. data/lib/soap/charset.rb +9 -0
  9. data/lib/soap/compat.rb +182 -0
  10. data/lib/soap/driver.rb +9 -0
  11. data/lib/soap/element.rb +266 -0
  12. data/lib/soap/encodingstyle/aspDotNetHandler.rb +207 -0
  13. data/lib/soap/encodingstyle/handler.rb +109 -0
  14. data/lib/soap/encodingstyle/literalHandler.rb +241 -0
  15. data/lib/soap/encodingstyle/soapHandler.rb +598 -0
  16. data/lib/soap/generator.rb +264 -0
  17. data/lib/soap/header/handler.rb +60 -0
  18. data/lib/soap/header/handlerset.rb +70 -0
  19. data/lib/soap/header/simplehandler.rb +44 -0
  20. data/lib/soap/httpconfigloader.rb +119 -0
  21. data/lib/soap/mapping.rb +12 -0
  22. data/lib/soap/mapping/encodedregistry.rb +531 -0
  23. data/lib/soap/mapping/factory.rb +372 -0
  24. data/lib/soap/mapping/literalregistry.rb +321 -0
  25. data/lib/soap/mapping/mapping.rb +561 -0
  26. data/lib/soap/mapping/registry.rb +258 -0
  27. data/lib/soap/mapping/rubytypeFactory.rb +475 -0
  28. data/lib/soap/mapping/typeMap.rb +82 -0
  29. data/lib/soap/mapping/wsdlencodedregistry.rb +253 -0
  30. data/lib/soap/mapping/wsdlliteralregistry.rb +246 -0
  31. data/lib/soap/mappingRegistry.rb +9 -0
  32. data/lib/soap/marshal.rb +59 -0
  33. data/lib/soap/mimemessage.rb +241 -0
  34. data/lib/soap/namespace.rb +9 -0
  35. data/lib/soap/netHttpClient.rb +204 -0
  36. data/lib/soap/parser.rb +251 -0
  37. data/lib/soap/processor.rb +66 -0
  38. data/lib/soap/property.rb +333 -0
  39. data/lib/soap/proxy.rb +14 -0
  40. data/lib/soap/qname.rb +9 -0
  41. data/lib/soap/rpc/cgistub.rb +214 -0
  42. data/lib/soap/rpc/driver.rb +245 -0
  43. data/lib/soap/rpc/element.rb +330 -0
  44. data/lib/soap/rpc/httpserver.rb +143 -0
  45. data/lib/soap/rpc/proxy.rb +563 -0
  46. data/lib/soap/rpc/router.rb +602 -0
  47. data/lib/soap/rpc/rpc.rb +25 -0
  48. data/lib/soap/rpc/soaplet.rb +162 -0
  49. data/lib/soap/rpc/standaloneServer.rb +43 -0
  50. data/lib/soap/rpcRouter.rb +9 -0
  51. data/lib/soap/rpcUtils.rb +9 -0
  52. data/lib/soap/server.rb +9 -0
  53. data/lib/soap/soap.rb +150 -0
  54. data/lib/soap/standaloneServer.rb +9 -0
  55. data/lib/soap/streamHandler.rb +258 -0
  56. data/lib/soap/wsdlDriver.rb +580 -0
  57. data/lib/wsdl/binding.rb +65 -0
  58. data/lib/wsdl/data.rb +64 -0
  59. data/lib/wsdl/definitions.rb +250 -0
  60. data/lib/wsdl/documentation.rb +32 -0
  61. data/lib/wsdl/import.rb +80 -0
  62. data/lib/wsdl/importer.rb +38 -0
  63. data/lib/wsdl/info.rb +39 -0
  64. data/lib/wsdl/message.rb +54 -0
  65. data/lib/wsdl/operation.rb +175 -0
  66. data/lib/wsdl/operationBinding.rb +116 -0
  67. data/lib/wsdl/param.rb +85 -0
  68. data/lib/wsdl/parser.rb +163 -0
  69. data/lib/wsdl/part.rb +52 -0
  70. data/lib/wsdl/port.rb +84 -0
  71. data/lib/wsdl/portType.rb +75 -0
  72. data/lib/wsdl/service.rb +61 -0
  73. data/lib/wsdl/soap/address.rb +40 -0
  74. data/lib/wsdl/soap/binding.rb +49 -0
  75. data/lib/wsdl/soap/body.rb +56 -0
  76. data/lib/wsdl/soap/cgiStubCreator.rb +88 -0
  77. data/lib/wsdl/soap/classDefCreator.rb +340 -0
  78. data/lib/wsdl/soap/classDefCreatorSupport.rb +131 -0
  79. data/lib/wsdl/soap/clientSkeltonCreator.rb +93 -0
  80. data/lib/wsdl/soap/complexType.rb +166 -0
  81. data/lib/wsdl/soap/data.rb +42 -0
  82. data/lib/wsdl/soap/definitions.rb +151 -0
  83. data/lib/wsdl/soap/driverCreator.rb +110 -0
  84. data/lib/wsdl/soap/element.rb +28 -0
  85. data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +117 -0
  86. data/lib/wsdl/soap/fault.rb +56 -0
  87. data/lib/wsdl/soap/header.rb +86 -0
  88. data/lib/wsdl/soap/headerfault.rb +56 -0
  89. data/lib/wsdl/soap/literalMappingRegistryCreator.rb +188 -0
  90. data/lib/wsdl/soap/mappingRegistryCreator.rb +53 -0
  91. data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +233 -0
  92. data/lib/wsdl/soap/methodDefCreator.rb +253 -0
  93. data/lib/wsdl/soap/operation.rb +122 -0
  94. data/lib/wsdl/soap/servantSkeltonCreator.rb +78 -0
  95. data/lib/wsdl/soap/standaloneServerStubCreator.rb +98 -0
  96. data/lib/wsdl/soap/wsdl2ruby.rb +196 -0
  97. data/lib/wsdl/types.rb +44 -0
  98. data/lib/wsdl/wsdl.rb +23 -0
  99. data/lib/wsdl/xmlSchema/all.rb +24 -0
  100. data/lib/wsdl/xmlSchema/annotation.rb +34 -0
  101. data/lib/wsdl/xmlSchema/any.rb +56 -0
  102. data/lib/wsdl/xmlSchema/attribute.rb +123 -0
  103. data/lib/wsdl/xmlSchema/choice.rb +55 -0
  104. data/lib/wsdl/xmlSchema/complexContent.rb +88 -0
  105. data/lib/wsdl/xmlSchema/complexExtension.rb +104 -0
  106. data/lib/wsdl/xmlSchema/complexRestriction.rb +92 -0
  107. data/lib/wsdl/xmlSchema/complexType.rb +152 -0
  108. data/lib/wsdl/xmlSchema/content.rb +74 -0
  109. data/lib/wsdl/xmlSchema/data.rb +90 -0
  110. data/lib/wsdl/xmlSchema/element.rb +158 -0
  111. data/lib/wsdl/xmlSchema/enumeration.rb +36 -0
  112. data/lib/wsdl/xmlSchema/import.rb +65 -0
  113. data/lib/wsdl/xmlSchema/importer.rb +87 -0
  114. data/lib/wsdl/xmlSchema/include.rb +54 -0
  115. data/lib/wsdl/xmlSchema/length.rb +35 -0
  116. data/lib/wsdl/xmlSchema/list.rb +48 -0
  117. data/lib/wsdl/xmlSchema/maxlength.rb +35 -0
  118. data/lib/wsdl/xmlSchema/minlength.rb +35 -0
  119. data/lib/wsdl/xmlSchema/parser.rb +166 -0
  120. data/lib/wsdl/xmlSchema/pattern.rb +36 -0
  121. data/lib/wsdl/xmlSchema/schema.rb +144 -0
  122. data/lib/wsdl/xmlSchema/sequence.rb +51 -0
  123. data/lib/wsdl/xmlSchema/simpleContent.rb +69 -0
  124. data/lib/wsdl/xmlSchema/simpleExtension.rb +54 -0
  125. data/lib/wsdl/xmlSchema/simpleRestriction.rb +91 -0
  126. data/lib/wsdl/xmlSchema/simpleType.rb +80 -0
  127. data/lib/wsdl/xmlSchema/unique.rb +34 -0
  128. data/lib/wsdl/xmlSchema/xsd2ruby.rb +107 -0
  129. data/lib/xsd/charset.rb +187 -0
  130. data/lib/xsd/codegen.rb +12 -0
  131. data/lib/xsd/codegen/classdef.rb +203 -0
  132. data/lib/xsd/codegen/commentdef.rb +34 -0
  133. data/lib/xsd/codegen/gensupport.rb +168 -0
  134. data/lib/xsd/codegen/methoddef.rb +70 -0
  135. data/lib/xsd/codegen/moduledef.rb +191 -0
  136. data/lib/xsd/datatypes.rb +1282 -0
  137. data/lib/xsd/datatypes1999.rb +20 -0
  138. data/lib/xsd/iconvcharset.rb +33 -0
  139. data/lib/xsd/mapping.rb +42 -0
  140. data/lib/xsd/namedelements.rb +124 -0
  141. data/lib/xsd/ns.rb +146 -0
  142. data/lib/xsd/qname.rb +78 -0
  143. data/lib/xsd/xmlparser.rb +61 -0
  144. data/lib/xsd/xmlparser/parser.rb +96 -0
  145. data/lib/xsd/xmlparser/rexmlparser.rb +54 -0
  146. data/lib/xsd/xmlparser/xmlparser.rb +50 -0
  147. data/lib/xsd/xmlparser/xmlscanner.rb +147 -0
  148. data/test/16runner.rb +68 -0
  149. data/test/interopR2/README.txt +2 -0
  150. data/test/interopR2/SOAPBuildersInterop_R2.wsdl +461 -0
  151. data/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl +19 -0
  152. data/test/interopR2/base.rb +288 -0
  153. data/test/interopR2/client.NetRemoting.rb +17 -0
  154. data/test/interopR2/client.NetRemoting.rb.result +3410 -0
  155. data/test/interopR2/client.NetRemoting_Base.log +6279 -0
  156. data/test/interopR2/client.NetRemoting_GroupB.log +1188 -0
  157. data/test/interopR2/client.rb +1228 -0
  158. data/test/interopR2/client4S4C.rb +15 -0
  159. data/test/interopR2/client4S4C2.rb +14 -0
  160. data/test/interopR2/client4S4C2_Base.log +4955 -0
  161. data/test/interopR2/client4S4C2_GroupB.log +1000 -0
  162. data/test/interopR2/client4S4C_Base.log +4635 -0
  163. data/test/interopR2/client4S4C_GroupB.log +900 -0
  164. data/test/interopR2/clientASP.NET.rb +17 -0
  165. data/test/interopR2/clientASP.NET_Base.log +5468 -0
  166. data/test/interopR2/clientASP.NET_GroupB.log +977 -0
  167. data/test/interopR2/clientApacheAxis.rb +16 -0
  168. data/test/interopR2/clientApacheAxis_Base.log +3171 -0
  169. data/test/interopR2/clientApacheAxis_GroupB.log +498 -0
  170. data/test/interopR2/clientApacheSOAP.rb +17 -0
  171. data/test/interopR2/clientApacheSOAP_Base.log +3171 -0
  172. data/test/interopR2/clientBEAWebLogic.rb +17 -0
  173. data/test/interopR2/clientBEAWebLogic_Base.log +3171 -0
  174. data/test/interopR2/clientBEAWebLogic_GroupB.log +498 -0
  175. data/test/interopR2/clientBase.rb +1970 -0
  176. data/test/interopR2/clientCapeConnect.rb +18 -0
  177. data/test/interopR2/clientCapeConnect_Base.log +2126 -0
  178. data/test/interopR2/clientDelphi.rb +19 -0
  179. data/test/interopR2/clientDelphi_Base.log +0 -0
  180. data/test/interopR2/clientEasySoap.rb +14 -0
  181. data/test/interopR2/clientEasySoap_Base.log +6187 -0
  182. data/test/interopR2/clientEasySoap_GroupB.log +1076 -0
  183. data/test/interopR2/clientFrontier.rb +25 -0
  184. data/test/interopR2/clientFrontier_Base.log +5188 -0
  185. data/test/interopR2/clientGLUE.rb +32 -0
  186. data/test/interopR2/clientHP.rb +13 -0
  187. data/test/interopR2/clientHP_Base.log +3171 -0
  188. data/test/interopR2/clientHP_GroupB.log +498 -0
  189. data/test/interopR2/clientJAX-RPC.rb +19 -0
  190. data/test/interopR2/clientJSOAP.rb +14 -0
  191. data/test/interopR2/clientJSOAP_Base.log +4465 -0
  192. data/test/interopR2/clientJSOAP_GroupB.log +824 -0
  193. data/test/interopR2/clientKafkaXSLT.rb +15 -0
  194. data/test/interopR2/clientKafkaXSLT_Base.log +10299 -0
  195. data/test/interopR2/clientKafkaXSLT_GroupB.log +1739 -0
  196. data/test/interopR2/clientMSSOAPToolkit2.0.rb +17 -0
  197. data/test/interopR2/clientMSSOAPToolkit2.0_Base.log +4805 -0
  198. data/test/interopR2/clientMSSOAPToolkit2.0_GroupB.log +871 -0
  199. data/test/interopR2/clientMSSOAPToolkit3.0.rb +17 -0
  200. data/test/interopR2/clientMSSOAPToolkit3.0_Base.log +5076 -0
  201. data/test/interopR2/clientMSSOAPToolkit3.0_GroupB.log +908 -0
  202. data/test/interopR2/clientNuSOAP.rb +19 -0
  203. data/test/interopR2/clientNuSOAP_Base.log +5076 -0
  204. data/test/interopR2/clientNuSOAP_GroupB.log +958 -0
  205. data/test/interopR2/clientNuWave.rb +15 -0
  206. data/test/interopR2/clientNuWave_Base.log +2019 -0
  207. data/test/interopR2/clientOpenLink.rb +15 -0
  208. data/test/interopR2/clientOpenLink_Base.log +6171 -0
  209. data/test/interopR2/clientOpenLink_GroupB.log +1094 -0
  210. data/test/interopR2/clientOracle.rb +15 -0
  211. data/test/interopR2/clientOracle_Base.log +5594 -0
  212. data/test/interopR2/clientPEAR.rb +18 -0
  213. data/test/interopR2/clientPEAR_Base.log +6261 -0
  214. data/test/interopR2/clientPEAR_GroupB.log +1106 -0
  215. data/test/interopR2/clientPhalanx.rb +18 -0
  216. data/test/interopR2/clientPhalanx_Base.log +41036 -0
  217. data/test/interopR2/clientPhalanx_GroupB.log +6519 -0
  218. data/test/interopR2/clientSIMACE.rb +18 -0
  219. data/test/interopR2/clientSIMACE_Base.log +6171 -0
  220. data/test/interopR2/clientSIMACE_GroupB.log +1093 -0
  221. data/test/interopR2/clientSOAP4R.rb +18 -0
  222. data/test/interopR2/clientSOAP4R.rb.result +3409 -0
  223. data/test/interopR2/clientSOAP4R_Base.log +6366 -0
  224. data/test/interopR2/clientSOAP4R_GroupB.log +1112 -0
  225. data/test/interopR2/clientSOAP__Lite.rb +14 -0
  226. data/test/interopR2/clientSQLData.rb +18 -0
  227. data/test/interopR2/clientSQLData_Base.log +4857 -0
  228. data/test/interopR2/clientSQLData_GroupB.log +770 -0
  229. data/test/interopR2/clientSilverStream.rb +17 -0
  230. data/test/interopR2/clientSilverStream_Base.log +3171 -0
  231. data/test/interopR2/clientSpray2001.rb +17 -0
  232. data/test/interopR2/clientSpray2001_Base.log +8187 -0
  233. data/test/interopR2/clientSpray2001_GroupB.log +1408 -0
  234. data/test/interopR2/clientSun.rb +19 -0
  235. data/test/interopR2/clientSun_Base.log +4641 -0
  236. data/test/interopR2/clientSun_GroupB.log +856 -0
  237. data/test/interopR2/clientVWOpentalkSoap.rb +19 -0
  238. data/test/interopR2/clientVWOpentalkSoap_Base.log +5402 -0
  239. data/test/interopR2/clientVWOpentalkSoap_GroupB.log +972 -0
  240. data/test/interopR2/clientWASP.rb +19 -0
  241. data/test/interopR2/clientWASPC.rb +18 -0
  242. data/test/interopR2/clientWASPC_Base.log +4187 -0
  243. data/test/interopR2/clientWASPC_GroupB.log +763 -0
  244. data/test/interopR2/clientWASP_Base.log +5414 -0
  245. data/test/interopR2/clientWASP_GroupB.log +970 -0
  246. data/test/interopR2/clientWebMethods.rb +15 -0
  247. data/test/interopR2/clientWebMethods_Base.log +3075 -0
  248. data/test/interopR2/clientWebMethods_GroupB.log +483 -0
  249. data/test/interopR2/clientWhiteMesa.rb +28 -0
  250. data/test/interopR2/clientWhiteMesa_Base.log +4359 -0
  251. data/test/interopR2/clientWhiteMesa_GroupB.log +808 -0
  252. data/test/interopR2/clientWingfoot.rb +15 -0
  253. data/test/interopR2/clientWingfoot_Base.log +4445 -0
  254. data/test/interopR2/clientWingfoot_GroupB.log +848 -0
  255. data/test/interopR2/clientXMLBus.rb +19 -0
  256. data/test/interopR2/clientXMLBus_Base.log +3075 -0
  257. data/test/interopR2/clientXMLBus_GroupB.log +483 -0
  258. data/test/interopR2/clientXMLRPC-EPI.rb +17 -0
  259. data/test/interopR2/clientXSOAP.rb +14 -0
  260. data/test/interopR2/clientXSOAP_Base.log +4445 -0
  261. data/test/interopR2/clientZSI.rb +19 -0
  262. data/test/interopR2/clienteSOAP.rb +18 -0
  263. data/test/interopR2/clienteSOAP_Base.log +8728 -0
  264. data/test/interopR2/clientgSOAP.rb +18 -0
  265. data/test/interopR2/clientgSOAP_Base.log +4689 -0
  266. data/test/interopR2/clientgSOAP_GroupB.log +1014 -0
  267. data/test/interopR2/clientkSOAP.rb +17 -0
  268. data/test/interopR2/clientkSOAP_Base.log +5625 -0
  269. data/test/interopR2/iSimonReg.rb +112 -0
  270. data/test/interopR2/interopResultBase.rb +114 -0
  271. data/test/interopR2/interopService.rb +247 -0
  272. data/test/interopR2/result_client.NetRemoting.txt +4593 -0
  273. data/test/interopR2/rwikiInteropService.rb +105 -0
  274. data/test/interopR2/server.cgi +270 -0
  275. data/test/interopR2/server.rb +274 -0
  276. data/test/interopR2/simonReg.rb +123 -0
  277. data/test/interopR2/test.sh +49 -0
  278. data/test/interopR4/client.rb +112 -0
  279. data/test/runner.rb +9 -0
  280. data/test/sm11/classDef.rb +156 -0
  281. data/test/sm11/client.rb +542 -0
  282. data/test/sm11/driver.rb +183 -0
  283. data/test/sm11/servant.rb +1067 -0
  284. data/test/sm11/server.rb +25 -0
  285. data/test/soap/asp.net/hello.wsdl +96 -0
  286. data/test/soap/asp.net/test_aspdotnet.rb +112 -0
  287. data/test/soap/calc/calc.rb +17 -0
  288. data/test/soap/calc/calc2.rb +29 -0
  289. data/test/soap/calc/server.cgi +13 -0
  290. data/test/soap/calc/server.rb +17 -0
  291. data/test/soap/calc/server2.rb +20 -0
  292. data/test/soap/calc/test_calc.rb +49 -0
  293. data/test/soap/calc/test_calc2.rb +53 -0
  294. data/test/soap/calc/test_calc_cgi.rb +69 -0
  295. data/test/soap/fault/test_customfault.rb +58 -0
  296. data/test/soap/header/server.cgi +119 -0
  297. data/test/soap/header/test_authheader.rb +240 -0
  298. data/test/soap/header/test_authheader_cgi.rb +121 -0
  299. data/test/soap/header/test_simplehandler.rb +116 -0
  300. data/test/soap/helloworld/hw_s.rb +16 -0
  301. data/test/soap/helloworld/test_helloworld.rb +41 -0
  302. data/test/soap/literalArrayMapping/amazonEc.rb +4778 -0
  303. data/test/soap/literalArrayMapping/amazonEcDriver.rb +172 -0
  304. data/test/soap/literalArrayMapping/amazonresponse.xml +100 -0
  305. data/test/soap/literalArrayMapping/test_definedarray.rb +36 -0
  306. data/test/soap/marshal/marshaltestlib.rb +494 -0
  307. data/test/soap/marshal/test_digraph.rb +56 -0
  308. data/test/soap/marshal/test_marshal.rb +26 -0
  309. data/test/soap/marshal/test_struct.rb +47 -0
  310. data/test/soap/ssl/README +1 -0
  311. data/test/soap/ssl/ca.cert +23 -0
  312. data/test/soap/ssl/client.cert +19 -0
  313. data/test/soap/ssl/client.key +15 -0
  314. data/test/soap/ssl/server.cert +19 -0
  315. data/test/soap/ssl/server.key +15 -0
  316. data/test/soap/ssl/sslsvr.rb +57 -0
  317. data/test/soap/ssl/subca.cert +21 -0
  318. data/test/soap/ssl/test_ssl.rb +245 -0
  319. data/test/soap/struct/test_struct.rb +77 -0
  320. data/test/soap/styleuse/client.rb +20 -0
  321. data/test/soap/styleuse/server.rb +86 -0
  322. data/test/soap/swa/test_file.rb +73 -0
  323. data/test/soap/test_basetype.rb +976 -0
  324. data/test/soap/test_custommap.rb +108 -0
  325. data/test/soap/test_empty.rb +79 -0
  326. data/test/soap/test_envelopenamespace.rb +92 -0
  327. data/test/soap/test_httpconfigloader.rb +39 -0
  328. data/test/soap/test_mapping.rb +59 -0
  329. data/test/soap/test_no_indent.rb +86 -0
  330. data/test/soap/test_property.rb +424 -0
  331. data/test/soap/test_response_as_xml.rb +95 -0
  332. data/test/soap/test_soapelement.rb +120 -0
  333. data/test/soap/test_streamhandler.rb +262 -0
  334. data/test/soap/test_styleuse.rb +333 -0
  335. data/test/soap/wsdlDriver/README.txt +2 -0
  336. data/test/soap/wsdlDriver/calc.wsdl +126 -0
  337. data/test/soap/wsdlDriver/document.wsdl +54 -0
  338. data/test/soap/wsdlDriver/echo_version.rb +29 -0
  339. data/test/soap/wsdlDriver/simpletype.wsdl +63 -0
  340. data/test/soap/wsdlDriver/test_calc.rb +100 -0
  341. data/test/soap/wsdlDriver/test_document.rb +78 -0
  342. data/test/soap/wsdlDriver/test_simpletype.rb +87 -0
  343. data/test/wsdl/abstract/abstract.wsdl +97 -0
  344. data/test/wsdl/abstract/test_abstract.rb +130 -0
  345. data/test/wsdl/any/any.wsdl +51 -0
  346. data/test/wsdl/any/expectedDriver.rb +46 -0
  347. data/test/wsdl/any/expectedEcho.rb +18 -0
  348. data/test/wsdl/any/expectedService.rb +42 -0
  349. data/test/wsdl/any/test_any.rb +193 -0
  350. data/test/wsdl/axisArray/axisArray.wsdl +60 -0
  351. data/test/wsdl/axisArray/itemList.rb +14 -0
  352. data/test/wsdl/axisArray/test_axisarray.rb +69 -0
  353. data/test/wsdl/choice/choice.wsdl +91 -0
  354. data/test/wsdl/choice/test_choice.rb +134 -0
  355. data/test/wsdl/complexcontent/complexContent.wsdl +83 -0
  356. data/test/wsdl/complexcontent/test_echo.rb +101 -0
  357. data/test/wsdl/datetime/DatetimeService.rb +44 -0
  358. data/test/wsdl/datetime/datetime.rb +0 -0
  359. data/test/wsdl/datetime/datetime.wsdl +45 -0
  360. data/test/wsdl/datetime/datetimeServant.rb +21 -0
  361. data/test/wsdl/datetime/test_datetime.rb +82 -0
  362. data/test/wsdl/document/array/double.wsdl +72 -0
  363. data/test/wsdl/document/array/test_array.rb +117 -0
  364. data/test/wsdl/document/document.wsdl +74 -0
  365. data/test/wsdl/document/number.wsdl +54 -0
  366. data/test/wsdl/document/ping_nosoapaction.wsdl +66 -0
  367. data/test/wsdl/document/test_nosoapaction.rb +109 -0
  368. data/test/wsdl/document/test_number.rb +99 -0
  369. data/test/wsdl/document/test_rpc.rb +211 -0
  370. data/test/wsdl/emptycomplextype.wsdl +31 -0
  371. data/test/wsdl/list/list.wsdl +93 -0
  372. data/test/wsdl/list/test_list.rb +134 -0
  373. data/test/wsdl/map/map.wsdl +92 -0
  374. data/test/wsdl/map/map.xml +43 -0
  375. data/test/wsdl/map/test_map.rb +99 -0
  376. data/test/wsdl/marshal/person.wsdl +21 -0
  377. data/test/wsdl/marshal/person_org.rb +18 -0
  378. data/test/wsdl/marshal/test_wsdlmarshal.rb +79 -0
  379. data/test/wsdl/multiplefault.wsdl +68 -0
  380. data/test/wsdl/overload/overload.wsdl +80 -0
  381. data/test/wsdl/overload/test_overload.rb +118 -0
  382. data/test/wsdl/qualified/lp.wsdl +47 -0
  383. data/test/wsdl/qualified/lp.xsd +26 -0
  384. data/test/wsdl/qualified/np.wsdl +51 -0
  385. data/test/wsdl/qualified/test_qualified.rb +145 -0
  386. data/test/wsdl/qualified/test_unqualified.rb +159 -0
  387. data/test/wsdl/raa/RAA.rb +120 -0
  388. data/test/wsdl/raa/RAAServant.rb +107 -0
  389. data/test/wsdl/raa/RAAService.rb +120 -0
  390. data/test/wsdl/raa/README.txt +8 -0
  391. data/test/wsdl/raa/raa.wsdl +264 -0
  392. data/test/wsdl/raa/server.rb +103 -0
  393. data/test/wsdl/raa/test_raa.rb +91 -0
  394. data/test/wsdl/ref/expectedProduct.rb +158 -0
  395. data/test/wsdl/ref/product.wsdl +147 -0
  396. data/test/wsdl/ref/test_ref.rb +289 -0
  397. data/test/wsdl/rpc/rpc.wsdl +83 -0
  398. data/test/wsdl/rpc/test-rpc-lit.wsdl +364 -0
  399. data/test/wsdl/rpc/test_rpc.rb +173 -0
  400. data/test/wsdl/rpc/test_rpc_lit.rb +407 -0
  401. data/test/wsdl/simplecontent/simplecontent.wsdl +83 -0
  402. data/test/wsdl/simplecontent/test_simplecontent.rb +116 -0
  403. data/test/wsdl/simpletype/rpc/expectedClient.rb +34 -0
  404. data/test/wsdl/simpletype/rpc/expectedDriver.rb +55 -0
  405. data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +19 -0
  406. data/test/wsdl/simpletype/rpc/expectedServant.rb +32 -0
  407. data/test/wsdl/simpletype/rpc/expectedService.rb +51 -0
  408. data/test/wsdl/simpletype/rpc/rpc.wsdl +80 -0
  409. data/test/wsdl/simpletype/rpc/test_rpc.rb +62 -0
  410. data/test/wsdl/simpletype/simpletype.wsdl +95 -0
  411. data/test/wsdl/simpletype/test_simpletype.rb +99 -0
  412. data/test/wsdl/soap/soapbodyparts.wsdl +103 -0
  413. data/test/wsdl/soap/test_soapbodyparts.rb +79 -0
  414. data/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb +19 -0
  415. data/test/wsdl/soap/wsdl2ruby/expectedClient.rb +34 -0
  416. data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +55 -0
  417. data/test/wsdl/soap/wsdl2ruby/expectedServant.rb +32 -0
  418. data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +44 -0
  419. data/test/wsdl/soap/wsdl2ruby/expectedService.rb +51 -0
  420. data/test/wsdl/soap/wsdl2ruby/rpc.wsdl +80 -0
  421. data/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb +31 -0
  422. data/test/wsdl/soap/wsdl2ruby/section/section.xsd +31 -0
  423. data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +54 -0
  424. data/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl +64 -0
  425. data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +96 -0
  426. data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +79 -0
  427. data/test/wsdl/soaptype/soaptype.wsdl +61 -0
  428. data/test/wsdl/soaptype/test_soaptype.rb +160 -0
  429. data/test/wsdl/test_emptycomplextype.rb +21 -0
  430. data/test/wsdl/test_fault.rb +50 -0
  431. data/test/wsdl/test_multiplefault.rb +39 -0
  432. data/test/xsd/codegen/test_classdef.rb +214 -0
  433. data/test/xsd/noencoding.xml +4 -0
  434. data/test/xsd/test_noencoding.rb +32 -0
  435. data/test/xsd/test_ns.rb +20 -0
  436. data/test/xsd/test_xmlschemaparser.rb +22 -0
  437. data/test/xsd/test_xsd.rb +1523 -0
  438. data/test/xsd/xmllang.xml +43 -0
  439. data/test/xsd/xmlschema.xml +12 -0
  440. metadata +539 -0
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'getoptlong'
4
+ require 'logger'
5
+ require 'wsdl/soap/wsdl2ruby'
6
+
7
+
8
+ class WSDL2RubyApp < Logger::Application
9
+ private
10
+
11
+ OptSet = [
12
+ ['--wsdl','-w', GetoptLong::REQUIRED_ARGUMENT],
13
+ ['--module_path','-m', GetoptLong::REQUIRED_ARGUMENT],
14
+ ['--type','-t', GetoptLong::REQUIRED_ARGUMENT],
15
+ ['--classdef','-e', GetoptLong::OPTIONAL_ARGUMENT],
16
+ ['--mapping_registry','-r', GetoptLong::OPTIONAL_ARGUMENT],
17
+ ['--client_skelton','-c', GetoptLong::OPTIONAL_ARGUMENT],
18
+ ['--servant_skelton','-s', GetoptLong::OPTIONAL_ARGUMENT],
19
+ ['--cgi_stub','-g', GetoptLong::OPTIONAL_ARGUMENT],
20
+ ['--standalone_server_stub','-a', GetoptLong::OPTIONAL_ARGUMENT],
21
+ ['--driver','-d', GetoptLong::OPTIONAL_ARGUMENT],
22
+ ['--force','-f', GetoptLong::NO_ARGUMENT],
23
+ ['--quiet','-q', GetoptLong::NO_ARGUMENT],
24
+ ]
25
+
26
+ def initialize
27
+ super('app')
28
+ STDERR.sync = true
29
+ self.level = Logger::FATAL
30
+ end
31
+
32
+ def run
33
+ @worker = WSDL::SOAP::WSDL2Ruby.new
34
+ @worker.logger = @log
35
+ location, opt = parse_opt(GetoptLong.new(*OptSet))
36
+ usage_exit unless location
37
+ @worker.location = location
38
+ if opt['quiet']
39
+ self.level = Logger::FATAL
40
+ else
41
+ self.level = Logger::INFO
42
+ end
43
+ @worker.opt.update(opt)
44
+ @worker.run
45
+ 0
46
+ end
47
+
48
+ def usage_exit
49
+ puts <<__EOU__
50
+ Usage: #{ $0 } --wsdl wsdl_location [options]
51
+ wsdl_location: filename or URL
52
+
53
+ Example:
54
+ For server side:
55
+ #{ $0 } --wsdl myapp.wsdl --type server
56
+ For client side:
57
+ #{ $0 } --wsdl myapp.wsdl --type client
58
+
59
+ Options:
60
+ --wsdl wsdl_location
61
+ --type server|client
62
+ --type server implies;
63
+ --classdef --mapping_registry --servant_skelton --standalone_server_stub
64
+ --type client implies;
65
+ --classdef --mapping_registry --client_skelton --driver
66
+ --classdef [filenameprefix]
67
+ --mapping_registry
68
+ --client_skelton [servicename]
69
+ --servant_skelton [porttypename]
70
+ --cgi_stub [servicename]
71
+ --standalone_server_stub [servicename]
72
+ --driver [porttypename]
73
+ --module_path [Module::Path::Name]
74
+ --force
75
+ --quiet
76
+
77
+ Terminology:
78
+ Client <-> Driver <-(SOAP)-> Stub <-> Servant
79
+
80
+ Driver and Stub: Automatically generated
81
+ Client and Servant: Skelton generated (you should change)
82
+ __EOU__
83
+ exit 1
84
+ end
85
+
86
+ def parse_opt(getoptlong)
87
+ opt = {}
88
+ wsdl = nil
89
+ begin
90
+ getoptlong.each do |name, arg|
91
+ case name
92
+ when "--wsdl"
93
+ wsdl = arg
94
+ when "--module_path"
95
+ opt['module_path'] = arg
96
+ when "--type"
97
+ case arg
98
+ when "server"
99
+ opt['classdef'] = nil
100
+ opt['mapping_registry'] = nil
101
+ opt['servant_skelton'] = nil
102
+ opt['standalone_server_stub'] = nil
103
+ when "client"
104
+ opt['classdef'] = nil
105
+ opt['mapping_registry'] = nil
106
+ opt['driver'] = nil
107
+ opt['client_skelton'] = nil
108
+ else
109
+ raise ArgumentError.new("Unknown type #{ arg }")
110
+ end
111
+ when "--classdef", "--mapping_registry",
112
+ "--client_skelton", "--servant_skelton",
113
+ "--cgi_stub", "--standalone_server_stub",
114
+ "--driver"
115
+ opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg
116
+ when "--force"
117
+ opt['force'] = true
118
+ when "--quiet"
119
+ opt['quiet'] = true
120
+ else
121
+ raise ArgumentError.new("Unknown type #{ arg }")
122
+ end
123
+ end
124
+ rescue
125
+ usage_exit
126
+ end
127
+ return wsdl, opt
128
+ end
129
+ end
130
+
131
+ WSDL2RubyApp.new.start
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'getoptlong'
4
+ require 'logger'
5
+ require 'wsdl/xmlSchema/xsd2ruby'
6
+
7
+
8
+ class XSD2RubyApp < Logger::Application
9
+ private
10
+
11
+ OptSet = [
12
+ ['--xsd','-x', GetoptLong::REQUIRED_ARGUMENT],
13
+ ['--classname','-n', GetoptLong::NO_ARGUMENT],
14
+ ['--force','-f', GetoptLong::NO_ARGUMENT],
15
+ ['--quiet','-q', GetoptLong::NO_ARGUMENT],
16
+ ]
17
+
18
+ def initialize
19
+ super('app')
20
+ STDERR.sync = true
21
+ self.level = Logger::FATAL
22
+ end
23
+
24
+ def run
25
+ @worker = WSDL::XMLSchema::XSD2Ruby.new
26
+ @worker.logger = @log
27
+ location, opt = parse_opt(GetoptLong.new(*OptSet))
28
+ usage_exit unless location
29
+ @worker.location = location
30
+ if opt['quiet']
31
+ self.level = Logger::FATAL
32
+ else
33
+ self.level = Logger::INFO
34
+ end
35
+ @worker.opt.update(opt)
36
+ @worker.run
37
+ 0
38
+ end
39
+
40
+ def usage_exit
41
+ puts <<__EOU__
42
+ Usage: #{ $0 } --xsd xsd_location [options]
43
+ xsd_location: filename or URL
44
+
45
+ Example:
46
+ #{ $0 } --xsd myapp.xsd --classname Foo
47
+
48
+ Options:
49
+ --xsd xsd_location
50
+ --classname classname
51
+ --force
52
+ --quiet
53
+ __EOU__
54
+ exit 1
55
+ end
56
+
57
+ def parse_opt(getoptlong)
58
+ opt = {}
59
+ xsd = nil
60
+ begin
61
+ getoptlong.each do |name, arg|
62
+ case name
63
+ when "--xsd"
64
+ xsd = arg
65
+ when "--classname"
66
+ opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg
67
+ when "--force"
68
+ opt['force'] = true
69
+ when "--quiet"
70
+ opt['quiet'] = true
71
+ else
72
+ raise ArgumentError.new("Unknown type #{ arg }")
73
+ end
74
+ end
75
+ rescue
76
+ usage_exit
77
+ end
78
+ return xsd, opt
79
+ end
80
+ end
81
+
82
+ XSD2RubyApp.new.start
@@ -0,0 +1,9 @@
1
+ # soap/XMLSchemaDatatypes.rb: SOAP4R - XML Schema Datatype implementation.
2
+ # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
+
4
+ # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
+ # redistribute it and/or modify it under the same terms of Ruby's license;
6
+ # either the dual license version in 2003, or any later version.
7
+
8
+
9
+ require 'xsd/datatypes'
@@ -0,0 +1,10 @@
1
+ # soap/XMLSchemaDatatypes1999.rb: SOAP4R - XML Schema Datatype 1999 support
2
+ # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
+
4
+ # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
+ # redistribute it and/or modify it under the same terms of Ruby's license;
6
+ # either the dual license version in 2003, or any later version.
7
+
8
+
9
+ require 'xsd/datatypes1999'
10
+ load 'soap/mapping/typeMap.rb'
@@ -0,0 +1,108 @@
1
+ # soap/attachment.rb: SOAP4R - SwA implementation.
2
+ # Copyright (C) 2002, 2003 Jamie Herre and NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
+
4
+ # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
+ # redistribute it and/or modify it under the same terms of Ruby's license;
6
+ # either the dual license version in 2003, or any later version.
7
+
8
+
9
+ require 'soap/baseData'
10
+ require 'soap/mapping'
11
+
12
+
13
+ module SOAP
14
+
15
+
16
+ class SOAPAttachment < SOAPExternalReference
17
+ attr_reader :data
18
+
19
+ def initialize(value)
20
+ super()
21
+ @data = value
22
+ end
23
+
24
+ private
25
+
26
+ def external_contentid
27
+ @data.contentid
28
+ end
29
+ end
30
+
31
+
32
+ class Attachment
33
+ attr_reader :io
34
+ attr_accessor :contenttype
35
+
36
+ def initialize(string_or_readable = nil)
37
+ @string_or_readable = string_or_readable
38
+ @contenttype = "application/octet-stream"
39
+ @contentid = nil
40
+ @content = nil
41
+ end
42
+
43
+ def contentid
44
+ @contentid ||= Attachment.contentid(self)
45
+ end
46
+
47
+ def contentid=(contentid)
48
+ @contentid = contentid
49
+ end
50
+
51
+ def mime_contentid
52
+ '<' + contentid + '>'
53
+ end
54
+
55
+ def content
56
+ if @content == nil and @string_or_readable != nil
57
+ @content = @string_or_readable.respond_to?(:read) ?
58
+ @string_or_readable.read : @string_or_readable
59
+ end
60
+ @content
61
+ end
62
+
63
+ def to_s
64
+ content
65
+ end
66
+
67
+ def write(out)
68
+ out.write(content)
69
+ end
70
+
71
+ def save(filename)
72
+ File.open(filename, "wb") do |f|
73
+ write(f)
74
+ end
75
+ end
76
+
77
+ def self.contentid(obj)
78
+ # this needs to be fixed
79
+ [obj.__id__.to_s, Process.pid.to_s].join('.')
80
+ end
81
+
82
+ def self.mime_contentid(obj)
83
+ '<' + contentid(obj) + '>'
84
+ end
85
+ end
86
+
87
+
88
+ module Mapping
89
+ class AttachmentFactory < SOAP::Mapping::Factory
90
+ def obj2soap(soap_class, obj, info, map)
91
+ soap_obj = soap_class.new(obj)
92
+ mark_marshalled_obj(obj, soap_obj)
93
+ soap_obj
94
+ end
95
+
96
+ def soap2obj(obj_class, node, info, map)
97
+ obj = node.data
98
+ mark_unmarshalled_obj(node, obj)
99
+ return true, obj
100
+ end
101
+ end
102
+
103
+ DefaultRegistry.add(::SOAP::Attachment, ::SOAP::SOAPAttachment,
104
+ AttachmentFactory.new, nil)
105
+ end
106
+
107
+
108
+ end
@@ -0,0 +1,992 @@
1
+ # soap/baseData.rb: SOAP4R - Base type library
2
+ # Copyright (C) 2000, 2001, 2003-2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
+
4
+ # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
+ # redistribute it and/or modify it under the same terms of Ruby's license;
6
+ # either the dual license version in 2003, or any later version.
7
+
8
+
9
+ require 'xsd/datatypes'
10
+ require 'soap/soap'
11
+
12
+
13
+ module SOAP
14
+
15
+
16
+ ###
17
+ ## Mix-in module for SOAP base type classes.
18
+ #
19
+ module SOAPModuleUtils
20
+ include SOAP
21
+
22
+ public
23
+
24
+ def decode(elename)
25
+ d = self.new
26
+ d.elename = elename
27
+ d
28
+ end
29
+ end
30
+
31
+
32
+ ###
33
+ ## for SOAP type(base and compound)
34
+ #
35
+ module SOAPType
36
+ attr_accessor :encodingstyle
37
+ attr_accessor :elename
38
+ attr_accessor :id
39
+ attr_reader :precedents
40
+ attr_accessor :root
41
+ attr_accessor :parent
42
+ attr_accessor :position
43
+ attr_reader :extraattr
44
+ attr_accessor :definedtype
45
+
46
+ def initialize(*arg)
47
+ super
48
+ @encodingstyle = nil
49
+ @elename = XSD::QName::EMPTY
50
+ @id = nil
51
+ @precedents = []
52
+ @root = false
53
+ @parent = nil
54
+ @position = nil
55
+ @definedtype = nil
56
+ @extraattr = {}
57
+ end
58
+
59
+ def inspect
60
+ if self.is_a?(XSD::NSDBase)
61
+ sprintf("#<%s:0x%x %s %s>", self.class.name, __id__, self.elename, self.type)
62
+ else
63
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
64
+ end
65
+ end
66
+
67
+ def rootnode
68
+ node = self
69
+ while node = node.parent
70
+ break if SOAPEnvelope === node
71
+ end
72
+ node
73
+ end
74
+ end
75
+
76
+
77
+ ###
78
+ ## for SOAP base type
79
+ #
80
+ module SOAPBasetype
81
+ include SOAPType
82
+ include SOAP
83
+
84
+ attr_accessor :qualified
85
+
86
+ def initialize(*arg)
87
+ super
88
+ @qualified = nil
89
+ end
90
+ end
91
+
92
+
93
+ ###
94
+ ## for SOAP compound type
95
+ #
96
+ module SOAPCompoundtype
97
+ include SOAPType
98
+ include SOAP
99
+
100
+ attr_accessor :qualified
101
+
102
+ def initialize(*arg)
103
+ super
104
+ @qualified = nil
105
+ end
106
+ end
107
+
108
+
109
+ ###
110
+ ## Convenience datatypes.
111
+ #
112
+ class SOAPReference < XSD::NSDBase
113
+ include SOAPBasetype
114
+ extend SOAPModuleUtils
115
+
116
+ public
117
+
118
+ attr_accessor :refid
119
+
120
+ # Override the definition in SOAPBasetype.
121
+ def initialize(obj = nil)
122
+ super()
123
+ @type = XSD::QName::EMPTY
124
+ @refid = nil
125
+ @obj = nil
126
+ __setobj__(obj) if obj
127
+ end
128
+
129
+ def __getobj__
130
+ @obj
131
+ end
132
+
133
+ def __setobj__(obj)
134
+ @obj = obj
135
+ @refid = @obj.id || SOAPReference.create_refid(@obj)
136
+ @obj.id = @refid unless @obj.id
137
+ @obj.precedents << self
138
+ # Copies NSDBase information
139
+ @obj.type = @type unless @obj.type
140
+ end
141
+
142
+ # Why don't I use delegate.rb?
143
+ # -> delegate requires target object type at initialize time.
144
+ # Why don't I use forwardable.rb?
145
+ # -> forwardable requires a list of forwarding methods.
146
+ #
147
+ # ToDo: Maybe I should use forwardable.rb and give it a methods list like
148
+ # delegate.rb...
149
+ #
150
+ def method_missing(msg_id, *params)
151
+ if @obj
152
+ @obj.send(msg_id, *params)
153
+ else
154
+ nil
155
+ end
156
+ end
157
+
158
+ def refidstr
159
+ '#' + @refid
160
+ end
161
+
162
+ def self.create_refid(obj)
163
+ 'id' + obj.__id__.to_s
164
+ end
165
+
166
+ def self.decode(elename, refidstr)
167
+ if /\A#(.*)\z/ =~ refidstr
168
+ refid = $1
169
+ elsif /\Acid:(.*)\z/ =~ refidstr
170
+ refid = $1
171
+ else
172
+ raise ArgumentError.new("illegal refid #{refidstr}")
173
+ end
174
+ d = super(elename)
175
+ d.refid = refid
176
+ d
177
+ end
178
+ end
179
+
180
+
181
+ class SOAPExternalReference < XSD::NSDBase
182
+ include SOAPBasetype
183
+ extend SOAPModuleUtils
184
+
185
+ def initialize
186
+ super()
187
+ @type = XSD::QName::EMPTY
188
+ end
189
+
190
+ def referred
191
+ rootnode.external_content[external_contentid] = self
192
+ end
193
+
194
+ def refidstr
195
+ 'cid:' + external_contentid
196
+ end
197
+
198
+ private
199
+
200
+ def external_contentid
201
+ raise NotImplementedError.new
202
+ end
203
+ end
204
+
205
+
206
+ class SOAPNil < XSD::XSDNil
207
+ include SOAPBasetype
208
+ extend SOAPModuleUtils
209
+
210
+ public
211
+
212
+ def initialize(value = nil)
213
+ super(value)
214
+ @extraattr[XSD::AttrNilName] = 'true'
215
+ end
216
+ end
217
+
218
+ # SOAPRawString is for sending raw string. In contrast to SOAPString,
219
+ # SOAP4R does not do XML encoding and does not convert its CES. The string it
220
+ # holds is embedded to XML instance directly as a 'xsd:string'.
221
+ class SOAPRawString < XSD::XSDString
222
+ include SOAPBasetype
223
+ extend SOAPModuleUtils
224
+ end
225
+
226
+
227
+ ###
228
+ ## Basic datatypes.
229
+ #
230
+ class SOAPAnySimpleType < XSD::XSDAnySimpleType
231
+ include SOAPBasetype
232
+ extend SOAPModuleUtils
233
+ end
234
+
235
+ class SOAPString < XSD::XSDString
236
+ include SOAPBasetype
237
+ extend SOAPModuleUtils
238
+ SOAPENCType = QName.new(EncodingNamespace, StringLiteral)
239
+ end
240
+
241
+ class SOAPBoolean < XSD::XSDBoolean
242
+ include SOAPBasetype
243
+ extend SOAPModuleUtils
244
+ SOAPENCType = QName.new(EncodingNamespace, BooleanLiteral)
245
+ end
246
+
247
+ class SOAPDecimal < XSD::XSDDecimal
248
+ include SOAPBasetype
249
+ extend SOAPModuleUtils
250
+ SOAPENCType = QName.new(EncodingNamespace, DecimalLiteral)
251
+ end
252
+
253
+ class SOAPFloat < XSD::XSDFloat
254
+ include SOAPBasetype
255
+ extend SOAPModuleUtils
256
+ SOAPENCType = QName.new(EncodingNamespace, FloatLiteral)
257
+ end
258
+
259
+ class SOAPDouble < XSD::XSDDouble
260
+ include SOAPBasetype
261
+ extend SOAPModuleUtils
262
+ SOAPENCType = QName.new(EncodingNamespace, DoubleLiteral)
263
+ end
264
+
265
+ class SOAPDuration < XSD::XSDDuration
266
+ include SOAPBasetype
267
+ extend SOAPModuleUtils
268
+ SOAPENCType = QName.new(EncodingNamespace, DurationLiteral)
269
+ end
270
+
271
+ class SOAPDateTime < XSD::XSDDateTime
272
+ include SOAPBasetype
273
+ extend SOAPModuleUtils
274
+ SOAPENCType = QName.new(EncodingNamespace, DateTimeLiteral)
275
+ end
276
+
277
+ class SOAPTime < XSD::XSDTime
278
+ include SOAPBasetype
279
+ extend SOAPModuleUtils
280
+ SOAPENCType = QName.new(EncodingNamespace, TimeLiteral)
281
+ end
282
+
283
+ class SOAPDate < XSD::XSDDate
284
+ include SOAPBasetype
285
+ extend SOAPModuleUtils
286
+ SOAPENCType = QName.new(EncodingNamespace, DateLiteral)
287
+ end
288
+
289
+ class SOAPGYearMonth < XSD::XSDGYearMonth
290
+ include SOAPBasetype
291
+ extend SOAPModuleUtils
292
+ SOAPENCType = QName.new(EncodingNamespace, GYearMonthLiteral)
293
+ end
294
+
295
+ class SOAPGYear < XSD::XSDGYear
296
+ include SOAPBasetype
297
+ extend SOAPModuleUtils
298
+ SOAPENCType = QName.new(EncodingNamespace, GYearLiteral)
299
+ end
300
+
301
+ class SOAPGMonthDay < XSD::XSDGMonthDay
302
+ include SOAPBasetype
303
+ extend SOAPModuleUtils
304
+ SOAPENCType = QName.new(EncodingNamespace, GMonthDayLiteral)
305
+ end
306
+
307
+ class SOAPGDay < XSD::XSDGDay
308
+ include SOAPBasetype
309
+ extend SOAPModuleUtils
310
+ SOAPENCType = QName.new(EncodingNamespace, GDayLiteral)
311
+ end
312
+
313
+ class SOAPGMonth < XSD::XSDGMonth
314
+ include SOAPBasetype
315
+ extend SOAPModuleUtils
316
+ SOAPENCType = QName.new(EncodingNamespace, GMonthLiteral)
317
+ end
318
+
319
+ class SOAPHexBinary < XSD::XSDHexBinary
320
+ include SOAPBasetype
321
+ extend SOAPModuleUtils
322
+ SOAPENCType = QName.new(EncodingNamespace, HexBinaryLiteral)
323
+ end
324
+
325
+ class SOAPBase64 < XSD::XSDBase64Binary
326
+ include SOAPBasetype
327
+ extend SOAPModuleUtils
328
+ Type = SOAPENCType = QName.new(EncodingNamespace, Base64Literal)
329
+
330
+ public
331
+
332
+ def initialize(value = nil)
333
+ super(value)
334
+ @type = Type
335
+ end
336
+
337
+ def as_xsd
338
+ @type = XSD::XSDBase64Binary::Type
339
+ end
340
+ end
341
+
342
+ class SOAPAnyURI < XSD::XSDAnyURI
343
+ include SOAPBasetype
344
+ extend SOAPModuleUtils
345
+ SOAPENCType = QName.new(EncodingNamespace, AnyURILiteral)
346
+ end
347
+
348
+ class SOAPQName < XSD::XSDQName
349
+ include SOAPBasetype
350
+ extend SOAPModuleUtils
351
+ SOAPENCType = QName.new(EncodingNamespace, QNameLiteral)
352
+ end
353
+
354
+
355
+ class SOAPInteger < XSD::XSDInteger
356
+ include SOAPBasetype
357
+ extend SOAPModuleUtils
358
+ SOAPENCType = QName.new(EncodingNamespace, IntegerLiteral)
359
+ end
360
+
361
+ class SOAPNonPositiveInteger < XSD::XSDNonPositiveInteger
362
+ include SOAPBasetype
363
+ extend SOAPModuleUtils
364
+ SOAPENCType = QName.new(EncodingNamespace, NonPositiveIntegerLiteral)
365
+ end
366
+
367
+ class SOAPNegativeInteger < XSD::XSDNegativeInteger
368
+ include SOAPBasetype
369
+ extend SOAPModuleUtils
370
+ SOAPENCType = QName.new(EncodingNamespace, NegativeIntegerLiteral)
371
+ end
372
+
373
+ class SOAPLong < XSD::XSDLong
374
+ include SOAPBasetype
375
+ extend SOAPModuleUtils
376
+ SOAPENCType = QName.new(EncodingNamespace, LongLiteral)
377
+ end
378
+
379
+ class SOAPInt < XSD::XSDInt
380
+ include SOAPBasetype
381
+ extend SOAPModuleUtils
382
+ SOAPENCType = QName.new(EncodingNamespace, IntLiteral)
383
+ end
384
+
385
+ class SOAPShort < XSD::XSDShort
386
+ include SOAPBasetype
387
+ extend SOAPModuleUtils
388
+ SOAPENCType = QName.new(EncodingNamespace, ShortLiteral)
389
+ end
390
+
391
+ class SOAPByte < XSD::XSDByte
392
+ include SOAPBasetype
393
+ extend SOAPModuleUtils
394
+ SOAPENCType = QName.new(EncodingNamespace, ByteLiteral)
395
+ end
396
+
397
+ class SOAPNonNegativeInteger < XSD::XSDNonNegativeInteger
398
+ include SOAPBasetype
399
+ extend SOAPModuleUtils
400
+ SOAPENCType = QName.new(EncodingNamespace, NonNegativeIntegerLiteral)
401
+ end
402
+
403
+ class SOAPUnsignedLong < XSD::XSDUnsignedLong
404
+ include SOAPBasetype
405
+ extend SOAPModuleUtils
406
+ SOAPENCType = QName.new(EncodingNamespace, UnsignedLongLiteral)
407
+ end
408
+
409
+ class SOAPUnsignedInt < XSD::XSDUnsignedInt
410
+ include SOAPBasetype
411
+ extend SOAPModuleUtils
412
+ SOAPENCType = QName.new(EncodingNamespace, UnsignedIntLiteral)
413
+ end
414
+
415
+ class SOAPUnsignedShort < XSD::XSDUnsignedShort
416
+ include SOAPBasetype
417
+ extend SOAPModuleUtils
418
+ SOAPENCType = QName.new(EncodingNamespace, UnsignedShortLiteral)
419
+ end
420
+
421
+ class SOAPUnsignedByte < XSD::XSDUnsignedByte
422
+ include SOAPBasetype
423
+ extend SOAPModuleUtils
424
+ SOAPENCType = QName.new(EncodingNamespace, UnsignedByteLiteral)
425
+ end
426
+
427
+ class SOAPPositiveInteger < XSD::XSDPositiveInteger
428
+ include SOAPBasetype
429
+ extend SOAPModuleUtils
430
+ SOAPENCType = QName.new(EncodingNamespace, PositiveIntegerLiteral)
431
+ end
432
+
433
+
434
+ ###
435
+ ## Compound datatypes.
436
+ #
437
+ class SOAPStruct < XSD::NSDBase
438
+ include SOAPCompoundtype
439
+ include Enumerable
440
+
441
+ public
442
+
443
+ def initialize(type = nil)
444
+ super()
445
+ @type = type || XSD::QName::EMPTY
446
+ @array = []
447
+ @data = []
448
+ end
449
+
450
+ def to_s()
451
+ str = ''
452
+ self.each do |key, data|
453
+ str << "#{key}: #{data}\n"
454
+ end
455
+ str
456
+ end
457
+
458
+ def add(name, value)
459
+ add_member(name, value)
460
+ end
461
+
462
+ def [](idx)
463
+ if idx.is_a?(Range)
464
+ @data[idx]
465
+ elsif idx.is_a?(Integer)
466
+ if (idx > @array.size)
467
+ raise ArrayIndexOutOfBoundsError.new('In ' << @type.name)
468
+ end
469
+ @data[idx]
470
+ else
471
+ if @array.include?(idx)
472
+ @data[@array.index(idx)]
473
+ else
474
+ nil
475
+ end
476
+ end
477
+ end
478
+
479
+ def []=(idx, data)
480
+ if @array.include?(idx)
481
+ data.parent = self if data.respond_to?(:parent=)
482
+ @data[@array.index(idx)] = data
483
+ else
484
+ add(idx, data)
485
+ end
486
+ end
487
+
488
+ def key?(name)
489
+ @array.include?(name)
490
+ end
491
+
492
+ def members
493
+ @array
494
+ end
495
+
496
+ def to_obj
497
+ hash = {}
498
+ proptype = {}
499
+ each do |k, v|
500
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
501
+ case proptype[k]
502
+ when :single
503
+ hash[k] = [hash[k], value]
504
+ proptype[k] = :multi
505
+ when :multi
506
+ hash[k] << value
507
+ else
508
+ hash[k] = value
509
+ proptype[k] = :single
510
+ end
511
+ end
512
+ hash
513
+ end
514
+
515
+ def each
516
+ idx = 0
517
+ while idx < @array.length
518
+ yield(@array[idx], @data[idx])
519
+ idx += 1
520
+ end
521
+ end
522
+
523
+ def replace
524
+ members.each do |member|
525
+ self[member] = yield(self[member])
526
+ end
527
+ end
528
+
529
+ def self.decode(elename, type)
530
+ s = SOAPStruct.new(type)
531
+ s.elename = elename
532
+ s
533
+ end
534
+
535
+ private
536
+
537
+ def add_member(name, value = nil)
538
+ value = SOAPNil.new if value.nil?
539
+ @array.push(name)
540
+ value.elename = value.elename.dup_name(name)
541
+ @data.push(value)
542
+ value.parent = self if value.respond_to?(:parent=)
543
+ value
544
+ end
545
+ end
546
+
547
+
548
+ # SOAPElement is not typed so it is not derived from NSDBase.
549
+ class SOAPElement
550
+ include Enumerable
551
+
552
+ attr_accessor :encodingstyle
553
+
554
+ attr_accessor :elename
555
+ attr_accessor :id
556
+ attr_reader :precedents
557
+ attr_accessor :root
558
+ attr_accessor :parent
559
+ attr_accessor :position
560
+ attr_accessor :extraattr
561
+
562
+ attr_accessor :qualified
563
+
564
+ def initialize(elename, text = nil)
565
+ if !elename.is_a?(XSD::QName)
566
+ elename = XSD::QName.new(nil, elename)
567
+ end
568
+ @encodingstyle = LiteralNamespace
569
+ @elename = elename
570
+ @id = nil
571
+ @precedents = []
572
+ @root = false
573
+ @parent = nil
574
+ @position = nil
575
+ @extraattr = {}
576
+
577
+ @qualified = nil
578
+
579
+ @array = []
580
+ @data = []
581
+ @text = text
582
+ end
583
+
584
+ def inspect
585
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename) +
586
+ (@text ? " #{@text.inspect}" : '') +
587
+ @data.collect { |ele| "\n#{ele.inspect}" }.join.gsub(/^/, ' ')
588
+ end
589
+
590
+ # Text interface.
591
+ attr_accessor :text
592
+ alias data text
593
+
594
+ # Element interfaces.
595
+ def add(value)
596
+ add_member(value.elename.name, value)
597
+ end
598
+
599
+ def [](idx)
600
+ if @array.include?(idx)
601
+ @data[@array.index(idx)]
602
+ else
603
+ nil
604
+ end
605
+ end
606
+
607
+ def []=(idx, data)
608
+ if @array.include?(idx)
609
+ data.parent = self if data.respond_to?(:parent=)
610
+ @data[@array.index(idx)] = data
611
+ else
612
+ add(data)
613
+ end
614
+ end
615
+
616
+ def key?(name)
617
+ @array.include?(name)
618
+ end
619
+
620
+ def members
621
+ @array
622
+ end
623
+
624
+ def to_obj
625
+ if members.empty?
626
+ @text
627
+ else
628
+ hash = {}
629
+ proptype = {}
630
+ each do |k, v|
631
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
632
+ case proptype[k]
633
+ when :single
634
+ hash[k] = [hash[k], value]
635
+ proptype[k] = :multi
636
+ when :multi
637
+ hash[k] << value
638
+ else
639
+ hash[k] = value
640
+ proptype[k] = :single
641
+ end
642
+ end
643
+ hash
644
+ end
645
+ end
646
+
647
+ def each
648
+ idx = 0
649
+ while idx < @array.length
650
+ yield(@array[idx], @data[idx])
651
+ idx += 1
652
+ end
653
+ end
654
+
655
+ def self.decode(elename)
656
+ o = SOAPElement.new(elename)
657
+ o
658
+ end
659
+
660
+ def self.from_objs(objs)
661
+ objs.collect { |value|
662
+ if value.is_a?(SOAPElement)
663
+ value
664
+ else
665
+ k, v = value
666
+ ele = from_obj(v)
667
+ ele.elename = XSD::QName.new(nil, k)
668
+ ele
669
+ end
670
+ }
671
+ end
672
+
673
+ def self.from_obj(obj, namespace = nil)
674
+ o = SOAPElement.new(nil)
675
+ case obj
676
+ when nil
677
+ o.text = nil
678
+ when Hash, Array
679
+ obj.each do |elename, value|
680
+ if value.is_a?(Array)
681
+ value.each do |subvalue|
682
+ child = from_obj(subvalue, namespace)
683
+ child.elename = to_elename(elename, namespace)
684
+ o.add(child)
685
+ end
686
+ else
687
+ child = from_obj(value, namespace)
688
+ child.elename = to_elename(elename, namespace)
689
+ o.add(child)
690
+ end
691
+ end
692
+ else
693
+ o.text = obj.to_s
694
+ end
695
+ o
696
+ end
697
+
698
+ def self.to_elename(obj, namespace = nil)
699
+ if obj.is_a?(XSD::QName)
700
+ obj
701
+ elsif /\A(.+):([^:]+)\z/ =~ obj.to_s
702
+ XSD::QName.new($1, $2)
703
+ else
704
+ XSD::QName.new(namespace, obj.to_s)
705
+ end
706
+ end
707
+
708
+ private
709
+
710
+ def add_member(name, value)
711
+ add_accessor(name)
712
+ @array.push(name)
713
+ @data.push(value)
714
+ value.parent = self if value.respond_to?(:parent=)
715
+ value
716
+ end
717
+
718
+ # Mapping.define_singleton_method calls define_method with proc and it
719
+ # exhausts much memory for each singleton Object. just instance_eval instead
720
+ # of it.
721
+ def add_accessor(name)
722
+ # untaint depends GenSupport.safemethodname
723
+ methodname = XSD::CodeGen::GenSupport.safemethodname(name).untaint
724
+ # untaint depends String#dump and Array#index
725
+ namedump = name.dump.untaint
726
+ unless self.respond_to?(methodname)
727
+ instance_eval <<-EOS
728
+ def #{methodname}
729
+ @data[@array.index(#{namedump})]
730
+ end
731
+ EOS
732
+ end
733
+ unless self.respond_to?(methodname + "=")
734
+ instance_eval <<-EOS
735
+ def #{methodname}=(value)
736
+ @data[@array.index(#{namedump})] = value
737
+ end
738
+ EOS
739
+ end
740
+ end
741
+ end
742
+
743
+
744
+ class SOAPArray < XSD::NSDBase
745
+ include SOAPCompoundtype
746
+ include Enumerable
747
+
748
+ public
749
+
750
+ attr_accessor :sparse
751
+
752
+ attr_reader :offset, :rank
753
+ attr_accessor :size, :size_fixed
754
+ attr_reader :arytype
755
+
756
+ def initialize(type = nil, rank = 1, arytype = nil)
757
+ super()
758
+ @type = type || ValueArrayName
759
+ @rank = rank
760
+ @data = Array.new
761
+ @sparse = false
762
+ @offset = Array.new(rank, 0)
763
+ @size = Array.new(rank, 0)
764
+ @size_fixed = false
765
+ @position = nil
766
+ @arytype = arytype
767
+ end
768
+
769
+ def offset=(var)
770
+ @offset = var
771
+ @sparse = true
772
+ end
773
+
774
+ def add(value)
775
+ self[*(@offset)] = value
776
+ end
777
+
778
+ def [](*idxary)
779
+ if idxary.size != @rank
780
+ raise ArgumentError.new("given #{idxary.size} params does not match rank: #{@rank}")
781
+ end
782
+
783
+ retrieve(idxary)
784
+ end
785
+
786
+ def []=(*idxary)
787
+ value = idxary.slice!(-1)
788
+
789
+ if idxary.size != @rank
790
+ raise ArgumentError.new("given #{idxary.size} params(#{idxary})" +
791
+ " does not match rank: #{@rank}")
792
+ end
793
+
794
+ idx = 0
795
+ while idx < idxary.size
796
+ if idxary[idx] + 1 > @size[idx]
797
+ @size[idx] = idxary[idx] + 1
798
+ end
799
+ idx += 1
800
+ end
801
+
802
+ data = retrieve(idxary[0, idxary.size - 1])
803
+ data[idxary.last] = value
804
+
805
+ if value.is_a?(SOAPType)
806
+ value.elename = ITEM_NAME
807
+ # Sync type
808
+ unless @type.name
809
+ @type = XSD::QName.new(value.type.namespace,
810
+ SOAPArray.create_arytype(value.type.name, @rank))
811
+ end
812
+ value.type ||= @type
813
+ end
814
+
815
+ @offset = idxary
816
+ value.parent = self if value.respond_to?(:parent=)
817
+ offsetnext
818
+ end
819
+
820
+ def each
821
+ @data.each do |data|
822
+ yield(data)
823
+ end
824
+ end
825
+
826
+ def to_a
827
+ @data.dup
828
+ end
829
+
830
+ def replace
831
+ @data = deep_map(@data) do |ele|
832
+ yield(ele)
833
+ end
834
+ end
835
+
836
+ def deep_map(ary, &block)
837
+ ary.collect do |ele|
838
+ if ele.is_a?(Array)
839
+ deep_map(ele, &block)
840
+ else
841
+ new_obj = block.call(ele)
842
+ new_obj.elename = ITEM_NAME
843
+ new_obj
844
+ end
845
+ end
846
+ end
847
+
848
+ def include?(var)
849
+ traverse_data(@data) do |v, *rank|
850
+ if v.is_a?(SOAPBasetype) && v.data == var
851
+ return true
852
+ end
853
+ end
854
+ false
855
+ end
856
+
857
+ def traverse
858
+ traverse_data(@data) do |v, *rank|
859
+ unless @sparse
860
+ yield(v)
861
+ else
862
+ yield(v, *rank) if v && !v.is_a?(SOAPNil)
863
+ end
864
+ end
865
+ end
866
+
867
+ def soap2array(ary)
868
+ traverse_data(@data) do |v, *position|
869
+ iteary = ary
870
+ rank = 1
871
+ while rank < position.size
872
+ idx = position[rank - 1]
873
+ if iteary[idx].nil?
874
+ iteary = iteary[idx] = Array.new
875
+ else
876
+ iteary = iteary[idx]
877
+ end
878
+ rank += 1
879
+ end
880
+ if block_given?
881
+ iteary[position.last] = yield(v)
882
+ else
883
+ iteary[position.last] = v
884
+ end
885
+ end
886
+ end
887
+
888
+ def position
889
+ @position
890
+ end
891
+
892
+ private
893
+
894
+ ITEM_NAME = XSD::QName.new(nil, 'item')
895
+
896
+ def retrieve(idxary)
897
+ data = @data
898
+ rank = 1
899
+ while rank <= idxary.size
900
+ idx = idxary[rank - 1]
901
+ if data[idx].nil?
902
+ data = data[idx] = Array.new
903
+ else
904
+ data = data[idx]
905
+ end
906
+ rank += 1
907
+ end
908
+ data
909
+ end
910
+
911
+ def traverse_data(data, rank = 1)
912
+ idx = 0
913
+ while idx < ranksize(rank)
914
+ if rank < @rank
915
+ traverse_data(data[idx], rank + 1) do |*v|
916
+ v[1, 0] = idx
917
+ yield(*v)
918
+ end
919
+ else
920
+ yield(data[idx], idx)
921
+ end
922
+ idx += 1
923
+ end
924
+ end
925
+
926
+ def ranksize(rank)
927
+ @size[rank - 1]
928
+ end
929
+
930
+ def offsetnext
931
+ move = false
932
+ idx = @offset.size - 1
933
+ while !move && idx >= 0
934
+ @offset[idx] += 1
935
+ if @size_fixed
936
+ if @offset[idx] < @size[idx]
937
+ move = true
938
+ else
939
+ @offset[idx] = 0
940
+ idx -= 1
941
+ end
942
+ else
943
+ move = true
944
+ end
945
+ end
946
+ end
947
+
948
+ # Module function
949
+
950
+ public
951
+
952
+ def self.decode(elename, type, arytype)
953
+ typestr, nofary = parse_type(arytype.name)
954
+ rank = nofary.count(',') + 1
955
+ plain_arytype = XSD::QName.new(arytype.namespace, typestr)
956
+ o = SOAPArray.new(type, rank, plain_arytype)
957
+ size = []
958
+ nofary.split(',').each do |s|
959
+ if s.empty?
960
+ size.clear
961
+ break
962
+ else
963
+ size << s.to_i
964
+ end
965
+ end
966
+ unless size.empty?
967
+ o.size = size
968
+ o.size_fixed = true
969
+ end
970
+ o.elename = elename
971
+ o
972
+ end
973
+
974
+ private
975
+
976
+ def self.create_arytype(typename, rank)
977
+ "#{typename}[" << ',' * (rank - 1) << ']'
978
+ end
979
+
980
+ TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$')
981
+
982
+ def self.parse_type(string)
983
+ TypeParseRegexp =~ string
984
+ return $1, $2
985
+ end
986
+ end
987
+
988
+
989
+ require 'soap/mapping/typeMap'
990
+
991
+
992
+ end