soap4r 1.5.5.20061022 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. data/bin/wsdl2ruby.rb +8 -8
  2. data/lib/soap/XMLSchemaDatatypes.rb +1 -1
  3. data/lib/soap/XMLSchemaDatatypes1999.rb +1 -1
  4. data/lib/soap/attachment.rb +1 -1
  5. data/lib/soap/baseData.rb +102 -54
  6. data/lib/soap/cgistub.rb +1 -1
  7. data/lib/soap/charset.rb +1 -1
  8. data/lib/soap/driver.rb +1 -1
  9. data/lib/soap/element.rb +20 -12
  10. data/lib/soap/encodingstyle/aspDotNetHandler.rb +2 -2
  11. data/lib/soap/encodingstyle/handler.rb +1 -1
  12. data/lib/soap/encodingstyle/literalHandler.rb +29 -73
  13. data/lib/soap/encodingstyle/soapHandler.rb +8 -7
  14. data/lib/soap/filter.rb +10 -0
  15. data/lib/soap/filter/filterchain.rb +51 -0
  16. data/lib/soap/filter/handler.rb +31 -0
  17. data/lib/soap/generator.rb +11 -3
  18. data/lib/soap/header/handler.rb +6 -5
  19. data/lib/soap/header/handlerset.rb +7 -7
  20. data/lib/soap/header/simplehandler.rb +1 -1
  21. data/lib/soap/httpconfigloader.rb +7 -2
  22. data/lib/soap/mapping.rb +1 -1
  23. data/lib/soap/mapping/encodedregistry.rb +36 -26
  24. data/lib/soap/mapping/encodedregistry.rb~ +531 -0
  25. data/lib/soap/mapping/factory.rb +2 -2
  26. data/lib/soap/mapping/literalregistry.rb +107 -67
  27. data/lib/soap/mapping/mapping.rb +92 -112
  28. data/lib/soap/mapping/registry.rb +25 -8
  29. data/lib/soap/mapping/rubytypeFactory.rb +1 -1
  30. data/lib/soap/mapping/schemadefinition.rb +163 -0
  31. data/lib/soap/mapping/typeMap.rb +7 -1
  32. data/lib/soap/mapping/wsdlencodedregistry.rb +2 -2
  33. data/lib/soap/mapping/wsdlliteralregistry.rb +14 -23
  34. data/lib/soap/mappingRegistry.rb +1 -1
  35. data/lib/soap/marshal.rb +1 -1
  36. data/lib/soap/namespace.rb +1 -1
  37. data/lib/soap/netHttpClient.rb +43 -13
  38. data/lib/soap/parser.rb +40 -42
  39. data/lib/soap/processor.rb +1 -1
  40. data/lib/soap/property.rb +7 -7
  41. data/lib/soap/proxy.rb +1 -1
  42. data/lib/soap/qname.rb +1 -1
  43. data/lib/soap/rpc/cgistub.rb +34 -1
  44. data/lib/soap/rpc/driver.rb +2 -1
  45. data/lib/soap/rpc/element.rb +42 -15
  46. data/lib/soap/rpc/httpserver.rb +13 -1
  47. data/lib/soap/rpc/proxy.rb +51 -41
  48. data/lib/soap/rpc/router.rb +88 -33
  49. data/lib/soap/rpc/rpc.rb +1 -1
  50. data/lib/soap/rpc/soaplet.rb +51 -3
  51. data/lib/soap/rpc/standaloneServer.rb +1 -1
  52. data/lib/soap/rpcRouter.rb +1 -1
  53. data/lib/soap/rpcUtils.rb +1 -1
  54. data/lib/soap/server.rb +1 -1
  55. data/lib/soap/soap.rb +2 -2
  56. data/lib/soap/standaloneServer.rb +1 -1
  57. data/lib/soap/streamHandler.rb +13 -4
  58. data/lib/soap/wsdlDriver.rb +11 -15
  59. data/lib/tags +5144 -0
  60. data/lib/wsdl/binding.rb +1 -1
  61. data/lib/wsdl/data.rb +1 -1
  62. data/lib/wsdl/definitions.rb +1 -1
  63. data/lib/wsdl/documentation.rb +1 -1
  64. data/lib/wsdl/import.rb +1 -1
  65. data/lib/wsdl/importer.rb +1 -1
  66. data/lib/wsdl/info.rb +1 -1
  67. data/lib/wsdl/message.rb +1 -1
  68. data/lib/wsdl/operation.rb +10 -7
  69. data/lib/wsdl/operationBinding.rb +19 -5
  70. data/lib/wsdl/param.rb +11 -3
  71. data/lib/wsdl/parser.rb +4 -3
  72. data/lib/wsdl/part.rb +1 -1
  73. data/lib/wsdl/port.rb +1 -1
  74. data/lib/wsdl/portType.rb +1 -1
  75. data/lib/wsdl/service.rb +1 -1
  76. data/lib/wsdl/soap/address.rb +1 -1
  77. data/lib/wsdl/soap/binding.rb +1 -1
  78. data/lib/wsdl/soap/body.rb +3 -1
  79. data/lib/wsdl/soap/cgiStubCreator.rb +1 -1
  80. data/lib/wsdl/soap/classDefCreator.rb +78 -14
  81. data/lib/wsdl/soap/classDefCreatorSupport.rb +28 -11
  82. data/lib/wsdl/soap/clientSkeltonCreator.rb +3 -2
  83. data/lib/wsdl/soap/complexType.rb +8 -11
  84. data/lib/wsdl/soap/data.rb +1 -1
  85. data/lib/wsdl/soap/definitions.rb +49 -4
  86. data/lib/wsdl/soap/driverCreator.rb +1 -1
  87. data/lib/wsdl/soap/element.rb +3 -2
  88. data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +1 -1
  89. data/lib/wsdl/soap/fault.rb +1 -1
  90. data/lib/wsdl/soap/header.rb +1 -1
  91. data/lib/wsdl/soap/headerfault.rb +1 -1
  92. data/lib/wsdl/soap/literalMappingRegistryCreator.rb +41 -21
  93. data/lib/wsdl/soap/mappingRegistryCreator.rb +2 -1
  94. data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +45 -19
  95. data/lib/wsdl/soap/methodDefCreator.rb +28 -17
  96. data/lib/wsdl/soap/operation.rb +11 -11
  97. data/lib/wsdl/soap/servantSkeltonCreator.rb +3 -2
  98. data/lib/wsdl/soap/standaloneServerStubCreator.rb +1 -1
  99. data/lib/wsdl/soap/wsdl2ruby.rb +8 -2
  100. data/lib/wsdl/types.rb +1 -1
  101. data/lib/wsdl/wsdl.rb +1 -1
  102. data/lib/wsdl/xmlSchema/all.rb +1 -1
  103. data/lib/wsdl/xmlSchema/annotation.rb +1 -1
  104. data/lib/wsdl/xmlSchema/any.rb +10 -5
  105. data/lib/wsdl/xmlSchema/attribute.rb +1 -1
  106. data/lib/wsdl/xmlSchema/choice.rb +1 -1
  107. data/lib/wsdl/xmlSchema/complexContent.rb +11 -2
  108. data/lib/wsdl/xmlSchema/complexExtension.rb +8 -1
  109. data/lib/wsdl/xmlSchema/complexRestriction.rb +6 -2
  110. data/lib/wsdl/xmlSchema/complexType.rb +9 -1
  111. data/lib/wsdl/xmlSchema/content.rb +26 -5
  112. data/lib/wsdl/xmlSchema/data.rb +4 -1
  113. data/lib/wsdl/xmlSchema/element.rb +12 -9
  114. data/lib/wsdl/xmlSchema/enumeration.rb +1 -1
  115. data/lib/wsdl/xmlSchema/import.rb +1 -1
  116. data/lib/wsdl/xmlSchema/importer.rb +9 -6
  117. data/lib/wsdl/xmlSchema/include.rb +1 -1
  118. data/lib/wsdl/xmlSchema/length.rb +1 -1
  119. data/lib/wsdl/xmlSchema/list.rb +1 -1
  120. data/lib/wsdl/xmlSchema/maxlength.rb +1 -1
  121. data/lib/wsdl/xmlSchema/minlength.rb +1 -1
  122. data/lib/wsdl/xmlSchema/parser.rb +4 -3
  123. data/lib/wsdl/xmlSchema/pattern.rb +1 -1
  124. data/lib/wsdl/xmlSchema/schema.rb +1 -1
  125. data/lib/wsdl/xmlSchema/sequence.rb +1 -1
  126. data/lib/wsdl/xmlSchema/simpleContent.rb +1 -1
  127. data/lib/wsdl/xmlSchema/simpleExtension.rb +1 -1
  128. data/lib/wsdl/xmlSchema/simpleRestriction.rb +1 -1
  129. data/lib/wsdl/xmlSchema/simpleType.rb +8 -1
  130. data/lib/wsdl/xmlSchema/union.rb +35 -0
  131. data/lib/wsdl/xmlSchema/unique.rb +1 -1
  132. data/lib/wsdl/xmlSchema/xsd2ruby.rb +6 -1
  133. data/lib/xsd/charset.rb +1 -1
  134. data/lib/xsd/classloader.rb +26 -0
  135. data/lib/xsd/codegen.rb +1 -1
  136. data/lib/xsd/codegen/classdef.rb +1 -1
  137. data/lib/xsd/codegen/commentdef.rb +1 -1
  138. data/lib/xsd/codegen/gensupport.rb +119 -14
  139. data/lib/xsd/codegen/methoddef.rb +1 -1
  140. data/lib/xsd/codegen/moduledef.rb +1 -1
  141. data/lib/xsd/datatypes.rb +52 -13
  142. data/lib/xsd/datatypes1999.rb +1 -1
  143. data/lib/xsd/iconvcharset.rb +1 -1
  144. data/lib/xsd/mapping.rb +1 -1
  145. data/lib/xsd/namedelements.rb +1 -1
  146. data/lib/xsd/ns.rb +2 -2
  147. data/lib/xsd/qname.rb +1 -1
  148. data/lib/xsd/xmlparser.rb +16 -3
  149. data/lib/xsd/xmlparser/parser.rb +6 -2
  150. data/lib/xsd/xmlparser/rexmlparser.rb +5 -1
  151. data/lib/xsd/xmlparser/xmlparser.rb +1 -1
  152. data/lib/xsd/xmlparser/xmlscanner.rb +4 -2
  153. data/test/interopR2/InteropTest.rb +83 -0
  154. data/test/interopR2/InteropTest.wsdl +315 -0
  155. data/test/interopR2/InteropTestC.wsdl +208 -0
  156. data/test/interopR2/InteropTestDriver.rb +328 -0
  157. data/test/interopR2/SOAP4R_SOAPBuildersInteropTest_R2.wsdl +461 -0
  158. data/test/interopR2/SOAP4R_SOAPBuildersInteropTest_R2GroupB.wsdl +20 -0
  159. data/test/interopR2/SOAP4R_SOAPBuildersInteropTest_R2GroupCClient.rb +178 -0
  160. data/test/interopR2/SOAPBuildersInterop_R2GrC.wsdl +17 -0
  161. data/test/interopR2/clientBase.rb +0 -3
  162. data/test/interopR2/groupc.wsdl +17 -0
  163. data/test/interopR2/result_client.NetRemoting.txt +0 -4593
  164. data/test/interopR2/test.sh +9 -9
  165. data/test/runner.rb +1 -3
  166. data/test/soap/asp.net/test_aspdotnet.rb +20 -9
  167. data/test/soap/case/test_mapping.rb +57 -0
  168. data/test/soap/filter/test_filter.rb +146 -0
  169. data/test/soap/literalArrayMapping/test_definedarray.rb +7 -9
  170. data/test/soap/marshal/marshaltestlib.rb +1 -1
  171. data/test/soap/ssl/test_ssl.rb +0 -10
  172. data/test/soap/struct/test_struct.rb +2 -9
  173. data/test/soap/test_basetype.rb +114 -0
  174. data/test/soap/test_empty.rb +26 -2
  175. data/test/soap/test_envelopenamespace.rb +2 -9
  176. data/test/soap/test_extraattr.rb +55 -0
  177. data/test/soap/test_httpconfigloader.rb +17 -0
  178. data/test/soap/test_property.rb +4 -1
  179. data/test/soap/test_response_as_xml.rb +31 -9
  180. data/test/soap/test_soapelement.rb +21 -3
  181. data/test/soap/test_streamhandler.rb +3 -10
  182. data/test/soap/test_styleuse.rb +2 -9
  183. data/test/soap/wsdlDriver/test_calc.rb +3 -20
  184. data/test/soap/wsdlDriver/test_document.rb +2 -9
  185. data/test/soap/wsdlDriver/test_simpletype.rb +2 -9
  186. data/test/testutil.rb +54 -0
  187. data/test/wsdl/abstract/abstract.wsdl +82 -3
  188. data/test/wsdl/abstract/test_abstract.rb +48 -19
  189. data/test/wsdl/any/any.wsdl +63 -0
  190. data/test/wsdl/any/expectedDriver.rb +22 -1
  191. data/test/wsdl/any/expectedEcho.rb +19 -0
  192. data/test/wsdl/any/expectedService.rb +29 -4
  193. data/test/wsdl/any/test_any.rb +36 -31
  194. data/test/wsdl/choice/choice.wsdl +37 -0
  195. data/test/wsdl/choice/test_choice.rb +66 -17
  196. data/test/wsdl/complexcontent/test_echo.rb +7 -18
  197. data/test/wsdl/document/array/test_array.rb +8 -18
  198. data/test/wsdl/document/ping_nosoapaction.wsdl +1 -1
  199. data/test/wsdl/document/test_nosoapaction.rb +2 -9
  200. data/test/wsdl/document/test_number.rb +3 -10
  201. data/test/wsdl/document/test_rpc.rb +96 -21
  202. data/test/wsdl/fault/fault.wsdl +79 -0
  203. data/test/wsdl/fault/multifault.wsdl +96 -0
  204. data/test/wsdl/fault/test_fault.rb +119 -0
  205. data/test/wsdl/fault/test_multifault.rb +134 -0
  206. data/test/wsdl/list/test_list.rb +6 -16
  207. data/test/wsdl/marshal/test_wsdlmarshal.rb +10 -13
  208. data/test/wsdl/oneway/oneway.wsdl +36 -0
  209. data/test/wsdl/oneway/test_oneway.rb +108 -0
  210. data/test/wsdl/overload/test_overload.rb +3 -10
  211. data/test/wsdl/qualified/test_qualified.rb +9 -17
  212. data/test/wsdl/qualified/test_unqualified.rb +14 -21
  213. data/test/wsdl/ref/expectedDriver.rb +51 -0
  214. data/test/wsdl/ref/expectedProduct.rb +71 -71
  215. data/test/wsdl/ref/test_ref.rb +13 -35
  216. data/test/wsdl/rpc/rpc.wsdl +27 -1
  217. data/test/wsdl/rpc/test-rpc-lit-qualified.wsdl +74 -0
  218. data/test/wsdl/rpc/test-rpc-lit.wsdl +11 -4
  219. data/test/wsdl/rpc/test-rpc-lit12.wsdl +455 -0
  220. data/test/wsdl/rpc/test_rpc.rb +20 -19
  221. data/test/wsdl/rpc/test_rpc_lit.rb +82 -29
  222. data/test/wsdl/simplecontent/simplecontent.wsdl +1 -0
  223. data/test/wsdl/simplecontent/test_simplecontent.rb +5 -19
  224. data/test/wsdl/simpletype/rpc/expectedDriver.rb +6 -4
  225. data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +15 -0
  226. data/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb +64 -0
  227. data/test/wsdl/simpletype/rpc/expectedService.rb +6 -4
  228. data/test/wsdl/simpletype/rpc/rpc.wsdl +18 -0
  229. data/test/wsdl/simpletype/rpc/test_rpc.rb +6 -16
  230. data/test/wsdl/simpletype/simpletype.wsdl +19 -0
  231. data/test/wsdl/simpletype/test_simpletype.rb +2 -9
  232. data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +6 -4
  233. data/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb +40 -0
  234. data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +6 -4
  235. data/test/wsdl/soap/wsdl2ruby/expectedService.rb +6 -4
  236. data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +5 -6
  237. data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +3 -16
  238. data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +9 -17
  239. data/test/wsdl/soaptype/test_soaptype.rb +29 -11
  240. data/test/xsd/test_xsd.rb +115 -1
  241. metadata +421 -454
  242. data/test/interopR2/client.NetRemoting.rb.result +0 -3410
  243. data/test/interopR2/client.NetRemoting_Base.log +0 -6279
  244. data/test/interopR2/client.NetRemoting_GroupB.log +0 -1188
  245. data/test/interopR2/client4S4C2_Base.log +0 -4955
  246. data/test/interopR2/client4S4C2_GroupB.log +0 -1000
  247. data/test/interopR2/client4S4C_Base.log +0 -4635
  248. data/test/interopR2/client4S4C_GroupB.log +0 -900
  249. data/test/interopR2/clientASP.NET_Base.log +0 -5468
  250. data/test/interopR2/clientASP.NET_GroupB.log +0 -977
  251. data/test/interopR2/clientApacheAxis_Base.log +0 -3171
  252. data/test/interopR2/clientApacheAxis_GroupB.log +0 -498
  253. data/test/interopR2/clientApacheSOAP_Base.log +0 -3171
  254. data/test/interopR2/clientBEAWebLogic_Base.log +0 -3171
  255. data/test/interopR2/clientBEAWebLogic_GroupB.log +0 -498
  256. data/test/interopR2/clientCapeConnect_Base.log +0 -2126
  257. data/test/interopR2/clientDelphi_Base.log +0 -0
  258. data/test/interopR2/clientEasySoap_Base.log +0 -6187
  259. data/test/interopR2/clientEasySoap_GroupB.log +0 -1076
  260. data/test/interopR2/clientFrontier_Base.log +0 -5188
  261. data/test/interopR2/clientHP_Base.log +0 -3171
  262. data/test/interopR2/clientHP_GroupB.log +0 -498
  263. data/test/interopR2/clientJSOAP_Base.log +0 -4465
  264. data/test/interopR2/clientJSOAP_GroupB.log +0 -824
  265. data/test/interopR2/clientKafkaXSLT_Base.log +0 -10299
  266. data/test/interopR2/clientKafkaXSLT_GroupB.log +0 -1739
  267. data/test/interopR2/clientMSSOAPToolkit2.0_Base.log +0 -4805
  268. data/test/interopR2/clientMSSOAPToolkit2.0_GroupB.log +0 -871
  269. data/test/interopR2/clientMSSOAPToolkit3.0_Base.log +0 -5076
  270. data/test/interopR2/clientMSSOAPToolkit3.0_GroupB.log +0 -908
  271. data/test/interopR2/clientNuSOAP_Base.log +0 -5076
  272. data/test/interopR2/clientNuSOAP_GroupB.log +0 -958
  273. data/test/interopR2/clientNuWave_Base.log +0 -2019
  274. data/test/interopR2/clientOpenLink_Base.log +0 -6171
  275. data/test/interopR2/clientOpenLink_GroupB.log +0 -1094
  276. data/test/interopR2/clientOracle_Base.log +0 -5594
  277. data/test/interopR2/clientPEAR_Base.log +0 -6261
  278. data/test/interopR2/clientPEAR_GroupB.log +0 -1106
  279. data/test/interopR2/clientPhalanx_Base.log +0 -41036
  280. data/test/interopR2/clientPhalanx_GroupB.log +0 -6519
  281. data/test/interopR2/clientSIMACE_Base.log +0 -6171
  282. data/test/interopR2/clientSIMACE_GroupB.log +0 -1093
  283. data/test/interopR2/clientSOAP4R.rb.result +0 -3409
  284. data/test/interopR2/clientSOAP4R_Base.log +0 -6366
  285. data/test/interopR2/clientSOAP4R_GroupB.log +0 -1112
  286. data/test/interopR2/clientSQLData_Base.log +0 -4857
  287. data/test/interopR2/clientSQLData_GroupB.log +0 -770
  288. data/test/interopR2/clientSilverStream_Base.log +0 -3171
  289. data/test/interopR2/clientSpray2001_Base.log +0 -8187
  290. data/test/interopR2/clientSpray2001_GroupB.log +0 -1408
  291. data/test/interopR2/clientSun_Base.log +0 -4641
  292. data/test/interopR2/clientSun_GroupB.log +0 -856
  293. data/test/interopR2/clientVWOpentalkSoap_Base.log +0 -5402
  294. data/test/interopR2/clientVWOpentalkSoap_GroupB.log +0 -972
  295. data/test/interopR2/clientWASPC_Base.log +0 -4187
  296. data/test/interopR2/clientWASPC_GroupB.log +0 -763
  297. data/test/interopR2/clientWASP_Base.log +0 -5414
  298. data/test/interopR2/clientWASP_GroupB.log +0 -970
  299. data/test/interopR2/clientWebMethods_Base.log +0 -3075
  300. data/test/interopR2/clientWebMethods_GroupB.log +0 -483
  301. data/test/interopR2/clientWhiteMesa_Base.log +0 -4359
  302. data/test/interopR2/clientWhiteMesa_GroupB.log +0 -808
  303. data/test/interopR2/clientWingfoot_Base.log +0 -4445
  304. data/test/interopR2/clientWingfoot_GroupB.log +0 -848
  305. data/test/interopR2/clientXMLBus_Base.log +0 -3075
  306. data/test/interopR2/clientXMLBus_GroupB.log +0 -483
  307. data/test/interopR2/clientXSOAP_Base.log +0 -4445
  308. data/test/interopR2/clienteSOAP_Base.log +0 -8728
  309. data/test/interopR2/clientgSOAP_Base.log +0 -4689
  310. data/test/interopR2/clientgSOAP_GroupB.log +0 -1014
  311. data/test/interopR2/clientkSOAP_Base.log +0 -5625
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema complexType extension definition for WSDL.
2
- # Copyright (C) 2005, 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -49,6 +49,13 @@ class ComplexExtension < Info
49
49
  result
