rubyjedi-soap4r 1.5.8.01

Sign up to get free protection for your applications and to get access to all the features.
Files changed (444) hide show
  1. data/bin/wsdl2ruby.rb +137 -0
  2. data/bin/xsd2ruby.rb +90 -0
  3. data/lib/soap/attachment.rb +108 -0
  4. data/lib/soap/attrproxy.rb +34 -0
  5. data/lib/soap/baseData.rb +1094 -0
  6. data/lib/soap/element.rb +279 -0
  7. data/lib/soap/encodingstyle/aspDotNetHandler.rb +207 -0
  8. data/lib/soap/encodingstyle/handler.rb +120 -0
  9. data/lib/soap/encodingstyle/literalHandler.rb +195 -0
  10. data/lib/soap/encodingstyle/soapHandler.rb +559 -0
  11. data/lib/soap/filter.rb +13 -0
  12. data/lib/soap/filter/filterchain.rb +51 -0
  13. data/lib/soap/filter/handler.rb +31 -0
  14. data/lib/soap/filter/streamhandler.rb +29 -0
  15. data/lib/soap/generator.rb +299 -0
  16. data/lib/soap/header/handler.rb +61 -0
  17. data/lib/soap/header/handlerset.rb +70 -0
  18. data/lib/soap/header/mappinghandler.rb +47 -0
  19. data/lib/soap/header/simplehandler.rb +44 -0
  20. data/lib/soap/httpconfigloader.rb +139 -0
  21. data/lib/soap/mapping.rb +12 -0
  22. data/lib/soap/mapping/encodedregistry.rb +537 -0
  23. data/lib/soap/mapping/factory.rb +388 -0
  24. data/lib/soap/mapping/literalregistry.rb +391 -0
  25. data/lib/soap/mapping/mapping.rb +577 -0
  26. data/lib/soap/mapping/registry.rb +310 -0
  27. data/lib/soap/mapping/rubytypeFactory.rb +446 -0
  28. data/lib/soap/mapping/schemadefinition.rb +170 -0
  29. data/lib/soap/mapping/typeMap.rb +106 -0
  30. data/lib/soap/mapping/wsdlencodedregistry.rb +211 -0
  31. data/lib/soap/mapping/wsdlliteralregistry.rb +248 -0
  32. data/lib/soap/marshal.rb +59 -0
  33. data/lib/soap/mimemessage.rb +241 -0
  34. data/lib/soap/nestedexception.rb +42 -0
  35. data/lib/soap/netHttpClient.rb +241 -0
  36. data/lib/soap/ns.rb +34 -0
  37. data/lib/soap/parser.rb +252 -0
  38. data/lib/soap/processor.rb +66 -0
  39. data/lib/soap/property.rb +333 -0
  40. data/lib/soap/proxy.rb +14 -0
  41. data/lib/soap/rpc/cgistub.rb +247 -0
  42. data/lib/soap/rpc/driver.rb +221 -0
  43. data/lib/soap/rpc/element.rb +374 -0
  44. data/lib/soap/rpc/element.rb.orig +378 -0
  45. data/lib/soap/rpc/httpserver.rb +142 -0
  46. data/lib/soap/rpc/methodDef.rb +68 -0
  47. data/lib/soap/rpc/proxy.rb +572 -0
  48. data/lib/soap/rpc/router.rb +662 -0
  49. data/lib/soap/rpc/rpc.rb +25 -0
  50. data/lib/soap/rpc/soaplet.rb +200 -0
  51. data/lib/soap/rpc/standaloneServer.rb +43 -0
  52. data/lib/soap/ruby18ext.rb +13 -0
  53. data/lib/soap/soap.rb +151 -0
  54. data/lib/soap/streamHandler.rb +301 -0
  55. data/lib/soap/wsdlDriver.rb +164 -0
  56. data/lib/wsdl/binding.rb +65 -0
  57. data/lib/wsdl/data.rb +64 -0
  58. data/lib/wsdl/definitions.rb +236 -0
  59. data/lib/wsdl/documentation.rb +32 -0
  60. data/lib/wsdl/import.rb +80 -0
  61. data/lib/wsdl/importer.rb +38 -0
  62. data/lib/wsdl/info.rb +50 -0
  63. data/lib/wsdl/message.rb +54 -0
  64. data/lib/wsdl/operation.rb +151 -0
  65. data/lib/wsdl/operationBinding.rb +240 -0
  66. data/lib/wsdl/param.rb +93 -0
  67. data/lib/wsdl/parser.rb +164 -0
  68. data/lib/wsdl/part.rb +52 -0
  69. data/lib/wsdl/port.rb +66 -0
  70. data/lib/wsdl/portType.rb +75 -0
  71. data/lib/wsdl/service.rb +61 -0
  72. data/lib/wsdl/soap/address.rb +40 -0
  73. data/lib/wsdl/soap/binding.rb +49 -0
  74. data/lib/wsdl/soap/body.rb +58 -0
  75. data/lib/wsdl/soap/cgiStubCreator.rb +92 -0
  76. data/lib/wsdl/soap/classDefCreator.rb +433 -0
  77. data/lib/wsdl/soap/classDefCreatorSupport.rb +240 -0
  78. data/lib/wsdl/soap/classNameCreator.rb +54 -0
  79. data/lib/wsdl/soap/clientSkeltonCreator.rb +104 -0
  80. data/lib/wsdl/soap/complexType.rb +173 -0
  81. data/lib/wsdl/soap/data.rb +42 -0
  82. data/lib/wsdl/soap/definitions.rb +200 -0
  83. data/lib/wsdl/soap/driverCreator.rb +118 -0
  84. data/lib/wsdl/soap/element.rb +33 -0
  85. data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +73 -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 +115 -0
  90. data/lib/wsdl/soap/mappingRegistryCreator.rb +58 -0
  91. data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +376 -0
  92. data/lib/wsdl/soap/methodDefCreator.rb +199 -0
  93. data/lib/wsdl/soap/operation.rb +112 -0
  94. data/lib/wsdl/soap/servantSkeltonCreator.rb +89 -0
  95. data/lib/wsdl/soap/servletStubCreator.rb +104 -0
  96. data/lib/wsdl/soap/standaloneServerStubCreator.rb +100 -0
  97. data/lib/wsdl/soap/wsdl2ruby.rb +217 -0
  98. data/lib/wsdl/types.rb +44 -0
  99. data/lib/wsdl/wsdl.rb +24 -0
  100. data/lib/wsdl/xmlSchema/all.rb +24 -0
  101. data/lib/wsdl/xmlSchema/annotation.rb +34 -0
  102. data/lib/wsdl/xmlSchema/any.rb +61 -0
  103. data/lib/wsdl/xmlSchema/anyAttribute.rb +48 -0
  104. data/lib/wsdl/xmlSchema/attribute.rb +104 -0
  105. data/lib/wsdl/xmlSchema/attributeGroup.rb +68 -0
  106. data/lib/wsdl/xmlSchema/choice.rb +58 -0
  107. data/lib/wsdl/xmlSchema/complexContent.rb +97 -0
  108. data/lib/wsdl/xmlSchema/complexExtension.rb +119 -0
  109. data/lib/wsdl/xmlSchema/complexRestriction.rb +104 -0
  110. data/lib/wsdl/xmlSchema/complexType.rb +193 -0
  111. data/lib/wsdl/xmlSchema/content.rb +95 -0
  112. data/lib/wsdl/xmlSchema/data.rb +116 -0
  113. data/lib/wsdl/xmlSchema/element.rb +153 -0
  114. data/lib/wsdl/xmlSchema/enumeration.rb +36 -0
  115. data/lib/wsdl/xmlSchema/fractiondigits.rb +37 -0
  116. data/lib/wsdl/xmlSchema/group.rb +100 -0
  117. data/lib/wsdl/xmlSchema/import.rb +53 -0
  118. data/lib/wsdl/xmlSchema/importHandler.rb +45 -0
  119. data/lib/wsdl/xmlSchema/importer.rb +102 -0
  120. data/lib/wsdl/xmlSchema/include.rb +48 -0
  121. data/lib/wsdl/xmlSchema/length.rb +37 -0
  122. data/lib/wsdl/xmlSchema/list.rb +48 -0
  123. data/lib/wsdl/xmlSchema/maxexclusive.rb +37 -0
  124. data/lib/wsdl/xmlSchema/maxinclusive.rb +37 -0
  125. data/lib/wsdl/xmlSchema/maxlength.rb +37 -0
  126. data/lib/wsdl/xmlSchema/minexclusive.rb +37 -0
  127. data/lib/wsdl/xmlSchema/mininclusive.rb +37 -0
  128. data/lib/wsdl/xmlSchema/minlength.rb +37 -0
  129. data/lib/wsdl/xmlSchema/parser.rb +167 -0
  130. data/lib/wsdl/xmlSchema/pattern.rb +36 -0
  131. data/lib/wsdl/xmlSchema/ref.rb +33 -0
  132. data/lib/wsdl/xmlSchema/schema.rb +178 -0
  133. data/lib/wsdl/xmlSchema/sequence.rb +54 -0
  134. data/lib/wsdl/xmlSchema/simpleContent.rb +69 -0
  135. data/lib/wsdl/xmlSchema/simpleExtension.rb +62 -0
  136. data/lib/wsdl/xmlSchema/simpleRestriction.rb +132 -0
  137. data/lib/wsdl/xmlSchema/simpleType.rb +87 -0
  138. data/lib/wsdl/xmlSchema/totaldigits.rb +37 -0
  139. data/lib/wsdl/xmlSchema/union.rb +35 -0
  140. data/lib/wsdl/xmlSchema/unique.rb +34 -0
  141. data/lib/wsdl/xmlSchema/whitespace.rb +37 -0
  142. data/lib/wsdl/xmlSchema/xsd2ruby.rb +174 -0
  143. data/lib/xsd/charset.rb +188 -0
  144. data/lib/xsd/codegen.rb +12 -0
  145. data/lib/xsd/codegen/classdef.rb +208 -0
  146. data/lib/xsd/codegen/commentdef.rb +34 -0
  147. data/lib/xsd/codegen/gensupport.rb +273 -0
  148. data/lib/xsd/codegen/methoddef.rb +70 -0
  149. data/lib/xsd/codegen/moduledef.rb +208 -0
  150. data/lib/xsd/datatypes.rb +1465 -0
  151. data/lib/xsd/datatypes1999.rb +20 -0
  152. data/lib/xsd/iconvcharset.rb +33 -0
  153. data/lib/xsd/mapping.rb +68 -0
  154. data/lib/xsd/namedelements.rb +132 -0
  155. data/lib/xsd/ns.rb +182 -0
  156. data/lib/xsd/qname.rb +79 -0
  157. data/lib/xsd/xmlparser.rb +82 -0
  158. data/lib/xsd/xmlparser.rb.orig +110 -0
  159. data/lib/xsd/xmlparser/libxmlparser.rb +119 -0
  160. data/lib/xsd/xmlparser/parser.rb +100 -0
  161. data/lib/xsd/xmlparser/rexmlparser.rb +58 -0
  162. data/lib/xsd/xmlparser/xmlparser.rb +50 -0
  163. data/lib/xsd/xmlparser/xmlscanner.rb +149 -0
  164. data/test/16runner.rb +68 -0
  165. data/test/interopR2/README.txt +2 -0
  166. data/test/interopR2/SOAPBuildersInterop_R2.wsdl +461 -0
  167. data/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl +19 -0
  168. data/test/interopR2/base.rb +288 -0
  169. data/test/interopR2/client.NetRemoting.rb +17 -0
  170. data/test/interopR2/client.rb +1234 -0
  171. data/test/interopR2/client4S4C.rb +15 -0
  172. data/test/interopR2/client4S4C2.rb +14 -0
  173. data/test/interopR2/clientASP.NET.rb +17 -0
  174. data/test/interopR2/clientApacheAxis.rb +16 -0
  175. data/test/interopR2/clientApacheSOAP.rb +17 -0
  176. data/test/interopR2/clientBEAWebLogic.rb +17 -0
  177. data/test/interopR2/clientBase.rb +1967 -0
  178. data/test/interopR2/clientCapeConnect.rb +18 -0
  179. data/test/interopR2/clientDelphi.rb +19 -0
  180. data/test/interopR2/clientEasySoap.rb +14 -0
  181. data/test/interopR2/clientFrontier.rb +25 -0
  182. data/test/interopR2/clientGLUE.rb +32 -0
  183. data/test/interopR2/clientHP.rb +13 -0
  184. data/test/interopR2/clientJAX-RPC.rb +19 -0
  185. data/test/interopR2/clientJSOAP.rb +14 -0
  186. data/test/interopR2/clientKafkaXSLT.rb +15 -0
  187. data/test/interopR2/clientMSSOAPToolkit2.0.rb +17 -0
  188. data/test/interopR2/clientMSSOAPToolkit3.0.rb +17 -0
  189. data/test/interopR2/clientNuSOAP.rb +19 -0
  190. data/test/interopR2/clientNuWave.rb +15 -0
  191. data/test/interopR2/clientOpenLink.rb +15 -0
  192. data/test/interopR2/clientOracle.rb +15 -0
  193. data/test/interopR2/clientPEAR.rb +18 -0
  194. data/test/interopR2/clientPhalanx.rb +18 -0
  195. data/test/interopR2/clientSIMACE.rb +18 -0
  196. data/test/interopR2/clientSOAP4R.rb +18 -0
  197. data/test/interopR2/clientSOAP__Lite.rb +14 -0
  198. data/test/interopR2/clientSQLData.rb +18 -0
  199. data/test/interopR2/clientSilverStream.rb +17 -0
  200. data/test/interopR2/clientSpray2001.rb +17 -0
  201. data/test/interopR2/clientSun.rb +19 -0
  202. data/test/interopR2/clientVWOpentalkSoap.rb +19 -0
  203. data/test/interopR2/clientWASP.rb +19 -0
  204. data/test/interopR2/clientWASPC.rb +18 -0
  205. data/test/interopR2/clientWebMethods.rb +15 -0
  206. data/test/interopR2/clientWhiteMesa.rb +28 -0
  207. data/test/interopR2/clientWingfoot.rb +15 -0
  208. data/test/interopR2/clientXMLBus.rb +19 -0
  209. data/test/interopR2/clientXMLRPC-EPI.rb +17 -0
  210. data/test/interopR2/clientXSOAP.rb +14 -0
  211. data/test/interopR2/clientZSI.rb +19 -0
  212. data/test/interopR2/clienteSOAP.rb +18 -0
  213. data/test/interopR2/clientgSOAP.rb +18 -0
  214. data/test/interopR2/clientkSOAP.rb +17 -0
  215. data/test/interopR2/iSimonReg.rb +112 -0
  216. data/test/interopR2/interopResultBase.rb +114 -0
  217. data/test/interopR2/interopService.rb +247 -0
  218. data/test/interopR2/rwikiInteropService.rb +105 -0
  219. data/test/interopR2/server.cgi +270 -0
  220. data/test/interopR2/server.rb +275 -0
  221. data/test/interopR2/simonReg.rb +123 -0
  222. data/test/interopR2/test.sh +49 -0
  223. data/test/interopR4/client.rb +112 -0
  224. data/test/results +4810 -0
  225. data/test/runner.rb +7 -0
  226. data/test/sm11/classDef.rb +156 -0
  227. data/test/sm11/client.rb +542 -0
  228. data/test/sm11/driver.rb +183 -0
  229. data/test/sm11/servant.rb +1067 -0
  230. data/test/sm11/server.rb +25 -0
  231. data/test/soap/asp.net/hello.wsdl +96 -0
  232. data/test/soap/asp.net/test_aspdotnet.rb +123 -0
  233. data/test/soap/auth/htdigest +2 -0
  234. data/test/soap/auth/htpasswd +2 -0
  235. data/test/soap/auth/test_basic.rb +117 -0
  236. data/test/soap/auth/test_digest.rb +118 -0
  237. data/test/soap/calc/calc.rb +17 -0
  238. data/test/soap/calc/calc2.rb +29 -0
  239. data/test/soap/calc/server.cgi +13 -0
  240. data/test/soap/calc/server.rb +17 -0
  241. data/test/soap/calc/server2.rb +20 -0
  242. data/test/soap/calc/test_calc.rb +51 -0
  243. data/test/soap/calc/test_calc2.rb +55 -0
  244. data/test/soap/calc/test_calc_cgi.rb +71 -0
  245. data/test/soap/case/test_mapping.rb +57 -0
  246. data/test/soap/fault/test_customfault.rb +60 -0
  247. data/test/soap/fault/test_fault.rb +46 -0
  248. data/test/soap/fault/test_soaparray.rb +35 -0
  249. data/test/soap/filter/test_filter.rb +146 -0
  250. data/test/soap/header/server.cgi +119 -0
  251. data/test/soap/header/session.pstoredb +0 -0
  252. data/test/soap/header/test_authheader.rb +240 -0
  253. data/test/soap/header/test_authheader_cgi.rb +121 -0
  254. data/test/soap/header/test_simplehandler.rb +116 -0
  255. data/test/soap/helloworld/hw_s.rb +16 -0
  256. data/test/soap/helloworld/test_helloworld.rb +43 -0
  257. data/test/soap/htpasswd +2 -0
  258. data/test/soap/literalArrayMapping/amazonEc.rb +4778 -0
  259. data/test/soap/literalArrayMapping/amazonEcDriver.rb +172 -0
  260. data/test/soap/literalArrayMapping/amazonresponse.xml +100 -0
  261. data/test/soap/literalArrayMapping/test_definedarray.rb +34 -0
  262. data/test/soap/marshal/marshaltestlib.rb +494 -0
  263. data/test/soap/marshal/test_digraph.rb +56 -0
  264. data/test/soap/marshal/test_marshal.rb +26 -0
  265. data/test/soap/marshal/test_struct.rb +47 -0
  266. data/test/soap/ssl/README +1 -0
  267. data/test/soap/ssl/ca.cert +23 -0
  268. data/test/soap/ssl/client.cert +19 -0
  269. data/test/soap/ssl/client.key +15 -0
  270. data/test/soap/ssl/server.cert +19 -0
  271. data/test/soap/ssl/server.key +15 -0
  272. data/test/soap/ssl/sslsvr.rb +57 -0
  273. data/test/soap/ssl/subca.cert +21 -0
  274. data/test/soap/ssl/test_ssl.rb +235 -0
  275. data/test/soap/struct/test_struct.rb +70 -0
  276. data/test/soap/styleuse/client.rb +20 -0
  277. data/test/soap/styleuse/server.rb +86 -0
  278. data/test/soap/swa/test_file.rb +75 -0
  279. data/test/soap/test_basetype.rb +1090 -0
  280. data/test/soap/test_cookie.rb +112 -0
  281. data/test/soap/test_custom_ns.rb +105 -0
  282. data/test/soap/test_custommap.rb +110 -0
  283. data/test/soap/test_empty.rb +105 -0
  284. data/test/soap/test_envelopenamespace.rb +85 -0
  285. data/test/soap/test_extraattr.rb +54 -0
  286. data/test/soap/test_generator.rb +29 -0
  287. data/test/soap/test_httpconfigloader.rb +71 -0
  288. data/test/soap/test_mapping.rb +131 -0
  289. data/test/soap/test_nestedexception.rb +56 -0
  290. data/test/soap/test_nil.rb +75 -0
  291. data/test/soap/test_no_indent.rb +88 -0
  292. data/test/soap/test_property.rb +428 -0
  293. data/test/soap/test_response_as_xml.rb +117 -0
  294. data/test/soap/test_soapelement.rb +138 -0
  295. data/test/soap/test_streamhandler.rb +270 -0
  296. data/test/soap/test_styleuse.rb +326 -0
  297. data/test/soap/wsdlDriver/README.txt +2 -0
  298. data/test/soap/wsdlDriver/calc.wsdl +126 -0
  299. data/test/soap/wsdlDriver/document.wsdl +54 -0
  300. data/test/soap/wsdlDriver/echo_version.rb +29 -0
  301. data/test/soap/wsdlDriver/simpletype.wsdl +63 -0
  302. data/test/soap/wsdlDriver/test_calc.rb +71 -0
  303. data/test/soap/wsdlDriver/test_document.rb +71 -0
  304. data/test/soap/wsdlDriver/test_simpletype.rb +80 -0
  305. data/test/testutil.rb +54 -0
  306. data/test/wsdl/abstract/abstract.wsdl +176 -0
  307. data/test/wsdl/abstract/test_abstract.rb +159 -0
  308. data/test/wsdl/anonymous/expectedClassDef.rb +128 -0
  309. data/test/wsdl/anonymous/expectedDriver.rb +59 -0
  310. data/test/wsdl/anonymous/expectedMappingRegistry.rb +176 -0
  311. data/test/wsdl/anonymous/lp.wsdl +147 -0
  312. data/test/wsdl/anonymous/test_anonymous.rb +130 -0
  313. data/test/wsdl/any/any.wsdl +114 -0
  314. data/test/wsdl/any/expectedDriver.rb +68 -0
  315. data/test/wsdl/any/expectedEcho.rb +57 -0
  316. data/test/wsdl/any/expectedMappingRegistry.rb +63 -0
  317. data/test/wsdl/any/expectedService.rb +69 -0
  318. data/test/wsdl/any/test_any.rb +193 -0
  319. data/test/wsdl/axisArray/axisArray.wsdl +87 -0
  320. data/test/wsdl/axisArray/test_axisarray.rb +124 -0
  321. data/test/wsdl/choice/choice.wsdl +167 -0
  322. data/test/wsdl/choice/test_choice.rb +310 -0
  323. data/test/wsdl/complexcontent/complexContent.wsdl +83 -0
  324. data/test/wsdl/complexcontent/test_echo.rb +90 -0
  325. data/test/wsdl/datetime/DatetimeService.rb +44 -0
  326. data/test/wsdl/datetime/datetime.rb +0 -0
  327. data/test/wsdl/datetime/datetime.wsdl +45 -0
  328. data/test/wsdl/datetime/datetimeServant.rb +22 -0
  329. data/test/wsdl/datetime/test_datetime.rb +86 -0
  330. data/test/wsdl/document/array/double.wsdl +161 -0
  331. data/test/wsdl/document/array/test_array.rb +201 -0
  332. data/test/wsdl/document/document.wsdl +76 -0
  333. data/test/wsdl/document/number.wsdl +54 -0
  334. data/test/wsdl/document/ping_nosoapaction.wsdl +66 -0
  335. data/test/wsdl/document/test_nosoapaction.rb +102 -0
  336. data/test/wsdl/document/test_number.rb +92 -0
  337. data/test/wsdl/document/test_rpc.rb +355 -0
  338. data/test/wsdl/emptycomplextype.wsdl +31 -0
  339. data/test/wsdl/fault/fault.wsdl +79 -0
  340. data/test/wsdl/fault/multifault.wsdl +96 -0
  341. data/test/wsdl/fault/test_fault.rb +119 -0
  342. data/test/wsdl/fault/test_multifault.rb +134 -0
  343. data/test/wsdl/group/expectedClassdef.rb +58 -0
  344. data/test/wsdl/group/expectedDriver.rb +51 -0
  345. data/test/wsdl/group/expectedMappingRegistry.rb +67 -0
  346. data/test/wsdl/group/group.wsdl +88 -0
  347. data/test/wsdl/group/test_rpc.rb +145 -0
  348. data/test/wsdl/list/list.wsdl +93 -0
  349. data/test/wsdl/list/test_list.rb +124 -0
  350. data/test/wsdl/map/map.wsdl +92 -0
  351. data/test/wsdl/map/map.xml +43 -0
  352. data/test/wsdl/map/test_map.rb +99 -0
  353. data/test/wsdl/marshal/Person.rb +1 -0
  354. data/test/wsdl/marshal/person.wsdl +21 -0
  355. data/test/wsdl/marshal/person_org.rb +23 -0
  356. data/test/wsdl/marshal/test_wsdlmarshal.rb +76 -0
  357. data/test/wsdl/multiplefault.wsdl +75 -0
  358. data/test/wsdl/oneway/oneway.wsdl +36 -0
  359. data/test/wsdl/oneway/test_oneway.rb +108 -0
  360. data/test/wsdl/overload/expectedClient.rb +37 -0
  361. data/test/wsdl/overload/expectedDriver.rb +61 -0
  362. data/test/wsdl/overload/expectedServant.rb +35 -0
  363. data/test/wsdl/overload/overload.wsdl +70 -0
  364. data/test/wsdl/overload/test_overload.rb +131 -0
  365. data/test/wsdl/qualified/lp.wsdl +47 -0
  366. data/test/wsdl/qualified/lp.xsd +26 -0
  367. data/test/wsdl/qualified/np.wsdl +51 -0
  368. data/test/wsdl/qualified/test_qualified.rb +137 -0
  369. data/test/wsdl/qualified/test_unqualified.rb +138 -0
  370. data/test/wsdl/raa/RAAService.rb +125 -0
  371. data/test/wsdl/raa/README.txt +8 -0
  372. data/test/wsdl/raa/expectedClassDef.rb +100 -0
  373. data/test/wsdl/raa/expectedDriver.rb +96 -0
  374. data/test/wsdl/raa/expectedMappingRegistry.rb +121 -0
  375. data/test/wsdl/raa/raa.wsdl +264 -0
  376. data/test/wsdl/raa/test_raa.rb +126 -0
  377. data/test/wsdl/ref/expectedDriver.rb +51 -0
  378. data/test/wsdl/ref/expectedProduct.rb +243 -0
  379. data/test/wsdl/ref/product.wsdl +147 -0
  380. data/test/wsdl/ref/test_ref.rb +268 -0
  381. data/test/wsdl/rpc/rpc.wsdl +109 -0
  382. data/test/wsdl/rpc/test-rpc-lit.wsdl +371 -0
  383. data/test/wsdl/rpc/test_rpc.rb +176 -0
  384. data/test/wsdl/rpc/test_rpc_lit.rb +470 -0
  385. data/test/wsdl/simplecontent/simplecontent.wsdl +84 -0
  386. data/test/wsdl/simplecontent/test_simplecontent.rb +102 -0
  387. data/test/wsdl/simpletype/rpc/echo_version.rb +1 -0
  388. data/test/wsdl/simpletype/rpc/echo_versionDriver.rb +10 -0
  389. data/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb +4 -0
  390. data/test/wsdl/simpletype/rpc/echo_versionServant.rb +3 -0
  391. data/test/wsdl/simpletype/rpc/echo_version_service.rb +3 -0
  392. data/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb +34 -0
  393. data/test/wsdl/simpletype/rpc/expectedClient.rb +34 -0
  394. data/test/wsdl/simpletype/rpc/expectedDriver.rb +58 -0
  395. data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +36 -0
  396. data/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb +57 -0
  397. data/test/wsdl/simpletype/rpc/expectedServant.rb +32 -0
  398. data/test/wsdl/simpletype/rpc/expectedService.rb +55 -0
  399. data/test/wsdl/simpletype/rpc/rpc.wsdl +98 -0
  400. data/test/wsdl/simpletype/rpc/test_rpc.rb +52 -0
  401. data/test/wsdl/simpletype/simpletype.wsdl +114 -0
  402. data/test/wsdl/simpletype/test_simpletype.rb +92 -0
  403. data/test/wsdl/soap/soapbodyparts.wsdl +103 -0
  404. data/test/wsdl/soap/test_soapbodyparts.rb +79 -0
  405. data/test/wsdl/soap/wsdl2ruby/echo_version.rb +1 -0
  406. data/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb +10 -0
  407. data/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb +4 -0
  408. data/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb +3 -0
  409. data/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi +3 -0
  410. data/test/wsdl/soap/wsdl2ruby/echo_version_service.rb +7 -0
  411. data/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb +34 -0
  412. data/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb +21 -0
  413. data/test/wsdl/soap/wsdl2ruby/expectedClient.rb +34 -0
  414. data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +58 -0
  415. data/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb +36 -0
  416. data/test/wsdl/soap/wsdl2ruby/expectedServant.rb +32 -0
  417. data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +48 -0
  418. data/test/wsdl/soap/wsdl2ruby/expectedService.rb +55 -0
  419. data/test/wsdl/soap/wsdl2ruby/rpc.wsdl +80 -0
  420. data/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb +37 -0
  421. data/test/wsdl/soap/wsdl2ruby/section/section.xsd +31 -0
  422. data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +53 -0
  423. data/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl +64 -0
  424. data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +83 -0
  425. data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +102 -0
  426. data/test/wsdl/soaptype/soaptype.wsdl +61 -0
  427. data/test/wsdl/soaptype/test_soaptype.rb +178 -0
  428. data/test/wsdl/test_emptycomplextype.rb +21 -0
  429. data/test/wsdl/test_fault.rb +50 -0
  430. data/test/wsdl/test_multiplefault.rb +41 -0
  431. data/test/xsd/codegen/test_classdef.rb +244 -0
  432. data/test/xsd/noencoding.xml +4 -0
  433. data/test/xsd/test_noencoding.rb +32 -0
  434. data/test/xsd/test_ns.rb +41 -0
  435. data/test/xsd/test_xmlschemaparser.rb +22 -0
  436. data/test/xsd/test_xsd.rb +1638 -0
  437. data/test/xsd/xmllang.xml +43 -0
  438. data/test/xsd/xmlschema.xml +12 -0
  439. data/test/xsd/xsd2ruby/expected_mysample.rb +65 -0
  440. data/test/xsd/xsd2ruby/expected_mysample_mapper.rb +11 -0
  441. data/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb +51 -0
  442. data/test/xsd/xsd2ruby/section.xsd +49 -0
  443. data/test/xsd/xsd2ruby/test_xsd2ruby.rb +90 -0
  444. metadata +519 -0
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0"?>
2
+ <definitions name="SOAP4R_SOAPBuildersInteropTest_R2GroupB"
3
+ targetNamespace="http://soapinterop.org/"
4
+ xmlns:tns="http://soapinterop.org/"
5
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
6
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
7
+
8
+ <import
9
+ namespace="http://soapinterop.org/"
10
+ location="http://www.whitemesa.com/interop/InteropTestB.wsdl"/>
11
+
12
+ <service name="SOAP4R_SOAPBuildersInteropTest_R2GroupB">
13
+ <port name="InteropTestSoapPort"
14
+ binding="tns:InteropTestSoapBindingB">
15
+ <soap:address location="http://dev.ctor.org/soapsrv"/>
16
+ </port>
17
+ </service>
18
+
19
+ </definitions>
@@ -0,0 +1,288 @@
1
+ require 'soap/soap'
2
+ require 'soap/mapping'
3
+
4
+
5
+ InterfaceNS = 'http://soapinterop.org/'
6
+ TypeNS = 'http://soapinterop.org/xsd'
7
+ ApacheNS = 'http://xml.apache.org/xml-soap'
8
+
9
+
10
+ module SOAPBuildersInterop
11
+ extend SOAP
12
+
13
+
14
+ MethodsBase = [
15
+ ['echoVoid'],
16
+ ['echoString',
17
+ [:in, 'inputString', nil], [:retval, 'return', nil]],
18
+ ['echoStringArray',
19
+ [:in, 'inputStringArray', nil], [:retval, 'return', nil]],
20
+ ['echoInteger',
21
+ [:in, 'inputInteger', nil], [:retval, 'return', nil]],
22
+ ['echoIntegerArray',
23
+ [:in, 'inputIntegerArray', nil], [:retval, 'return', nil]],
24
+ ['echoFloat',
25
+ [:in, 'inputFloat', nil], [:retval, 'return', nil]],
26
+ ['echoFloatArray',
27
+ [:in, 'inputFloatArray', nil], [:retval, 'return', nil]],
28
+ ['echoStruct',
29
+ [:in, 'inputStruct', nil], [:retval, 'return', nil]],
30
+ ['echoStructArray',
31
+ [:in, 'inputStructArray', nil], [:retval, 'return', nil]],
32
+ ['echoDate',
33
+ [:in, 'inputDate', nil], [:retval, 'return', nil]],
34
+ ['echoBase64',
35
+ [:in, 'inputBase64', nil], [:retval, 'return', nil]],
36
+ ['echoHexBinary',
37
+ [:in, 'inputHexBinary', nil], [:retval, 'return', nil]],
38
+ ['echoBoolean',
39
+ [:in, 'inputBoolean', nil], [:retval, 'return', nil]],
40
+ ['echoDecimal',
41
+ [:in, 'inputDecimal', nil], [:retval, 'return', nil]],
42
+ ['echoMap',
43
+ [:in, 'inputMap', nil], [:retval, 'return', nil]],
44
+ ['echoMapArray',
45
+ [:in, 'inputMapArray', nil], [:retval, 'return', nil]],
46
+
47
+ ['echoDouble',
48
+ [:in, 'inputDouble', nil], [:retval, 'return', nil]],
49
+ ['echoXSDDateTime',
50
+ [:in, 'inputXSDDateTime', nil], [:retval, 'return', nil]],
51
+ ['echoXSDDate',
52
+ [:in, 'inputXSDDate', nil], [:retval, 'return', nil]],
53
+ ['echoXSDTime',
54
+ [:in, 'inputXSDTime', nil], [:retval, 'return', nil]],
55
+ ]
56
+
57
+ MethodsGroupB = [
58
+ ['echoStructAsSimpleTypes',
59
+ [:in, 'inputStruct', nil], [:out, 'outputString', nil], [:out, 'outputInteger', nil], [:out, 'outputFloat', nil]],
60
+ ['echoSimpleTypesAsStruct',
61
+ [:in, 'inputString', nil], [:in, 'inputInteger', nil], [:in, 'inputFloat', nil], [:retval, 'return', nil]],
62
+ ['echo2DStringArray',
63
+ [:in, 'input2DStringArray', nil], [:retval, 'return', nil]],
64
+ ['echoNestedStruct',
65
+ [:in, 'inputStruct', nil], [:retval, 'return', nil]],
66
+ ['echoNestedArray',
67
+ [:in, 'inputStruct', nil], [:retval, 'return', nil]],
68
+ ]
69
+
70
+ MethodsPolyMorph = [
71
+ ['echoPolyMorph',
72
+ [:in, 'inputPolyMorph', nil], [:retval, 'return', nil]],
73
+ ['echoPolyMorphStruct',
74
+ [:in, 'inputPolyMorphStruct', nil], [:retval, 'return', nil]],
75
+ ['echoPolyMorphArray',
76
+ [:in, 'inputPolyMorphArray', nil], [:retval, 'return', nil]],
77
+ ]
78
+
79
+
80
+ module FloatSupport
81
+ def floatEquals( lhs, rhs )
82
+ lhsVar = lhs.is_a?( SOAP::SOAPFloat )? lhs.data : lhs
83
+ rhsVar = rhs.is_a?( SOAP::SOAPFloat )? rhs.data : rhs
84
+ lhsVar == rhsVar
85
+ end
86
+ end
87
+
88
+ class SOAPStruct
89
+ include SOAP::Marshallable
90
+ include FloatSupport
91
+
92
+ attr_accessor :varInt, :varFloat, :varString
93
+
94
+ def initialize( varInt, varFloat, varString )
95
+ @varInt = varInt
96
+ @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil
97
+ @varString = varString
98
+ end
99
+
100
+ def ==( rhs )
101
+ r = if rhs.is_a?( self.class )
102
+ ( self.varInt == rhs.varInt &&
103
+ floatEquals( self.varFloat, rhs.varFloat ) &&
104
+ self.varString == rhs.varString )
105
+ else
106
+ false
107
+ end
108
+ r
109
+ end
110
+
111
+ def to_s
112
+ "#{ varInt }:#{ varFloat }:#{ varString }"
113
+ end
114
+ end
115
+
116
+
117
+ class SOAPStructStruct
118
+ include SOAP::Marshallable
119
+ include FloatSupport
120
+
121
+ attr_accessor :varInt, :varFloat, :varString, :varStruct
122
+
123
+ def initialize( varInt, varFloat, varString, varStruct = nil )
124
+ @varInt = varInt
125
+ @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil
126
+ @varString = varString
127
+ @varStruct = varStruct
128
+ end
129
+
130
+ def ==( rhs )
131
+ r = if rhs.is_a?( self.class )
132
+ ( self.varInt == rhs.varInt &&
133
+ floatEquals( self.varFloat, rhs.varFloat ) &&
134
+ self.varString == rhs.varString &&
135
+ self.varStruct == rhs.varStruct )
136
+ else
137
+ false
138
+ end
139
+ r
140
+ end
141
+
142
+ def to_s
143
+ "#{ varInt }:#{ varFloat }:#{ varString }:#{ varStruct }"
144
+ end
145
+ end
146
+
147
+
148
+ class PolyMorphStruct
149
+ include SOAP::Marshallable
150
+
151
+ attr_reader :varA, :varB, :varC
152
+
153
+ def initialize( varA, varB, varC )
154
+ @varA = varA
155
+ @varB = varB
156
+ @varC = varC
157
+ end
158
+
159
+ def ==( rhs )
160
+ r = if rhs.is_a?( self.class )
161
+ ( self.varA == rhs.varA &&
162
+ self.varB == rhs.varB &&
163
+ self.varC == rhs.varC )
164
+ else
165
+ false
166
+ end
167
+ r
168
+ end
169
+
170
+ def to_s
171
+ "#{ varA }:#{ varB }:#{ varC }"
172
+ end
173
+ end
174
+
175
+
176
+ class SOAPArrayStruct
177
+ include SOAP::Marshallable
178
+ include FloatSupport
179
+
180
+ attr_accessor :varInt, :varFloat, :varString, :varArray
181
+
182
+ def initialize( varInt, varFloat, varString, varArray = nil )
183
+ @varInt = varInt
184
+ @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil
185
+ @varString = varString
186
+ @varArray = varArray
187
+ end
188
+
189
+ def ==( rhs )
190
+ r = if rhs.is_a?( self.class )
191
+ ( self.varInt == rhs.varInt &&
192
+ floatEquals( self.varFloat, rhs.varFloat ) &&
193
+ self.varString == rhs.varString &&
194
+ self.varArray == rhs.varArray )
195
+ else
196
+ false
197
+ end
198
+ r
199
+ end
200
+
201
+ def to_s
202
+ "#{ varInt }:#{ varFloat }:#{ varString }:#{ varArray }"
203
+ end
204
+ end
205
+
206
+
207
+ class StringArray < Array; end
208
+ class IntArray < Array; end
209
+ class FloatArray < Array; end
210
+ class SOAPStructArray < Array; end
211
+ class SOAPMapArray < Array; end
212
+ class ArrayOfanyType < Array; end
213
+
214
+
215
+ MappingRegistry = SOAP::Mapping::Registry.new
216
+
217
+ MappingRegistry.set(
218
+ ::SOAPBuildersInterop::SOAPStruct,
219
+ ::SOAP::SOAPStruct,
220
+ ::SOAP::Mapping::Registry::TypedStructFactory,
221
+ { :type => XSD::QName.new( TypeNS, "SOAPStruct" ) }
222
+ )
223
+
224
+ MappingRegistry.set(
225
+ ::SOAPBuildersInterop::SOAPStructStruct,
226
+ ::SOAP::SOAPStruct,
227
+ ::SOAP::Mapping::Registry::TypedStructFactory,
228
+ { :type => XSD::QName.new( TypeNS, "SOAPStructStruct" ) }
229
+ )
230
+
231
+ MappingRegistry.set(
232
+ ::SOAPBuildersInterop::PolyMorphStruct,
233
+ ::SOAP::SOAPStruct,
234
+ ::SOAP::Mapping::Registry::TypedStructFactory,
235
+ { :type => XSD::QName.new( TypeNS, "PolyMorphStruct" ) }
236
+ )
237
+
238
+ MappingRegistry.set(
239
+ ::SOAPBuildersInterop::SOAPArrayStruct,
240
+ ::SOAP::SOAPStruct,
241
+ ::SOAP::Mapping::Registry::TypedStructFactory,
242
+ { :type => XSD::QName.new( TypeNS, "SOAPArrayStruct" ) }
243
+ )
244
+
245
+ MappingRegistry.set(
246
+ ::SOAPBuildersInterop::StringArray,
247
+ ::SOAP::SOAPArray,
248
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
249
+ { :type => XSD::QName.new( XSD::Namespace, XSD::StringLiteral ) }
250
+ )
251
+
252
+ MappingRegistry.set(
253
+ ::SOAPBuildersInterop::IntArray,
254
+ ::SOAP::SOAPArray,
255
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
256
+ { :type => XSD::QName.new( XSD::Namespace, XSD::IntLiteral ) }
257
+ )
258
+
259
+ MappingRegistry.set(
260
+ ::SOAPBuildersInterop::FloatArray,
261
+ ::SOAP::SOAPArray,
262
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
263
+ { :type => XSD::QName.new( XSD::Namespace, XSD::FloatLiteral ) }
264
+ )
265
+
266
+ MappingRegistry.set(
267
+ ::SOAPBuildersInterop::SOAPStructArray,
268
+ ::SOAP::SOAPArray,
269
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
270
+ { :type => XSD::QName.new( TypeNS, 'SOAPStruct' ) }
271
+ )
272
+
273
+ MappingRegistry.set(
274
+ ::SOAPBuildersInterop::SOAPMapArray,
275
+ ::SOAP::SOAPArray,
276
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
277
+ { :type => XSD::QName.new( ApacheNS, 'Map' ) }
278
+ )
279
+
280
+ MappingRegistry.set(
281
+ ::SOAPBuildersInterop::ArrayOfanyType,
282
+ ::SOAP::SOAPArray,
283
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
284
+ { :type => XSD::AnyTypeName }
285
+ )
286
+
287
+
288
+ end
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $serverName = 'dotNetRemotingWebServices'
4
+ $serverBase = 'http://www.mssoapinterop.org/remoting/ServiceA.soap'
5
+ $serverGroupB = 'http://www.mssoapinterop.org/remoting/ServiceB.soap'
6
+
7
+ require 'clientBase'
8
+
9
+ drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS)
10
+ methodDefBase(drvBase)
11
+
12
+ drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS)
13
+ methodDefGroupB(drvGroupB)
14
+
15
+ doTestBase(drvBase)
16
+ doTestGroupB(drvGroupB)
17
+ submitTestResult
@@ -0,0 +1,1234 @@
1
+ $KCODE = 'EUC'
2
+
3
+ require 'test/unit'
4
+ require 'soap/rpc/driver'
5
+ require 'soap/mapping'
6
+ require 'base'
7
+ require 'interopResultBase'
8
+ require 'xsd/xmlparser/rexmlparser'
9
+ #XSD::Charset.encoding = 'EUC'
10
+
11
+ class Float
12
+ Precision = 5
13
+ def ==(rhs)
14
+ if rhs.is_a?(Float)
15
+ if self.nan? and rhs.nan?
16
+ true
17
+ elsif self.infinite? == rhs.infinite?
18
+ true
19
+ elsif (rhs - self).abs <= (10 ** (- Precision))
20
+ true
21
+ else
22
+ false
23
+ end
24
+ else
25
+ false
26
+ end
27
+ end
28
+ end
29
+
30
+ class FakeFloat < SOAP::SOAPFloat
31
+ def initialize(str)
32
+ super()
33
+ @data = str
34
+ end
35
+
36
+ def to_s
37
+ @data.to_s
38
+ end
39
+ end
40
+
41
+ class FakeDateTime < SOAP::SOAPDateTime
42
+ def initialize(str)
43
+ super()
44
+ @data = str
45
+ end
46
+
47
+ def to_s
48
+ @data.to_s
49
+ end
50
+ end
51
+
52
+ class FakeDecimal < SOAP::SOAPDecimal
53
+ def initialize(str)
54
+ super()
55
+ @data = str
56
+ end
57
+
58
+ def to_s
59
+ @data.to_s
60
+ end
61
+ end
62
+
63
+ class FakeInt < SOAP::SOAPInt
64
+ def initialize(str)
65
+ super()
66
+ @data = str
67
+ end
68
+
69
+ def to_s
70
+ @data.to_s
71
+ end
72
+ end
73
+
74
+ class SOAPBuildersTest < Test::Unit::TestCase
75
+ include SOAP
76
+ include SOAPBuildersInterop
77
+
78
+ NegativeZero = (-1.0 / (1.0 / 0.0))
79
+
80
+ class << self
81
+ include SOAP
82
+ def setup(name, location)
83
+ setup_log(name)
84
+ setup_drv(location)
85
+ end
86
+
87
+ def teardown
88
+ end
89
+
90
+ private
91
+
92
+ def setup_log(name)
93
+ filename = File.basename($0).sub(/\.rb$/, '') << '.log'
94
+ @@log = File.open(filename, 'w')
95
+ @@log << "File: #{ filename } - Wiredumps for SOAP4R client / #{ name } server.\n"
96
+ @@log << "Date: #{ Time.now }\n\n"
97
+ end
98
+
99
+ def setup_drv(location)
100
+ namespace = InterfaceNS
101
+ soap_action = InterfaceNS
102
+ @@drv = RPC::Driver.new(location, namespace, soap_action)
103
+ @@drv.mapping_registry = SOAPBuildersInterop::MappingRegistry
104
+ if $DEBUG
105
+ @@drv.wiredump_dev = STDOUT
106
+ else
107
+ @@drv.wiredump_dev = @@log
108
+ end
109
+ method_def(@@drv, soap_action)
110
+ end
111
+
112
+ def method_def(drv, soap_action = nil)
113
+ do_method_def(drv, SOAPBuildersInterop::MethodsBase, soap_action)
114
+ do_method_def(drv, SOAPBuildersInterop::MethodsGroupB, soap_action)
115
+ end
116
+
117
+ def do_method_def(drv, defs, soap_action = nil)
118
+ defs.each do |name, *params|
119
+ drv.add_rpc_operation(
120
+ XSD::QName.new(InterfaceNS, name), soap_action, name, params)
121
+ end
122
+ end
123
+ end
124
+
125
+ def setup
126
+ end
127
+
128
+ def teardown
129
+ end
130
+
131
+ def drv
132
+ @@drv
133
+ end
134
+
135
+ def log_test
136
+ /`([^']+)'/ =~ caller(1)[0]
137
+ title = $1
138
+ title = "==== " + title + " " << "=" * (title.length > 72 ? 0 : (72 - title.length))
139
+ @@log << "#{title}\n\n"
140
+ end
141
+
142
+ def assert_exception(klass_or_module)
143
+ begin
144
+ yield
145
+ assert(false, "Exception was not raised.")
146
+ rescue Exception => e
147
+ if klass_or_module.is_a?(Module)
148
+ assert_kind_of(klass_or_module, e)
149
+ elsif klass_or_module.is_a?(Class)
150
+ assert_instance_of(klass_or_module, e)
151
+ else
152
+ assert(false, "Must be a klass or a mogule.")
153
+ end
154
+ end
155
+ end
156
+
157
+ def inspect_with_id(obj)
158
+ case obj
159
+ when Array
160
+ obj.collect { |ele| inspect_with_id(ele) }
161
+ else
162
+ # String#== compares content of args.
163
+ "#{ obj.class }##{ obj.__id__ }"
164
+ end
165
+ end
166
+
167
+ def dump_result(title, result, resultStr)
168
+ @@test_result.add(
169
+ SOAPBuildersInteropResult::TestResult.new(
170
+ title,
171
+ result,
172
+ resultStr,
173
+ $wireDumpDev.dup
174
+ )
175
+ )
176
+ $wireDumpLogFile << "Result: #{ resultStr || 'OK' }\n\n"
177
+ $wireDumpLogFile << $wireDumpDev
178
+ $wireDumpLogFile << "\n"
179
+
180
+ $wireDumpDev.replace('')
181
+ end
182
+
183
+ def test_echoVoid
184
+ log_test
185
+ var = drv.echoVoid()
186
+ assert_equal(nil, var)
187
+ end
188
+
189
+ def test_echoString
190
+ log_test
191
+ arg = "SOAP4R Interoperability Test"
192
+ var = drv.echoString(arg)
193
+ assert_equal(arg, var)
194
+ end
195
+
196
+ def test_echoString_Entity_reference
197
+ log_test
198
+ arg = "<>\"& &lt;&gt;&quot;&amp; &amp&amp;><<<"
199
+ var = drv.echoString(arg)
200
+ assert_equal(arg, var)
201
+ end
202
+
203
+ def test_echoString_haracter_reference
204
+ log_test
205
+ arg = "\x20&#x20;\040&#32;\x7f&#x7f;\177&#127;"
206
+ tobe = " \177\177\177\177"
207
+ var = drv.echoString(SOAP::SOAPRawString.new(arg))
208
+ assert_equal(tobe, var)
209
+ end
210
+
211
+ def test_echoString_Leading_and_trailing_whitespace
212
+ log_test
213
+ arg = " SOAP4R\nInteroperability\nTest "
214
+ var = drv.echoString(arg)
215
+ assert_equal(arg, var)
216
+ end
217
+
218
+ def test_echoString_EUC_encoded
219
+ log_test
220
+ arg = "Hello (���ܸ�Japanese) ����ˤ���"
221
+ var = drv.echoString(arg)
222
+ assert_equal(arg, var)
223
+ end
224
+
225
+ def test_echoString_EUC_encoded_again
226
+ log_test
227
+ arg = "Hello (���ܸ�Japanese) ����ˤ���"
228
+ var = drv.echoString(arg)
229
+ assert_equal(arg, var)
230
+ end
231
+
232
+ def test_echoString_SJIS_encoded
233
+ log_test
234
+ arg = "Hello (���ܸ�Japanese) ����ˤ���"
235
+ require 'nkf'
236
+ arg = NKF.nkf("-sm0", arg)
237
+ drv.options["soap.mapping.external_ces"] = 'SJIS'
238
+ begin
239
+ var = drv.echoString(arg)
240
+ assert_equal(arg, var)
241
+ ensure
242
+ drv.options["soap.mapping.external_ces"] = nil
243
+ end
244
+ end
245
+
246
+ def test_echoString_empty
247
+ log_test
248
+ arg = ''
249
+ var = drv.echoString(arg)
250
+ assert_equal(arg, var)
251
+ end
252
+
253
+ def test_echoString_space
254
+ log_test
255
+ arg = ' '
256
+ var = drv.echoString(arg)
257
+ assert_equal(arg, var)
258
+ end
259
+
260
+ def test_echoString_whitespaces
261
+ log_test
262
+ arg = "\r \n \t \r \n \t"
263
+ var = drv.echoString(arg)
264
+ assert_equal(arg, var)
265
+ end
266
+
267
+ def test_echoStringArray
268
+ log_test
269
+ arg = StringArray["SOAP4R\n", " Interoperability ", "\tTest\t"]
270
+ var = drv.echoStringArray(arg)
271
+ assert_equal(arg, var)
272
+ end
273
+
274
+ def test_echoStringArray_multi_ref
275
+ log_test
276
+ str1 = "SOAP4R"
277
+ str2 = "SOAP4R"
278
+ arg = StringArray[str1, str2, str1]
279
+ var = drv.echoStringArray(arg)
280
+ assert_equal(arg, var)
281
+ end
282
+
283
+ def test_echoStringArray_multi_ref_idmatch
284
+ log_test
285
+ str1 = "SOAP4R"
286
+ str2 = "SOAP4R"
287
+ arg = StringArray[str1, str2, str1]
288
+ var = drv.echoStringArray(arg)
289
+ assert_equal(inspect_with_id(var[0]), inspect_with_id(var[2]))
290
+ end
291
+
292
+ def test_echoStringArray_empty_multi_ref_idmatch
293
+ log_test
294
+ str1 = ""
295
+ str2 = ""
296
+ arg = StringArray[str1, str2, str1]
297
+ var = drv.echoStringArray(arg)
298
+ assert_equal(inspect_with_id(var[0]), inspect_with_id(var[2]))
299
+ end
300
+
301
+ def test_echoInteger_123
302
+ log_test
303
+ arg = 123
304
+ var = drv.echoInteger(arg)
305
+ assert_equal(arg, var)
306
+ end
307
+
308
+ def test_echoInteger_2147483647
309
+ log_test
310
+ arg = 2147483647
311
+ var = drv.echoInteger(arg)
312
+ assert_equal(arg, var)
313
+ end
314
+
315
+ def test_echoInteger_negative_2147483648
316
+ log_test
317
+ arg = -2147483648
318
+ var = drv.echoInteger(arg)
319
+ assert_equal(arg, var)
320
+ end
321
+
322
+ def test_echoInteger_2147483648_junk
323
+ log_test
324
+ assert_exception(SOAP::RPC::ServerException) do
325
+ arg = FakeInt.new("2147483648")
326
+ var = drv.echoInteger(arg)
327
+ end
328
+ end
329
+
330
+ def test_echoInteger_negative_2147483649_junk
331
+ log_test
332
+ assert_exception(SOAP::RPC::ServerException) do
333
+ arg = FakeInt.new("-2147483649")
334
+ var = drv.echoInteger(arg)
335
+ end
336
+ end
337
+
338
+ def test_echoInteger_0_0_junk
339
+ log_test
340
+ assert_exception(SOAP::RPC::ServerException) do
341
+ arg = FakeInt.new("0.0")
342
+ var = drv.echoInteger(arg)
343
+ end
344
+ end
345
+
346
+ def test_echoInteger_negative_5_2_junk
347
+ log_test
348
+ assert_exception(SOAP::RPC::ServerException) do
349
+ arg = FakeInt.new("-5.2")
350
+ var = drv.echoInteger(arg)
351
+ end
352
+ end
353
+
354
+ def test_echoInteger_0_000000000a_junk
355
+ log_test
356
+ assert_exception(SOAP::RPC::ServerException) do
357
+ arg = FakeInt.new("0.000000000a")
358
+ var = drv.echoInteger(arg)
359
+ end
360
+ end
361
+
362
+ def test_echoInteger_plus_minus_5_junk
363
+ log_test
364
+ assert_exception(SOAP::RPC::ServerException) do
365
+ arg = FakeInt.new("+-5")
366
+ var = drv.echoInteger(arg)
367
+ end
368
+ end
369
+
370
+ def test_echoIntegerArray
371
+ log_test
372
+ arg = IntArray[1, 2, 3]
373
+ var = drv.echoIntegerArray(arg)
374
+ assert_equal(arg, var)
375
+ end
376
+
377
+ def test_echoIntegerArray_empty
378
+ log_test
379
+ arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 1, XSD::XSDInt::Type)
380
+ var = drv.echoIntegerArray(arg)
381
+ assert_equal([], var)
382
+ end
383
+
384
+ def test_echoFloat
385
+ log_test
386
+ arg = 3.14159265358979
387
+ var = drv.echoFloat(SOAPFloat.new(arg))
388
+ assert_equal(arg, var)
389
+ end
390
+
391
+ def test_echoFloat_scientific_notation
392
+ log_test
393
+ arg = 12.34e36
394
+ var = drv.echoFloat(SOAPFloat.new(arg))
395
+ assert_equal(arg, var)
396
+ end
397
+
398
+ def test_echoFloat_scientific_notation_2
399
+ log_test
400
+ arg = FakeFloat.new("12.34e36")
401
+ var = drv.echoFloat(SOAPFloat.new(arg))
402
+ assert_equal(12.34e36, var)
403
+ end
404
+
405
+ def test_echoFloat_scientific_notation_3
406
+ log_test
407
+ arg = FakeFloat.new("12.34E+36")
408
+ var = drv.echoFloat(SOAPFloat.new(arg))
409
+ assert_equal(12.34e36, var)
410
+ end
411
+
412
+ def test_echoFloat_scientific_notation_4
413
+ log_test
414
+ arg = FakeFloat.new("-1.4E")
415
+ var = drv.echoFloat(SOAPFloat.new(arg))
416
+ assert_equal(1.4, var)
417
+ end
418
+
419
+ def test_echoFloat_positive_lower_boundary
420
+ log_test
421
+ arg = 1.4e-45
422
+ var = drv.echoFloat(SOAPFloat.new(arg))
423
+ assert_equal(arg, var)
424
+ end
425
+
426
+ def test_echoFloat_negative_lower_boundary
427
+ log_test
428
+ arg = -1.4e-45
429
+ var = drv.echoFloat(SOAPFloat.new(arg))
430
+ assert_equal(arg, var)
431
+ end
432
+
433
+ def test_echoFloat_special_values_positive_0
434
+ log_test
435
+ arg = 0.0
436
+ var = drv.echoFloat(SOAPFloat.new(arg))
437
+ assert_equal(arg, var)
438
+ end
439
+
440
+ def test_echoFloat_special_values_negative_0
441
+ log_test
442
+ arg = NegativeZero
443
+ var = drv.echoFloat(SOAPFloat.new(arg))
444
+ assert_equal(arg, var)
445
+ end
446
+
447
+ def test_echoFloat_special_values_NaN
448
+ log_test
449
+ arg = 0.0/0.0
450
+ var = drv.echoFloat(SOAPFloat.new(arg))
451
+ assert_equal(arg, var)
452
+ end
453
+
454
+ def test_echoFloat_special_values_positive_INF
455
+ log_test
456
+ arg = 1.0/0.0
457
+ var = drv.echoFloat(SOAPFloat.new(arg))
458
+ assert_equal(arg, var)
459
+ end
460
+
461
+ def test_echoFloat_special_values_negative_INF
462
+ log_test
463
+ arg = -1.0/0.0
464
+ var = drv.echoFloat(SOAPFloat.new(arg))
465
+ assert_equal(arg, var)
466
+ end
467
+
468
+ def test_echoFloat_0_000a_junk
469
+ log_test
470
+ assert_exception(SOAP::RPC::ServerException) do
471
+ arg = FakeFloat.new("0.0000000000000000a")
472
+ var = drv.echoFloat(arg)
473
+ end
474
+ end
475
+
476
+ def test_echoFloat_00a_0001_junk
477
+ log_test
478
+ assert_exception(SOAP::RPC::ServerException) do
479
+ arg = FakeFloat.new("00a.000000000000001")
480
+ var = drv.echoFloat(arg)
481
+ end
482
+ end
483
+
484
+ def test_echoFloat_plus_minus_5_junk
485
+ log_test
486
+ assert_exception(SOAP::RPC::ServerException) do
487
+ arg = FakeFloat.new("+-5")
488
+ var = drv.echoFloat(arg)
489
+ end
490
+ end
491
+
492
+ def test_echoFloat_5_0_junk
493
+ log_test
494
+ assert_exception(SOAP::RPC::ServerException) do
495
+ arg = FakeFloat.new("5_0")
496
+ var = drv.echoFloat(arg)
497
+ end
498
+ end
499
+
500
+ def test_echoFloatArray
501
+ log_test
502
+ arg = FloatArray[SOAPFloat.new(0.0001), SOAPFloat.new(1000.0),
503
+ SOAPFloat.new(0.0)]
504
+ var = drv.echoFloatArray(arg)
505
+ assert_equal(arg.collect { |ele| ele.data }, var)
506
+ end
507
+
508
+ def test_echoFloatArray_special_values_NaN_positive_INF_negative_INF
509
+ log_test
510
+ nan = SOAPFloat.new(0.0/0.0)
511
+ inf = SOAPFloat.new(1.0/0.0)
512
+ inf_ = SOAPFloat.new(-1.0/0.0)
513
+ arg = FloatArray[nan, inf, inf_]
514
+ var = drv.echoFloatArray(arg)
515
+ assert_equal(arg.collect { |ele| ele.data }, var)
516
+ end
517
+
518
+ def test_echoStruct
519
+ log_test
520
+ arg = SOAPStruct.new(1, 1.1, "a")
521
+ var = drv.echoStruct(arg)
522
+ assert_equal(arg, var)
523
+ end
524
+
525
+ def test_echoStruct_nil_members
526
+ log_test
527
+ arg = SOAPStruct.new(nil, nil, nil)
528
+ var = drv.echoStruct(arg)
529
+ assert_equal(arg, var)
530
+ end
531
+
532
+ def test_echoStructArray
533
+ log_test
534
+ s1 = SOAPStruct.new(1, 1.1, "a")
535
+ s2 = SOAPStruct.new(2, 2.2, "b")
536
+ s3 = SOAPStruct.new(3, 3.3, "c")
537
+ arg = SOAPStructArray[s1, s2, s3]
538
+ var = drv.echoStructArray(arg)
539
+ assert_equal(arg, var)
540
+ end
541
+
542
+ def test_echoStructArray_anyType_Array
543
+ log_test
544
+ s1 = SOAPStruct.new(1, 1.1, "a")
545
+ s2 = SOAPStruct.new(2, 2.2, "b")
546
+ s3 = SOAPStruct.new(3, 3.3, "c")
547
+ arg = [s1, s2, s3]
548
+ var = drv.echoStructArray(arg)
549
+ assert_equal(arg, var)
550
+ end
551
+
552
+ def test_echoStructArray_multi_ref
553
+ log_test
554
+ s1 = SOAPStruct.new(1, 1.1, "a")
555
+ s2 = SOAPStruct.new(2, 2.2, "b")
556
+ arg = SOAPStructArray[s1, s1, s2]
557
+ var = drv.echoStructArray(arg)
558
+ assert_equal(arg, var)
559
+ end
560
+
561
+ def test_echoStructArray_multi_ref_idmatch
562
+ log_test
563
+ s1 = SOAPStruct.new(1, 1.1, "a")
564
+ s2 = SOAPStruct.new(2, 2.2, "b")
565
+ arg = SOAPStructArray[s1, s1, s2]
566
+ var = drv.echoStructArray(arg)
567
+ assert_equal(inspect_with_id(var[0]), inspect_with_id(var[1]))
568
+ end
569
+
570
+ def test_echoStructArray_anyType_Array_multi_ref_idmatch
571
+ log_test
572
+ s1 = SOAPStruct.new(1, 1.1, "a")
573
+ s2 = SOAPStruct.new(2, 2.2, "b")
574
+ arg = [s1, s2, s2]
575
+ var = drv.echoStructArray(arg)
576
+ assert_equal(inspect_with_id(var[1]), inspect_with_id(var[2]))
577
+ end
578
+
579
+ def test_echoStructArray_multi_ref_idmatch_varString_of_elem1_varString_of_elem2
580
+ log_test
581
+ str1 = "a"
582
+ str2 = "a"
583
+ s1 = SOAPStruct.new(1, 1.1, str1)
584
+ s2 = SOAPStruct.new(2, 2.2, str1)
585
+ s3 = SOAPStruct.new(3, 3.3, str2)
586
+ arg = SOAPStructArray[s1, s2, s3]
587
+ var = drv.echoStructArray(arg)
588
+ assert_equal(inspect_with_id(var[0].varString), inspect_with_id(var[1].varString))
589
+ end
590
+
591
+ def test_echoStructArray_anyType_Array_multi_ref_idmatch_varString_of_elem2_varString_of_elem3
592
+ log_test
593
+ str1 = "b"
594
+ str2 = "b"
595
+ s1 = SOAPStruct.new(1, 1.1, str2)
596
+ s2 = SOAPStruct.new(2, 2.2, str1)
597
+ s3 = SOAPStruct.new(3, 3.3, str1)
598
+ arg = [s1, s2, s3]
599
+ var = drv.echoStructArray(arg)
600
+ assert_equal(inspect_with_id(var[1].varString), inspect_with_id(var[2].varString))
601
+ end
602
+
603
+ def test_echoDate_now
604
+ log_test
605
+ t = Time.now.gmtime
606
+ arg = DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec)
607
+ var = drv.echoDate(arg)
608
+ assert_equal(arg.to_s, var.to_s)
609
+ end
610
+
611
+ def test_echoDate_before_1970
612
+ log_test
613
+ t = Time.now.gmtime
614
+ arg = DateTime.new(1, 1, 1, 0, 0, 0)
615
+ var = drv.echoDate(arg)
616
+ assert_equal(arg.to_s, var.to_s)
617
+ end
618
+
619
+ def test_echoDate_after_2038
620
+ log_test
621
+ t = Time.now.gmtime
622
+ arg = DateTime.new(2038, 12, 31, 0, 0, 0)
623
+ var = drv.echoDate(arg)
624
+ assert_equal(arg.to_s, var.to_s)
625
+ end
626
+
627
+ def test_echoDate_negative_10_01_01T00_00_00Z
628
+ log_test
629
+ t = Time.now.gmtime
630
+ arg = DateTime.new(-10, 1, 1, 0, 0, 0)
631
+ var = drv.echoDate(arg)
632
+ assert_equal(arg.to_s, var.to_s)
633
+ end
634
+
635
+ def test_echoDate_time_precision_msec
636
+ log_test
637
+ arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.012')
638
+ argDate = arg.data
639
+ var = drv.echoDate(arg)
640
+ assert_equal(argDate, var)
641
+ end
642
+
643
+ def test_echoDate_time_precision_long
644
+ log_test
645
+ arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.0000000000123456789012345678900000000000')
646
+ argDate = arg.data
647
+ var = drv.echoDate(arg)
648
+ assert_equal(argDate, var)
649
+ end
650
+
651
+ def test_echoDate_positive_TZ
652
+ log_test
653
+ arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+07:00')
654
+ argNormalized = DateTime.new(2001, 6, 16, 18, 13, 40)
655
+ var = drv.echoDate(arg)
656
+ assert_equal(argNormalized, var)
657
+ end
658
+
659
+ def test_echoDate_negative_TZ
660
+ log_test
661
+ arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40-07:00')
662
+ argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40)
663
+ var = drv.echoDate(arg)
664
+ assert_equal(argNormalized, var)
665
+ end
666
+
667
+ def test_echoDate_positive_00_00_TZ
668
+ log_test
669
+ arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+00:00')
670
+ argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40)
671
+ var = drv.echoDate(arg)
672
+ assert_equal(argNormalized, var)
673
+ end
674
+
675
+ def test_echoDate_negative_00_00_TZ
676
+ log_test
677
+ arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40-00:00')
678
+ argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40)
679
+ var = drv.echoDate(arg)
680
+ assert_equal(argNormalized, var)
681
+ end
682
+
683
+ def test_echoDate_min_TZ
684
+ log_test
685
+ arg = SOAP::SOAPDateTime.new('2001-06-16T00:00:01+00:01')
686
+ argNormalized = DateTime.new(2001, 6, 15, 23, 59, 1)
687
+ var = drv.echoDate(arg)
688
+ assert_equal(argNormalized, var)
689
+ end
690
+
691
+ def test_echoDate_year_9999
692
+ log_test
693
+ arg = SOAP::SOAPDateTime.new('10000-06-16T18:13:40-07:00')
694
+ argNormalized = DateTime.new(10000, 6, 17, 1, 13, 40)
695
+ var = drv.echoDate(arg)
696
+ assert_equal(argNormalized, var)
697
+ end
698
+
699
+ def test_echoDate_year_0
700
+ log_test
701
+ arg = SOAP::SOAPDateTime.new('-0001-06-16T18:13:40-07:00')
702
+ argNormalized = DateTime.new(0, 6, 17, 1, 13, 40)
703
+ var = drv.echoDate(arg)
704
+ assert_equal(argNormalized, var)
705
+ end
706
+
707
+ def test_echoDate_year_4713
708
+ log_test
709
+ arg = SOAP::SOAPDateTime.new('-4713-01-01T12:00:00')
710
+ argNormalized = DateTime.new(-4712, 1, 1, 12, 0, 0)
711
+ var = drv.echoDate(arg)
712
+ assert_equal(argNormalized, var)
713
+ end
714
+
715
+ def test_echoDate_year_0000_junk
716
+ log_test
717
+ assert_exception(SOAP::RPC::ServerException) do
718
+ arg = FakeDateTime.new("0000-05-18T16:52:20Z")
719
+ var = drv.echoDate(arg)
720
+ end
721
+ end
722
+
723
+ def test_echoDate_year_nn_junk
724
+ log_test
725
+ assert_exception(SOAP::RPC::ServerException) do
726
+ arg = FakeDateTime.new("05-05-18T16:52:20Z")
727
+ var = drv.echoDate(arg)
728
+ end
729
+ end
730
+
731
+ def test_echoDate_no_day_part_junk
732
+ log_test
733
+ assert_exception(SOAP::RPC::ServerException) do
734
+ arg = FakeDateTime.new("2002-05T16:52:20Z")
735
+ var = drv.echoDate(arg)
736
+ end
737
+ end
738
+
739
+ def test_echoDate_no_sec_part_junk
740
+ log_test
741
+ assert_exception(SOAP::RPC::ServerException) do
742
+ arg = FakeDateTime.new("2002-05-18T16:52Z")
743
+ var = drv.echoDate(arg)
744
+ end
745
+ end
746
+
747
+ def test_echoDate_empty_junk
748
+ log_test
749
+ assert_exception(SOAP::RPC::ServerException) do
750
+ arg = FakeDateTime.new("")
751
+ var = drv.echoDate(arg)
752
+ end
753
+ end
754
+
755
+ def test_echoBase64_xsd_base64Binary
756
+ log_test
757
+ str = "Hello (���ܸ�Japanese) ����ˤ���"
758
+ arg = SOAP::SOAPBase64.new(str)
759
+ arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64
760
+ var = drv.echoBase64(arg)
761
+ assert_equal(str, var)
762
+ end
763
+
764
+ def test_echoBase64_xsd_base64Binary_empty
765
+ log_test
766
+ str = ""
767
+ arg = SOAP::SOAPBase64.new(str)
768
+ arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64
769
+ var = drv.echoBase64(arg)
770
+ assert_equal(str, var)
771
+ end
772
+
773
+ def test_echoBase64_SOAP_ENC_base64
774
+ log_test
775
+ str = "Hello (���ܸ�Japanese) ����ˤ���"
776
+ arg = SOAP::SOAPBase64.new(str)
777
+ var = drv.echoBase64(arg)
778
+ assert_equal(str, var)
779
+ end
780
+
781
+ def test_echoBase64_0
782
+ log_test
783
+ str = "\0"
784
+ arg = SOAP::SOAPBase64.new(str)
785
+ var = drv.echoBase64(arg)
786
+ assert_equal(str, var)
787
+ end
788
+
789
+ def test_echoBase64_0a_0
790
+ log_test
791
+ str = "a\0b\0\0c\0\0\0"
792
+ arg = SOAP::SOAPBase64.new(str)
793
+ var = drv.echoBase64(arg)
794
+ assert_equal(str, var)
795
+ end
796
+
797
+ def test_echoBase64_junk
798
+ log_test
799
+ assert_exception(SOAP::RPC::ServerException) do
800
+ arg = SOAP::SOAPBase64.new("dummy")
801
+ arg.instance_eval { @data = '-' }
802
+ var = drv.echoBase64(arg)
803
+ end
804
+ end
805
+
806
+ def test_echoHexBinary
807
+ log_test
808
+ str = "Hello (���ܸ�Japanese) ����ˤ���"
809
+ arg = SOAP::SOAPHexBinary.new(str)
810
+ var = drv.echoHexBinary(arg)
811
+ assert_equal(str, var)
812
+ end
813
+
814
+ def test_echoHexBinary_empty
815
+ log_test
816
+ str = ""
817
+ arg = SOAP::SOAPHexBinary.new(str)
818
+ var = drv.echoHexBinary(arg)
819
+ assert_equal(str, var)
820
+ end
821
+
822
+ def test_echoHexBinary_0
823
+ log_test
824
+ str = "\0"
825
+ arg = SOAP::SOAPHexBinary.new(str)
826
+ var = drv.echoHexBinary(arg)
827
+ assert_equal(str, var)
828
+ end
829
+
830
+ def test_echoHexBinary_0a_0
831
+ log_test
832
+ str = "a\0b\0\0c\0\0\0"
833
+ arg = SOAP::SOAPHexBinary.new(str)
834
+ var = drv.echoHexBinary(arg)
835
+ assert_equal(str, var)
836
+ end
837
+
838
+ def test_echoHexBinary_lower_case
839
+ log_test
840
+ str = "lower case"
841
+ arg = SOAP::SOAPHexBinary.new
842
+ arg.set_encoded((str.unpack("H*")[0]).tr('A-F', 'a-f'))
843
+ var = drv.echoHexBinary(arg)
844
+ assert_equal(str, var)
845
+ end
846
+
847
+ def test_echoHexBinary_0FG7_junk
848
+ log_test
849
+ assert_exception(SOAP::RPC::ServerException) do
850
+ arg = SOAP::SOAPHexBinary.new("dummy")
851
+ arg.instance_eval { @data = '0FG7' }
852
+ var = drv.echoHexBinary(arg)
853
+ end
854
+ end
855
+
856
+ def test_echoBoolean_true
857
+ log_test
858
+ arg = true
859
+ var = drv.echoBoolean(arg)
860
+ assert_equal(arg, var)
861
+ end
862
+
863
+ def test_echoBoolean_false
864
+ log_test
865
+ arg = false
866
+ var = drv.echoBoolean(arg)
867
+ assert_equal(arg, var)
868
+ end
869
+
870
+ def test_echoBoolean_junk
871
+ log_test
872
+ assert_exception(SOAP::RPC::ServerException) do
873
+ arg = SOAP::SOAPBoolean.new(true)
874
+ arg.instance_eval { @data = 'junk' }
875
+ var = drv.echoBoolean(arg)
876
+ end
877
+ end
878
+
879
+ def test_echoDecimal_123456
880
+ log_test
881
+ arg = "123456789012345678"
882
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
883
+ normalized = arg
884
+ assert_equal(normalized, var)
885
+ end
886
+
887
+ def test_echoDecimal_0_123
888
+ log_test
889
+ arg = "+0.12345678901234567"
890
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
891
+ normalized = arg.sub(/0$/, '').sub(/^\+/, '')
892
+ assert_equal(normalized, var)
893
+ end
894
+
895
+ def test_echoDecimal_00000123
896
+ log_test
897
+ arg = ".00000123456789012"
898
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
899
+ normalized = '0' << arg.sub(/0$/, '')
900
+ assert_equal(normalized, var)
901
+ end
902
+
903
+ def test_echoDecimal_negative_00000123
904
+ log_test
905
+ arg = "-.00000123456789012"
906
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
907
+ normalized = '-0' << arg.sub(/0$/, '').sub(/-/, '')
908
+ assert_equal(normalized, var)
909
+ end
910
+
911
+ def test_echoDecimal_123_456
912
+ log_test
913
+ arg = "-123456789012345.008"
914
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
915
+ assert_equal(arg, var)
916
+ end
917
+
918
+ def test_echoDecimal_123
919
+ log_test
920
+ arg = "-12345678901234567."
921
+ normalized = arg.sub(/\.$/, '')
922
+ var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg))
923
+ assert_equal(normalized, var)
924
+ end
925
+
926
+ def test_echoDecimal_0_000a_junk
927
+ log_test
928
+ assert_exception(SOAP::RPC::ServerException) do
929
+ arg = FakeDecimal.new("0.0000000000000000a")
930
+ var = drv.echoDecimal(arg)
931
+ end
932
+ end
933
+
934
+ def test_echoDecimal_00a_0001_junk
935
+ log_test
936
+ assert_exception(SOAP::RPC::ServerException) do
937
+ arg = FakeDecimal.new("00a.000000000000001")
938
+ var = drv.echoDecimal(arg)
939
+ end
940
+ end
941
+
942
+ def test_echoDecimal_plus_minus_5_junk
943
+ log_test
944
+ assert_exception(SOAP::RPC::ServerException) do
945
+ arg = FakeDecimal.new("+-5")
946
+ var = drv.echoDecimal(arg)
947
+ end
948
+ end
949
+
950
+ def test_echoDecimal_5_0_junk
951
+ log_test
952
+ assert_exception(SOAP::RPC::ServerException) do
953
+ arg = FakeDecimal.new("5_0")
954
+ var = drv.echoDecimal(arg)
955
+ end
956
+ end
957
+
958
+ def test_echoMap
959
+ log_test
960
+ arg = { "a" => 1, "b" => 2 }
961
+ var = drv.echoMap(arg)
962
+ assert_equal(arg, var)
963
+ end
964
+
965
+ def test_echoMap_boolean_base64_nil_float
966
+ log_test
967
+ arg = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false }
968
+ var = drv.echoMap(arg)
969
+ assert_equal(arg, var)
970
+ end
971
+
972
+ def test_echoMap_multibyte_char
973
+ log_test
974
+ arg = { "Hello (���ܸ�Japanese) ����ˤ���" => 1, 1 => "Hello (���ܸ�Japanese) ����ˤ���" }
975
+ var = drv.echoMap(arg)
976
+ assert_equal(arg, var)
977
+ end
978
+
979
+ def test_echoMap_Struct
980
+ log_test
981
+ obj = SOAPStruct.new(1, 1.1, "a")
982
+ arg = { 1 => obj, 2 => obj }
983
+ var = drv.echoMap(arg)
984
+ assert_equal(arg, var)
985
+ end
986
+
987
+ def test_echoMap_multi_ref_idmatch_value_for_key_a
988
+ log_test
989
+ value = "c"
990
+ arg = { "a" => value, "b" => value }
991
+ var = drv.echoMap(arg)
992
+ assert_equal(inspect_with_id(var["a"]), inspect_with_id(var["b"]))
993
+ end
994
+
995
+ def test_echoMap_Struct_multi_ref_idmatch_varString_of_a_key
996
+ log_test
997
+ str = ""
998
+ obj = SOAPStruct.new(1, 1.1, str)
999
+ arg = { obj => "1", "1" => obj }
1000
+ var = drv.echoMap(arg)
1001
+ assert_equal(inspect_with_id(var.index("1").varString), inspect_with_id(var.fetch("1").varString))
1002
+ end
1003
+
1004
+ def test_echoMapArray
1005
+ log_test
1006
+ map1 = { "a" => 1, "b" => 2 }
1007
+ map2 = { "a" => 1, "b" => 2 }
1008
+ map3 = { "a" => 1, "b" => 2 }
1009
+ arg = [map1, map2, map3]
1010
+ var = drv.echoMapArray(arg)
1011
+ assert_equal(arg, var)
1012
+ end
1013
+
1014
+ def test_echoMapArray_boolean_base64_nil_float
1015
+ log_test
1016
+ map1 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false }
1017
+ map2 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false }
1018
+ map3 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false }
1019
+ arg = [map1, map2, map3]
1020
+ var = drv.echoMapArray(arg)
1021
+ assert_equal(arg, var)
1022
+ end
1023
+
1024
+ def test_echoMapArray_multibyte_char
1025
+ log_test
1026
+ map1 = { "Hello (���ܸ�Japanese) ����ˤ���" => 1, 1 => "Hello (���ܸ�Japanese) ����ˤ���" }
1027
+ map2 = { "Hello (���ܸ�Japanese) ����ˤ���" => 1, 1 => "Hello (���ܸ�Japanese) ����ˤ���" }
1028
+ map3 = { "Hello (���ܸ�Japanese) ����ˤ���" => 1, 1 => "Hello (���ܸ�Japanese) ����ˤ���" }
1029
+ arg = [map1, map2, map3]
1030
+ var = drv.echoMapArray(arg)
1031
+ assert_equal(arg, var)
1032
+ end
1033
+
1034
+ def test_echoMapArray_multi_ref_idmatch
1035
+ log_test
1036
+ map1 = { "a" => 1, "b" => 2 }
1037
+ map2 = { "a" => 1, "b" => 2 }
1038
+ arg = [map1, map1, map2]
1039
+ var = drv.echoMapArray(arg)
1040
+ assert_equal(inspect_with_id(var[0]), inspect_with_id(var[1]))
1041
+ end
1042
+
1043
+ def test_echoStructAsSimpleTypes
1044
+ log_test
1045
+ arg = SOAPStruct.new(1, 1.1, "a")
1046
+ ret, out1, out2 = drv.echoStructAsSimpleTypes(arg)
1047
+ var = SOAPStruct.new(out1, out2, ret)
1048
+ assert_equal(arg, var)
1049
+ end
1050
+
1051
+ def test_echoStructAsSimpleTypes_nil
1052
+ log_test
1053
+ arg = SOAPStruct.new(nil, nil, nil)
1054
+ ret, out1, out2 = drv.echoStructAsSimpleTypes(arg)
1055
+ var = SOAPStruct.new(out1, out2, ret)
1056
+ assert_equal(arg, var)
1057
+ end
1058
+
1059
+ def test_echoSimpleTypesAsStruct
1060
+ log_test
1061
+ arg = SOAPStruct.new(1, 1.1, "a")
1062
+ var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat)
1063
+ assert_equal(arg, var)
1064
+ end
1065
+
1066
+ def test_echoSimpleTypesAsStruct_nil
1067
+ log_test
1068
+ arg = SOAPStruct.new(nil, nil, nil)
1069
+ var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat)
1070
+ assert_equal(arg, var)
1071
+ end
1072
+
1073
+ def test_echo2DStringArray
1074
+ log_test
1075
+ # arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 2, XSD::XSDString::Type)
1076
+ # arg[0, 0] = obj2soap('r0c0')
1077
+ # arg[1, 0] = obj2soap('r1c0')
1078
+ # arg[2, 0] = obj2soap('r2c0')
1079
+ # arg[0, 1] = obj2soap('r0c1')
1080
+ # arg[1, 1] = obj2soap('r1c1')
1081
+ # arg[2, 1] = obj2soap('r2c1')
1082
+ # arg[0, 2] = obj2soap('r0c2')
1083
+ # arg[1, 2] = obj2soap('r1c2')
1084
+ # arg[2, 2] = obj2soap('r2c2')
1085
+
1086
+ arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type)
1087
+ arg.size = [3, 3]
1088
+ arg.size_fixed = true
1089
+ arg.add(SOAP::Mapping.obj2soap('r0c0', SOAPBuildersInterop::MappingRegistry))
1090
+ arg.add(SOAP::Mapping.obj2soap('r1c0', SOAPBuildersInterop::MappingRegistry))
1091
+ arg.add(SOAP::Mapping.obj2soap('r2c0', SOAPBuildersInterop::MappingRegistry))
1092
+ arg.add(SOAP::Mapping.obj2soap('r0c1', SOAPBuildersInterop::MappingRegistry))
1093
+ arg.add(SOAP::Mapping.obj2soap('r1c1', SOAPBuildersInterop::MappingRegistry))
1094
+ arg.add(SOAP::Mapping.obj2soap('r2c1', SOAPBuildersInterop::MappingRegistry))
1095
+ arg.add(SOAP::Mapping.obj2soap('r0c2', SOAPBuildersInterop::MappingRegistry))
1096
+ arg.add(SOAP::Mapping.obj2soap('r1c2', SOAPBuildersInterop::MappingRegistry))
1097
+ arg.add(SOAP::Mapping.obj2soap('r2c2', SOAPBuildersInterop::MappingRegistry))
1098
+ argNormalized = [
1099
+ ['r0c0', 'r1c0', 'r2c0'],
1100
+ ['r0c1', 'r1c1', 'r2c1'],
1101
+ ['r0c2', 'r1c2', 'r2c2'],
1102
+ ]
1103
+
1104
+ var = drv.echo2DStringArray(arg)
1105
+ assert_equal(argNormalized, var)
1106
+ end
1107
+
1108
+ def test_echo2DStringArray_anyType_array
1109
+ log_test
1110
+ # ary2md converts Arry ((of Array)...) into M-D anyType Array
1111
+ arg = [
1112
+ ['r0c0', 'r0c1', 'r0c2'],
1113
+ ['r1c0', 'r1c1', 'r1c2'],
1114
+ ['r2c0', 'r0c1', 'r2c2'],
1115
+ ]
1116
+
1117
+ paramArg = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::AnyTypeLiteral, SOAPBuildersInterop::MappingRegistry)
1118
+ paramArg.type = XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D')
1119
+ var = drv.echo2DStringArray(paramArg)
1120
+ assert_equal(arg, var)
1121
+ end
1122
+
1123
+ def test_echo2DStringArray_multi_ref
1124
+ log_test
1125
+ arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type)
1126
+ arg.size = [3, 3]
1127
+ arg.size_fixed = true
1128
+
1129
+ item = 'item'
1130
+ arg.add('r0c0')
1131
+ arg.add('r1c0')
1132
+ arg.add(item)
1133
+ arg.add('r0c1')
1134
+ arg.add('r1c1')
1135
+ arg.add('r2c1')
1136
+ arg.add(item)
1137
+ arg.add('r1c2')
1138
+ arg.add('r2c2')
1139
+ argNormalized = [
1140
+ ['r0c0', 'r1c0', 'item'],
1141
+ ['r0c1', 'r1c1', 'r2c1'],
1142
+ ['item', 'r1c2', 'r2c2'],
1143
+ ]
1144
+
1145
+ var = drv.echo2DStringArray(arg)
1146
+ assert_equal(argNormalized, var)
1147
+ end
1148
+
1149
+ def test_echo2DStringArray_multi_ref_idmatch
1150
+ log_test
1151
+ arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type)
1152
+ arg.size = [3, 3]
1153
+ arg.size_fixed = true
1154
+
1155
+ item = 'item'
1156
+ arg.add('r0c0')
1157
+ arg.add('r1c0')
1158
+ arg.add(item)
1159
+ arg.add('r0c1')
1160
+ arg.add('r1c1')
1161
+ arg.add('r2c1')
1162
+ arg.add(item)
1163
+ arg.add('r1c2')
1164
+ arg.add('r2c2')
1165
+
1166
+ var = drv.echo2DStringArray(arg)
1167
+ assert_equal(inspect_with_id(var[2][0]), inspect_with_id(var[0][2]))
1168
+ end
1169
+
1170
+ def test_echoNestedStruct
1171
+ log_test
1172
+ arg = SOAPStructStruct.new(1, 1.1, "a",
1173
+ SOAPStruct.new(2, 2.2, "b")
1174
+ )
1175
+ var = drv.echoNestedStruct(arg)
1176
+ assert_equal(arg, var)
1177
+ end
1178
+
1179
+ def test_echoNestedStruct_nil
1180
+ log_test
1181
+ arg = SOAPStructStruct.new(nil, nil, nil,
1182
+ SOAPStruct.new(nil, nil, nil)
1183
+ )
1184
+ var = drv.echoNestedStruct(arg)
1185
+ assert_equal(arg, var)
1186
+ end
1187
+
1188
+ def test_echoNestedStruct_multi_ref_idmatch
1189
+ log_test
1190
+ str1 = ""
1191
+ arg = SOAPStructStruct.new(1, 1.1, str1,
1192
+ SOAPStruct.new(2, 2.2, str1)
1193
+ )
1194
+ var = drv.echoNestedStruct(arg)
1195
+ assert_equal(inspect_with_id(var.varString), inspect_with_id(var.varStruct.varString))
1196
+ end
1197
+
1198
+ def test_echoNestedArray
1199
+ log_test
1200
+ arg = SOAPArrayStruct.new(1, 1.1, "a", StringArray["2", "2.2", "b"])
1201
+ var = drv.echoNestedArray(arg)
1202
+ assert_equal(arg, var)
1203
+ end
1204
+
1205
+ def test_echoNestedArray_anyType_array
1206
+ log_test
1207
+ arg = SOAPArrayStruct.new(1, 1.1, "a", ["2", "2.2", "b"])
1208
+ var = drv.echoNestedArray(arg)
1209
+ assert_equal(arg, var)
1210
+ end
1211
+
1212
+ def test_echoNestedArray_multi_ref
1213
+ log_test
1214
+ str = ""
1215
+ arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"])
1216
+ var = drv.echoNestedArray(arg)
1217
+ assert_equal(arg, var)
1218
+ end
1219
+
1220
+ def test_echoNestedArray_multi_ref_idmatch
1221
+ log_test
1222
+ str = ""
1223
+ arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"])
1224
+ var = drv.echoNestedArray(arg)
1225
+ assert_equal(inspect_with_id(var.varString), inspect_with_id(var.varArray[1]))
1226
+ end
1227
+ end
1228
+
1229
+ if $0 == __FILE__
1230
+ #name = ARGV.shift || 'localhost'
1231
+ #location = ARGV.shift || 'http://localhost:10080/'
1232
+ name = 'localhsot'; location = 'http://localhost:10080/'
1233
+ SOAPBuildersTest.setup(name, location)
1234
+ end