Permalink
Browse files

* lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.4.

	  == SOAP client and server ==

	  === for both client side and server side ===

	  * improved document/literal service support.
	    style(rpc,document)/use(encoding, literal) combination are all
	    supported.  for the detail about combination, see
	    test/soap/test_style.rb.

	  * let WSDLEncodedRegistry#soap2obj map SOAP/OM to Ruby according to
	    WSDL as well as obj2soap.  closes #70.

	  * let SOAP::Mapping::Object handle XML attribute for doc/lit service.
	    you can set/get XML attribute via accessor methods which as a name
	    'xmlattr_' prefixed (<foo name="bar"/> -> Foo#xmlattr_name).

	  === client side ===

	  * WSDLDriver capitalized name operation bug fixed.  from
	    1.5.3-ruby1.8.2, operation which has capitalized name (such as
	    KeywordSearchRequest in AWS) is defined as a method having
	    uncapitalized name. (converted with GenSupport.safemethodname
	    to handle operation name 'foo-bar').  it introduced serious
	    incompatibility; in the past, it was defined as a capitalized.
	    define capitalized method as well under that circumstance.

	  * added new factory interface 'WSDLDriverFactory#create_rpc_driver'
	    to create RPC::Driver, not WSDLDriver (RPC::Driver and WSDLDriver
	    are merged).  'WSDLDriverFactory#create_driver' still creates
	    WSDLDriver for compatibility but it warns that the method is
	    deprecated.  please use create_rpc_driver instead of create_driver.

	  * allow to use an URI object as an endpoint_url even with net/http,
	    not http-access2.

	  === server side ===

	  * added mod_ruby support to SOAP::CGIStub.  rename a CGI script
	    server.cgi to server.rb and let mod_ruby's RubyHandler handles the
	    script.  CGIStub detects if it's running under mod_ruby environment
	    or not.

	  * added fcgi support to SOAP::CGIStub.  see the sample at
	    sample/soap/calc/server.fcgi.  (almost same as server.cgi but has
	    fcgi handler at the bottom.)

	  * allow to return a SOAPFault object to respond customized SOAP fault.

	  * added the interface 'generate_explicit_type' for server side
	    (CGIStub, HTTPServer).  call 'self.generate_explicit_type = true'
	    if you want to return simplified XML even if it's rpc/encoded
	    service.

	  == WSDL ==

	  === WSDL definition ===

	  * improved XML Schema support such as extension, restriction,
	    simpleType, complexType + simpleContent, ref, length, import,
	    include.

	  * reduced "unknown element/attribute" warnings (warn only 1 time for
	    each QName).

	  * importing XSD file at schemaLocation with xsd:import.

	  === code generation from WSDL ===

	  * generator crashed when there's '-' in defined element/attribute
	    name.

	  * added ApacheMap WSDL definition.

	* sample/{soap,wsdl}: removed.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 155963c commit 8f133157dbbd23640a03918460d0b62e21ea5873 @nahi nahi committed May 22, 2005
Showing with 3,163 additions and 9,360 deletions.
  1. +80 −1 ChangeLog
  2. +103 −25 lib/soap/baseData.rb
  3. +12 −5 lib/soap/element.rb
  4. +6 −7 lib/soap/encodingstyle/aspDotNetHandler.rb
  5. +20 −15 lib/soap/encodingstyle/literalHandler.rb
  6. +14 −12 lib/soap/encodingstyle/soapHandler.rb
  7. +6 −1 lib/soap/generator.rb
  8. +12 −0 lib/soap/header/handlerset.rb
  9. +2 −2 lib/soap/header/simplehandler.rb
  10. +25 −27 lib/soap/mapping/factory.rb
  11. +105 −47 lib/soap/mapping/mapping.rb
  12. +108 −50 lib/soap/mapping/registry.rb
  13. +32 −9 lib/soap/mapping/rubytypeFactory.rb
  14. +139 −43 lib/soap/mapping/wsdlencodedregistry.rb
  15. +225 −112 lib/soap/mapping/wsdlliteralregistry.rb
  16. +3 −2 lib/soap/marshal.rb
  17. +16 −7 lib/soap/netHttpClient.rb
  18. +117 −117 lib/soap/rpc/cgistub.rb
  19. +124 −223 lib/soap/rpc/driver.rb
  20. +78 −23 lib/soap/rpc/element.rb
  21. +46 −53 lib/soap/rpc/httpserver.rb
  22. +201 −85 lib/soap/rpc/proxy.rb
  23. +401 −125 lib/soap/rpc/router.rb
  24. +64 −155 lib/soap/rpc/soaplet.rb
  25. +25 −1 lib/soap/soap.rb
  26. +16 −103 lib/soap/streamHandler.rb
  27. +166 −82 lib/soap/wsdlDriver.rb
  28. +18 −8 lib/wsdl/definitions.rb
  29. +18 −8 lib/wsdl/import.rb
  30. +13 −45 lib/wsdl/importer.rb
  31. +8 −2 lib/wsdl/info.rb
  32. +8 −6 lib/wsdl/operation.rb
  33. +29 −1 lib/wsdl/operationBinding.rb
  34. +4 −1 lib/wsdl/param.rb
  35. +26 −9 lib/wsdl/parser.rb
  36. +1 −1 lib/wsdl/port.rb
  37. +2 −1 lib/wsdl/portType.rb
  38. +8 −10 lib/wsdl/soap/cgiStubCreator.rb
  39. +152 −74 lib/wsdl/soap/classDefCreator.rb
  40. +5 −1 lib/wsdl/soap/classDefCreatorSupport.rb
  41. +22 −15 lib/wsdl/soap/complexType.rb
  42. +18 −21 lib/wsdl/soap/definitions.rb
  43. +14 −8 lib/wsdl/soap/driverCreator.rb
  44. +0 −6 lib/wsdl/soap/element.rb
  45. +4 −0 lib/wsdl/soap/fault.rb
  46. +10 −3 lib/wsdl/soap/header.rb
  47. +9 −7 lib/wsdl/soap/mappingRegistryCreator.rb
  48. +65 −51 lib/wsdl/soap/methodDefCreator.rb
  49. +2 −4 lib/wsdl/soap/operation.rb
  50. +4 −4 lib/wsdl/soap/servantSkeltonCreator.rb
  51. +9 −11 lib/wsdl/soap/standaloneServerStubCreator.rb
  52. +50 −10 lib/wsdl/xmlSchema/attribute.rb
  53. +5 −0 lib/wsdl/xmlSchema/complexContent.rb
  54. +10 −1 lib/wsdl/xmlSchema/data.rb
  55. +57 −15 lib/wsdl/xmlSchema/element.rb
  56. +23 −2 lib/wsdl/xmlSchema/import.rb
  57. +28 −11 lib/wsdl/xmlSchema/parser.rb
  58. +36 −0 lib/wsdl/xmlSchema/schema.rb
  59. +28 −28 lib/wsdl/xmlSchema/simpleContent.rb
  60. +27 −2 lib/wsdl/xmlSchema/simpleRestriction.rb
  61. +2 −10 lib/wsdl/xmlSchema/simpleType.rb
  62. +1 −1 lib/xsd/charset.rb
  63. +1 −1 lib/xsd/codegen/classdef.rb
  64. +2 −2 lib/xsd/codegen/commentdef.rb
  65. +60 −7 lib/xsd/codegen/gensupport.rb
  66. +1 −1 lib/xsd/codegen/methoddef.rb
  67. +1 −1 lib/xsd/codegen/moduledef.rb
  68. +31 −2 lib/xsd/datatypes.rb
  69. +1 −1 lib/xsd/iconvcharset.rb
  70. +13 −1 lib/xsd/namedelements.rb
  71. +9 −9 lib/xsd/ns.rb
  72. +6 −0 lib/xsd/qname.rb
  73. +1 −1 lib/xsd/xmlparser.rb
  74. +3 −3 lib/xsd/xmlparser/xmlscanner.rb
  75. +0 −41 sample/soap/authheader/authmgr.rb
  76. +0 −40 sample/soap/authheader/client.rb
  77. +0 −42 sample/soap/authheader/client2.rb
  78. +0 −73 sample/soap/authheader/server.rb
  79. +0 −83 sample/soap/authheader/server2.rb
  80. +0 −16 sample/soap/babelfish.rb
  81. +0 −17 sample/soap/calc/calc.rb
  82. +0 −29 sample/soap/calc/calc2.rb
  83. +0 −26 sample/soap/calc/client.rb
  84. +0 −29 sample/soap/calc/client2.rb
  85. +0 −20 sample/soap/calc/httpd.rb
  86. +0 −2 sample/soap/calc/samplehttpd.conf
  87. +0 −15 sample/soap/calc/server.cgi
  88. +0 −21 sample/soap/calc/server.rb
  89. +0 −24 sample/soap/calc/server2.rb
  90. +0 −43 sample/soap/digraph.rb
  91. +0 −19 sample/soap/exchange/client.rb
  92. +0 −17 sample/soap/exchange/exchange.rb
  93. +0 −20 sample/soap/exchange/httpd.rb
  94. +0 −2 sample/soap/exchange/samplehttpd.conf
  95. +0 −14 sample/soap/exchange/server.cgi
  96. +0 −16 sample/soap/exchange/server.rb
  97. +0 −6 sample/soap/helloworld/hw_c.rb
  98. +0 −8 sample/soap/helloworld/hw_c_gzip.rb
  99. +0 −20 sample/soap/helloworld/hw_s.rb
  100. +0 −21 sample/soap/helloworld/hw_s_gzip.rb
  101. +0 −17 sample/soap/icd/IICD.rb
  102. +0 −46 sample/soap/icd/icd.rb
  103. +0 −154 sample/soap/raa/iRAA.rb
  104. +0 −30 sample/soap/raa/soap4r.rb
  105. +0 −332 sample/soap/raa2.4/raa.rb
  106. +0 −255 sample/soap/raa2.4/raaDriver.rb
  107. +0 −354 sample/soap/raa2.4/raaServiceClient.rb
  108. +0 −115 sample/soap/raa2.4/sample.rb
  109. +0 −16 sample/soap/sampleStruct/client.rb
  110. +0 −20 sample/soap/sampleStruct/httpd.rb
  111. +0 −22 sample/soap/sampleStruct/iSampleStruct.rb
  112. +0 −13 sample/soap/sampleStruct/sampleStruct.rb
  113. +0 −2 sample/soap/sampleStruct/samplehttpd.conf
  114. +0 −14 sample/soap/sampleStruct/server.cgi
  115. +0 −20 sample/soap/sampleStruct/server.rb
  116. +0 −34 sample/soap/scopesample/client.rb
  117. +0 −22 sample/soap/scopesample/httpd.rb
  118. +0 −2 sample/soap/scopesample/samplehttpd.conf
  119. +0 −18 sample/soap/scopesample/servant.rb
  120. +0 −29 sample/soap/scopesample/server.cgi
  121. +0 −20 sample/soap/scopesample/server.rb
  122. +0 −1 sample/soap/ssl/files/README
  123. +0 −23 sample/soap/ssl/files/ca.cert
  124. +0 −19 sample/soap/ssl/files/client.cert
  125. +0 −15 sample/soap/ssl/files/client.key
  126. +0 −19 sample/soap/ssl/files/server.cert
  127. +0 −15 sample/soap/ssl/files/server.key
  128. +0 −5 sample/soap/ssl/files/sslclient.properties
  129. +0 −2 sample/soap/ssl/files/sslclient_require_noserverauth.properties
  130. +0 −9 sample/soap/ssl/files/sslclient_with_clientauth.properties
  131. +0 −21 sample/soap/ssl/files/subca.cert
  132. +0 −12 sample/soap/ssl/sslclient.rb
  133. +0 −12 sample/soap/ssl/sslclient_require_noserverauth.rb
  134. +0 −12 sample/soap/ssl/sslclient_with_clientauth.rb
  135. +0 −49 sample/soap/ssl/sslserver.rb
  136. +0 −45 sample/soap/ssl/sslserver_noauth.rb
  137. +0 −50 sample/soap/ssl/sslserver_require_clientauth.rb
  138. +0 −13 sample/soap/swa/client.rb
  139. +0 −23 sample/soap/swa/server.rb
  140. +0 −14 sample/soap/whois.rb
  141. +0 −3,057 sample/wsdl/amazon/AmazonSearch.rb
  142. +0 −536 sample/wsdl/amazon/AmazonSearchDriver.rb
  143. +0 −37 sample/wsdl/amazon/sampleClient.rb
  144. +0 −52 sample/wsdl/amazon/wsdlDriver.rb
  145. +0 −258 sample/wsdl/googleSearch/GoogleSearch.rb
  146. +0 −101 sample/wsdl/googleSearch/GoogleSearchDriver.rb
  147. +0 −6 sample/wsdl/googleSearch/README
  148. +0 −20 sample/wsdl/googleSearch/httpd.rb
  149. +0 −56 sample/wsdl/googleSearch/sampleClient.rb
  150. +0 −2 sample/wsdl/googleSearch/samplehttpd.conf
  151. +0 −3 sample/wsdl/googleSearch/sjissearch.sh
  152. +0 −23 sample/wsdl/googleSearch/wsdlDriver.rb
  153. +0 −264 sample/wsdl/raa/raa.wsdl
  154. +0 −31 sample/wsdl/raa/soap4r.rb
  155. +0 −332 sample/wsdl/raa2.4/raa.rb
  156. +0 −117 sample/wsdl/raa2.4/wsdlDriver.rb
  157. +0 −7 test/soap/calc/test_calc.rb
  158. +0 −7 test/soap/calc/test_calc2.rb
  159. +0 −7 test/soap/calc/test_calc_cgi.rb
  160. +4 −4 test/soap/header/server.cgi
  161. +1 −8 test/soap/header/test_authheader.rb
  162. +0 −7 test/soap/header/test_authheader_cgi.rb
  163. +0 −7 test/soap/helloworld/test_helloworld.rb
  164. +0 −7 test/soap/ssl/sslsvr.rb
  165. +27 −2 test/soap/ssl/test_ssl.rb
  166. +1 −7 test/soap/struct/test_struct.rb
  167. +0 −7 test/soap/swa/test_file.rb
  168. +6 −0 test/soap/test_basetype.rb
  169. +13 −7 test/soap/test_streamhandler.rb
  170. +3 −3 test/soap/wsdlDriver/simpletype.wsdl
  171. +2 −1 test/soap/wsdlDriver/test_calc.rb
  172. +5 −10 test/soap/wsdlDriver/test_simpletype.rb
  173. +24 −18 test/wsdl/datetime/DatetimeService.rb
  174. +2 −8 test/wsdl/datetime/test_datetime.rb
  175. +3 −8 test/wsdl/map/test_map.rb
  176. +1 −2 test/wsdl/raa/RAAService.rb
  177. +1 −8 test/wsdl/raa/test_raa.rb
  178. +33 −5 test/wsdl/simpletype/simpletype.wsdl
  179. +30 −12 test/wsdl/simpletype/test_simpletype.rb
  180. +10 −17 test/wsdl/soap/test_soapbodyparts.rb
  181. +6 −0 test/xsd/test_xsd.rb
View
@@ -1,4 +1,83 @@
-XSun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun May 22 21:54:06 2005 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
+
+ * lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.4.
+
+ == SOAP client and server ==
+
+ === for both client side and server side ===
+
+ * improved document/literal service support.
+ style(rpc,document)/use(encoding, literal) combination are all
+ supported. for the detail about combination, see
+ test/soap/test_style.rb.
+
+ * let WSDLEncodedRegistry#soap2obj map SOAP/OM to Ruby according to
+ WSDL as well as obj2soap. closes #70.
+
+ * let SOAP::Mapping::Object handle XML attribute for doc/lit service.
+ you can set/get XML attribute via accessor methods which as a name
+ 'xmlattr_' prefixed (<foo name="bar"/> -> Foo#xmlattr_name).
+
+ === client side ===
+
+ * WSDLDriver capitalized name operation bug fixed. from
+ 1.5.3-ruby1.8.2, operation which has capitalized name (such as
+ KeywordSearchRequest in AWS) is defined as a method having
+ uncapitalized name. (converted with GenSupport.safemethodname
+ to handle operation name 'foo-bar'). it introduced serious
+ incompatibility; in the past, it was defined as a capitalized.
+ define capitalized method as well under that circumstance.
+
+ * added new factory interface 'WSDLDriverFactory#create_rpc_driver'
+ to create RPC::Driver, not WSDLDriver (RPC::Driver and WSDLDriver
+ are merged). 'WSDLDriverFactory#create_driver' still creates
+ WSDLDriver for compatibility but it warns that the method is
+ deprecated. please use create_rpc_driver instead of create_driver.
+
+ * allow to use an URI object as an endpoint_url even with net/http,
+ not http-access2.
+
+ === server side ===
+
+ * added mod_ruby support to SOAP::CGIStub. rename a CGI script
+ server.cgi to server.rb and let mod_ruby's RubyHandler handles the
+ script. CGIStub detects if it's running under mod_ruby environment
+ or not.
+
+ * added fcgi support to SOAP::CGIStub. see the sample at
+ sample/soap/calc/server.fcgi. (almost same as server.cgi but has
+ fcgi handler at the bottom.)
+
+ * allow to return a SOAPFault object to respond customized SOAP fault.
+
+ * added the interface 'generate_explicit_type' for server side
+ (CGIStub, HTTPServer). call 'self.generate_explicit_type = true'
+ if you want to return simplified XML even if it's rpc/encoded
+ service.
+
+ == WSDL ==
+
+ === WSDL definition ===
+
+ * improved XML Schema support such as extension, restriction,
+ simpleType, complexType + simpleContent, ref, length, import,
+ include.
+
+ * reduced "unknown element/attribute" warnings (warn only 1 time for
+ each QName).
+
+ * importing XSD file at schemaLocation with xsd:import.
+
+ === code generation from WSDL ===
+
+ * generator crashed when there's '-' in defined element/attribute
+ name.
+
+ * added ApacheMap WSDL definition.
+
+ * sample/{soap,wsdl}: removed.
+
+Sun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#intialize):
should initialize session id context. [ruby-core:4663]
View
@@ -1,5 +1,5 @@
# soap/baseData.rb: SOAP4R - Base type library
-# Copyright (C) 2000, 2001, 2003, 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
@@ -56,6 +56,14 @@ def initialize(*arg)
@extraattr = {}
end
+ def inspect
+ if self.is_a?(XSD::NSDBase)
+ sprintf("#<%s:0x%x %s %s>", self.class.name, __id__, self.elename, self.type)
+ else
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+ end
+
def rootnode
node = self
while node = node.parent
@@ -399,7 +407,7 @@ def initialize(type = nil)
def to_s()
str = ''
self.each do |key, data|
- str << "#{ key }: #{ data }\n"
+ str << "#{key}: #{data}\n"
end
str
end
@@ -442,6 +450,25 @@ def members
@array
end
+ def to_obj
+ hash = {}
+ proptype = {}
+ each do |k, v|
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
+ end
+ hash
+ end
+
def each
for i in 0..(@array.length - 1)
yield(@array[i], @data[i])
@@ -509,6 +536,10 @@ def initialize(elename, text = nil)
@text = text
end
+ def inspect
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+
# Text interface.
attr_accessor :text
alias data text
@@ -548,8 +579,19 @@ def to_obj
@text
else
hash = {}
+ proptype = {}
each do |k, v|
- hash[k] = v.is_a?(SOAPElement) ? v.to_obj : v.to_s
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
end
hash
end
@@ -566,20 +608,41 @@ def self.decode(elename)
o
end
- def self.from_obj(hash_or_string)
+ def self.from_obj(obj, namespace = nil)
o = SOAPElement.new(nil)
- if hash_or_string.is_a?(Hash)
- hash_or_string.each do |k, v|
- child = self.from_obj(v)
- child.elename = k.is_a?(XSD::QName) ? k : XSD::QName.new(nil, k.to_s)
- o.add(child)
+ case obj
+ when nil
+ o.text = nil
+ when Hash
+ obj.each do |elename, value|
+ if value.is_a?(Array)
+ value.each do |subvalue|
+ child = from_obj(subvalue, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
+ else
+ child = from_obj(value, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
end
else
- o.text = hash_or_string
+ o.text = obj.to_s
end
o
end
+ def self.to_elename(obj, namespace = nil)
+ if obj.is_a?(XSD::QName)
+ obj
+ elsif /\A(.+):([^:]+)\z/ =~ obj.to_s
+ XSD::QName.new($1, $2)
+ else
+ XSD::QName.new(namespace, obj.to_s)
+ end
+ end
+
private
def add_member(name, value)
@@ -590,18 +653,32 @@ def add_member(name, value)
value
end
- def add_accessor(name)
- methodname = name
- if self.respond_to?(methodname)
- methodname = safe_accessor_name(methodname)
+ if RUBY_VERSION > "1.7.0"
+ def add_accessor(name)
+ methodname = name
+ if self.respond_to?(methodname)
+ methodname = safe_accessor_name(methodname)
+ end
+ Mapping.define_singleton_method(self, methodname) do
+ @data[@array.index(name)]
+ end
+ Mapping.define_singleton_method(self, methodname + '=') do |value|
+ @data[@array.index(name)] = value
+ end
+ end
+ else
+ def add_accessor(name)
+ methodname = safe_accessor_name(name)
+ instance_eval <<-EOS
+ def #{methodname}
+ @data[@array.index(#{name.dump})]
+ end
+
+ def #{methodname}=(value)
+ @data[@array.index(#{name.dump})] = value
+ end
+ EOS
end
- sclass = class << self; self; end
- sclass.__send__(:define_method, methodname, proc {
- @data[@array.index(name)]
- })
- sclass.__send__(:define_method, methodname + '=', proc { |value|
- @data[@array.index(name)] = value
- })
end
def safe_accessor_name(name)
@@ -624,7 +701,7 @@ class SOAPArray < XSD::NSDBase
def initialize(type = nil, rank = 1, arytype = nil)
super()
- @type = type || XSD::QName.new
+ @type = type || ValueArrayName
@rank = rank
@data = Array.new
@sparse = false
@@ -646,7 +723,7 @@ def add(value)
def [](*idxary)
if idxary.size != @rank
- raise ArgumentError.new("Given #{ idxary.size } params does not match rank: #{ @rank }")
+ raise ArgumentError.new("given #{idxary.size} params does not match rank: #{@rank}")
end
retrieve(idxary)
@@ -656,7 +733,8 @@ def []=(*idxary)
value = idxary.slice!(-1)
if idxary.size != @rank
- raise ArgumentError.new("Given #{ idxary.size } params(#{ idxary }) does not match rank: #{ @rank }")
+ raise ArgumentError.new("given #{idxary.size} params(#{idxary})" +
+ " does not match rank: #{@rank}")
end
for i in 0..(idxary.size - 1)
@@ -836,7 +914,7 @@ def self.decode(elename, type, arytype)
private
def self.create_arytype(typename, rank)
- "#{ typename }[" << ',' * (rank - 1) << ']'
+ "#{typename}[" << ',' * (rank - 1) << ']'
end
TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$')
View
@@ -1,5 +1,5 @@
# SOAP4R - SOAP elements library
-# Copyright (C) 2000, 2001, 2003, 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
@@ -99,7 +99,15 @@ def initialize(data = nil, is_fault = false)
super(nil)
@elename = EleBodyName
@encodingstyle = nil
- add(data.elename.name, data) if data
+ if data
+ if data.respond_to?(:elename)
+ add(data.elename.name, data)
+ else
+ data.to_a.each do |datum|
+ add(datum.elename.name, datum)
+ end
+ end
+ end
@is_fault = is_fault
end
@@ -129,7 +137,7 @@ def root_node
end
end
- raise SOAPParser::FormatDecodeError.new('No root element.')
+ raise Parser::FormatDecodeError.new('no root element')
end
end
@@ -231,8 +239,7 @@ def body=(body)
end
def encode(generator, ns, attrs = {})
- SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace,
- SOAPNamespaceTag)
+ SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace, SOAPNamespaceTag)
name = ns.name(@elename)
generator.encode_tag(name, attrs)
@@ -1,5 +1,5 @@
# SOAP4R - ASP.NET EncodingStyle handler library
-# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+# Copyright (C) 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
@@ -30,7 +30,7 @@ def initialize(charset = nil)
def encode_data(generator, ns, qualified, data, parent)
attrs = {}
name = if qualified and data.elename.namespace
- SOAPGenerator.assign_ns(attrs, ns, data.elename.namespace)
+ SOAPGenerator.assign_ns(attrs, ns, data.elename.namespace, '')
ns.name(data.elename)
else
data.elename.name
@@ -61,8 +61,8 @@ def encode_data(generator, ns, qualified, data, parent)
yield(child, true)
end
else
- raise EncodingStyleError.new("Unknown object:#{ data } in this encodingSt
-yle.")
+ raise EncodingStyleError.new(
+ "unknown object:#{data} in this encodingStyle")
end
end
@@ -119,7 +119,6 @@ def as_nil
end
def decode_tag(ns, elename, attrs, parent)
- # ToDo: check if @textbuf is empty...
@textbuf = ''
o = SOAPUnknown.new(self, elename)
o.parent = parent
@@ -190,11 +189,11 @@ def decode_parent(parent, node)
end
when SOAPBasetype
- raise EncodingStyleError.new("SOAP base type must not have a child.")
+ raise EncodingStyleError.new("SOAP base type must not have a child")
else
# SOAPUnknown does not have parent.
- # raise EncodingStyleError.new("Illegal parent: #{ parent }.")
+ # raise EncodingStyleError.new("illegal parent: #{parent}")
end
end
Oops, something went wrong.

0 comments on commit 8f13315

Please sign in to comment.