50
50
  end
51
51
 
52
+ def nested_elements
53
+ result = XSD::NamedElements.new
54
+ result.concat(basetype.nested_elements)
55
+ result.concat(content.nested_elements) if content
56
+ result
57
+ end
58
+
52
59
  def attributes
53
60
  basetype.attributes + @attributes
54
61
  end
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema complexType restriction definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -47,11 +47,15 @@ class ComplexRestriction < Info
47
47
  @content ? @content.elements : XSD::NamedElements::Empty
48
48
  end
49
49
 
50
+ def nested_elements
51
+ @content ? @content.nested_elements : XSD::NamedElements::Empty
52
+ end
53
+
50
54
  def check_type
51
55
  if @base == ::SOAP::ValueArrayName
52
56
  :TYPE_ARRAY
53
57
  else
54
- basetype.check_type
58
+ basetype.check_type if basetype
55
59
  end
56
60
  end
57
61
 
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema complexType definition for WSDL.
2
- # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -80,6 +80,14 @@ class ComplexType < Info
80
80
  end
81
81
  end
82
82
 
83
+ def nested_elements
84
+ if c = @complexcontent || @content
85
+ c.nested_elements
86
+ else
87
+ XSD::NamedElements::Empty
88
+ end
89
+ end
90
+
83
91
  def find_element(name)
