diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-17 22:20:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-17 22:20:09 +0000 |
commit | d4b27a0b36109c6ded5dba57db63d4ff12ec74d1 (patch) | |
tree | 9676cce672fec31da46a8de358e68c152e44528e /actionwebservice/lib | |
parent | d712310518dcfe42966e7de936794c9a816b0e21 (diff) | |
download | rails-d4b27a0b36109c6ded5dba57db63d4ff12ec74d1.tar.gz rails-d4b27a0b36109c6ded5dba57db63d4ff12ec74d1.tar.bz2 rails-d4b27a0b36109c6ded5dba57db63d4ff12ec74d1.zip |
Fix soap type registration of multidimensional arrays (closes #4232) [Kent]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib')
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb b/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb index fa917ad4a5..351c9da159 100644 --- a/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb @@ -40,32 +40,25 @@ module ActionWebService def register_type(type) return @type2binding[type] if @type2binding.has_key?(type) - type_class = type.array?? type.element_type.type_class : type.type_class - type_type = type.array?? type.element_type : type - type_binding = nil - if (mapping = @registry.find_mapped_soap_class(type_class) rescue nil) - qname = mapping[2] ? mapping[2][:type] : nil - qname ||= soap_base_type_name(mapping[0]) - type_binding = SoapBinding.new(self, qname, type_type, mapping) - else - qname = XSD::QName.new(@namespace, soap_type_name(type_class.name)) - @registry.add(type_class, - SOAP::SOAPStruct, - typed_struct_factory(type_class), - { :type => qname }) - mapping = @registry.find_mapped_soap_class(type_class) - type_binding = SoapBinding.new(self, qname, type_type, mapping) - end - - array_binding = nil if type.array? array_mapping = @registry.find_mapped_soap_class(Array) qname = XSD::QName.new(@namespace, soap_type_name(type.element_type.type_class.name) + 'Array') - array_binding = SoapBinding.new(self, qname, type, array_mapping, type_binding) + element_type_binding = register_type(type.element_type) + @type2binding[type] = SoapBinding.new(self, qname, type, array_mapping, element_type_binding) + elsif (mapping = @registry.find_mapped_soap_class(type.type_class) rescue nil) + qname = mapping[2] ? mapping[2][:type] : nil + qname ||= soap_base_type_name(mapping[0]) + @type2binding[type] = SoapBinding.new(self, qname, type, mapping) + else + qname = XSD::QName.new(@namespace, soap_type_name(type.type_class.name)) + @registry.add(type.type_class, + SOAP::SOAPStruct, + typed_struct_factory(type.type_class), + { :type => qname }) + mapping = @registry.find_mapped_soap_class(type.type_class) + @type2binding[type] = SoapBinding.new(self, qname, type, mapping) end - @type2binding[type] = array_binding ? array_binding : type_binding - if type.structured? type.each_member do |m_name, m_type| register_type(m_type) |