84
92
  return nil if name.nil?
85
93
  elements.each do |element|
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema content base definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -20,8 +20,8 @@ class Content < Info
20
20
 
21
21
  def initialize
22
22
  super()
23
- @minoccurs = '1'
24
- @maxoccurs = '1'
23
+ @minoccurs = 1
24
+ @maxoccurs = 1
25
25
  @elements = XSD::NamedElements.new
26
26
  end
27
27
 
@@ -41,6 +41,22 @@ class Content < Info
41
41
  false
42
42
  end
43
43
 
44
+ def map_as_array?
45
+ maxoccurs.nil? or maxoccurs != 1
46
+ end
47
+
48
+ def nested_elements
49
+ elements = XSD::NamedElements.new
50
+ @elements.each do |ele|
51
+ if ele.respond_to?(:nested_elements)
52
+ elements.concat(ele.nested_elements)
53
+ else
54
+ elements << ele
55
+ end
56
+ end
57
+ elements
58
+ end
59
+
44
60
  def <<(element)
45
61
  @elements << element
46
62
  end
@@ -60,9 +76,14 @@ class Content < Info
60
76
  def parse_attr(attr, value)
61
77
  case attr
62
78
  when MaxOccursAttrName
63
- @maxoccurs = value.source
79
+ if value.source == 'unbounded'
80
+ @maxoccurs = nil
81
+ else
82
+ @maxoccurs = Integer(value.source)
83
+ end
84
+ value.source
64
85
  when MinOccursAttrName
65
- @minoccurs = value.source
86
+ @minoccurs = Integer(value.source)
66
87
  else
67
88
  nil
68
89
  end
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema data definitions.
2
- # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -26,6 +26,7 @@ require 'wsdl/xmlSchema/choice'
26
26
  require 'wsdl/xmlSchema/sequence'
27
27
  require 'wsdl/xmlSchema/list'
28
28
  require 'wsdl/xmlSchema/attribute'
29
+ require 'wsdl/xmlSchema/union'
29
30
  require 'wsdl/xmlSchema/unique'
30
31
  require 'wsdl/xmlSchema/enumeration'
31
32
  require 'wsdl/xmlSchema/length'
@@ -59,6 +60,7 @@ SequenceName = XSD::QName.new(XSD::Namespace, 'sequence')
59
60
  SchemaName = XSD::QName.new(XSD::Namespace, 'schema')
60
61
  SimpleContentName = XSD::QName.new(XSD::Namespace, 'simpleContent')
61
62
  SimpleTypeName = XSD::QName.new(XSD::Namespace, 'simpleType')
63
+ UnionName = XSD::QName.new(XSD::Namespace, 'union')
62
64
  UniqueName = XSD::QName.new(XSD::Namespace, 'unique')
63
65
 
64
66
  AbstractAttrName = XSD::QName.new(nil, 'abstract')
@@ -72,6 +74,7 @@ FormAttrName = XSD::QName.new(nil, 'form')
72
74
  IdAttrName = XSD::QName.new(nil, 'id')
73
75
  ItemTypeAttrName = XSD::QName.new(nil, 'itemType')
74
76
  MaxOccursAttrName = XSD::QName.new(nil, 'maxOccurs')
77
+ MemberTypesAttrName = XSD::QName.new(nil, 'memberTypes')
75
78
  MinOccursAttrName = XSD::QName.new(nil, 'minOccurs')
76
79
  MixedAttrName = XSD::QName.new(nil, 'mixed')
77
80
  NameAttrName = XSD::QName.new(nil, 'name')
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema element definition for WSDL.
2
- # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -41,8 +41,8 @@ class Element < Info
41
41
  attr_writer :local_simpletype
42
42
  attr_writer :local_complextype
43
43
  attr_writer :constraint
44
- attr_writer :maxoccurs
45
- attr_writer :minoccurs
44
+ attr_accessor :maxoccurs
45
+ attr_accessor :minoccurs
46
46
  attr_writer :nillable
47
47
 
48
48
  attr_reader_ref :name
@@ -51,8 +51,6 @@ class Element < Info
51
51
  attr_reader_ref :local_simpletype
52
52
  attr_reader_ref :local_complextype
53
53
  attr_reader_ref :constraint
54
- attr_reader_ref :maxoccurs
55
- attr_reader_ref :minoccurs
56
54
  attr_reader_ref :nillable
57
55
 
58
56
  attr_accessor :ref
@@ -64,8 +62,8 @@ class Element < Info
64
62
  @type = type
65
63
  @local_simpletype = @local_complextype = nil
66
64
  @constraint = nil
67
- @maxoccurs = '1'
68
- @minoccurs = '1'
65
+ @maxoccurs = 1
66
+ @minoccurs = 1
69
67
  @nillable = nil
70
68
  @ref = nil
71
69
  @refelement = nil
@@ -130,7 +128,12 @@ class Element < Info
130
128
  "cannot parse #{value} for #{attr}")
131
129
  end
132
130
  end
133
- @maxoccurs = value.source
131
+ if value.source == 'unbounded'
132
+ @maxoccurs = nil
133
+ else
134
+ @maxoccurs = Integer(value.source)
135
+ end
136
+ value.source
134
137
  when MinOccursAttrName
135
138
  if parent.is_a?(All)
136
139
  unless ['0', '1'].include?(value.source)
@@ -138,7 +141,7 @@ class Element < Info
138
141
  "cannot parse #{value} for #{attr}")
139
142
  end
140
143
  end
141
- @minoccurs = value.source
144
+ @minoccurs = Integer(value.source)
142
145
  when NillableAttrName
143
146
  @nillable = (value.source == 'true')
144
147
  else
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema enumeration definition for WSDL.
2
- # Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema import definition.
2
- # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XSD importer library.
2
- # Copyright (C) 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -27,8 +27,9 @@ class Importer
27
27
  unless location.is_a?(URI)
28
28
  location = URI.parse(location)
29
29
  end
30
- content = parse(fetch(location), location, originalroot)
31
- content.location = location
30
+ source, normalizedlocation = fetch(location)
31
+ content = parse(source, normalizedlocation, originalroot)
32
+ content.location = normalizedlocation
32
33
  content
33
34
  end
34
35
 
@@ -45,9 +46,11 @@ private
45
46
  def fetch(location)
46
47
  warn("importing: #{location}") if $DEBUG
47
48
  content = nil
49
+ normalizedlocation = location
48
50
  if location.scheme == 'file' or
49
51
  (location.relative? and FileTest.exist?(location.path))
50
52
  content = File.open(location.path).read
53
+ normalizedlocation = URI.parse('file://' + File.expand_path(location.path))
51
54
  elsif location.scheme and location.scheme.size == 1 and
52
55
  FileTest.exist?(location.to_s)
53
56
  # ToDo: remove this ugly workaround for a path with drive letter
@@ -58,12 +61,12 @@ private
58
61
  client.proxy = ::SOAP::Env::HTTP_PROXY
59
62
  client.no_proxy = ::SOAP::Env::NO_PROXY
60
63
  if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName)
61
- ::SOAP::HTTPConfigLoader.set_options(client,
62
- opt["client.protocol.http"])
64
+ http_opt = opt["client.protocol.http"]
65
+ ::SOAP::HTTPConfigLoader.set_options(client, http_opt) if http_opt
63
66
  end
64
67
  content = client.get_content(location)
65
68
  end
66
- content
69
+ return content, normalizedlocation
67
70
  end
68
71
 
69
72
  def web_client
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema include definition.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema length definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema list definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema maxLength definition for WSDL.
2
- # Copyright (C) 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema minLength definition for WSDL.
2
- # Copyright (C) 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - WSDL XML Instance parser library.
2
- # Copyright (C) 2002, 2003, 2005, 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -72,13 +72,14 @@ public
72
72
  lastframe = @parsestack.last
73
73
  ns = parent = nil
74
74
  if lastframe
75
- ns = lastframe.ns.clone_ns
75
+ ns = lastframe.ns
76
76
  parent = lastframe.node
77
77
  else
78
78
  ns = XSD::NS.new
79
79
  parent = nil
80
80
  end
81
- attrs = XSD::XMLParser.filter_ns(ns, attrs)
81
+ # ns might be the same
82
+ ns, attrs = XSD::XMLParser.filter_ns(ns, attrs)
82
83
  node = decode_tag(ns, name, attrs, parent)
83
84
  @parsestack << ParseFrame.new(ns, name, node)
84
85
  end
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema pattern definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema schema definition for WSDL.
2
- # Copyright (C) 2002, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema complexType definition for WSDL.
2
- # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema simpleContent definition for WSDL.
2
- # Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema simpleType extension definition for WSDL.
2
- # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema simpleContent restriction definition for WSDL.
2
- # Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -1,5 +1,5 @@
1
1
  # WSDL4R - XMLSchema simpleType definition for WSDL.
2
- # Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
2
+ # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
3
 
4
4
  # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
@@ -18,12 +18,15 @@ class SimpleType < Info
18
18
  attr_accessor :name
19
19
  attr_reader :restriction
20
20
  attr_reader :list
21
+ attr_reader :union
21
22
 
22
23
  def check_lexical_format(value)
23
24
  if @restriction
24
25
  check_restriction(value)
25
26
  elsif @list
26
27
  # TODO: check
28
+ elsif @union
29
+ # TODO: check
27
30
  else
28
31
  raise ArgumentError.new("incomplete simpleType")
29
32
  end
@@ -42,6 +45,7 @@ class SimpleType < Info
42
45
  @name = name
43
46
  @restriction = nil
44
47
  @list = nil
48
+ @union = nil
45
49
  end
46
50
 
47
51
  def targetnamespace
@@ -56,6 +60,9 @@ class SimpleType < Info
56
60
  when ListName
57
61
  @list = List.new
58
62
  @list
63
+ when UnionName
64
+ @union = Union.new
65
+ @union
59
66
  end
60
67
  end
61
68
 
@@ -0,0 +1,35 @@
1
+ # WSDL4R - XMLSchema union definition for WSDL.
2
+ # Copyright (C) 2000-2007 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 'wsdl/info'
10
+ require 'xsd/namedelements'
11
+
12
+
13
+ module WSDL
14
+ module XMLSchema
15
+
16
+
17
+ class Union < Info
18
+ attr_reader :member_types
19
+
20
+ def initialize
21
+ super
22
+ @member_types = nil
23
+ end
24
+
25
+ def parse_attr(attr, value)
26
+ case attr
27
+ when MemberTypesAttrName
28
+ @member_types = value.source
29
+ end
30
+ end
31
+ end
32
+
33
+
34
+ end
35
+ end