diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-03 03:19:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-03 03:19:37 +0000 |
commit | 3d4965765cd47df7f3f9d3db4cbb117936b1c939 (patch) | |
tree | a7dcd1024112bde8716f09c1e75da22cb640d38f /actionwebservice/lib/action_web_service/protocol | |
parent | 94725b02bcc5e623dcbe1d73d57b2ede2c88440e (diff) | |
download | rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.tar.gz rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.tar.bz2 rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.zip |
Fix a ton of issues with AWS (yes, Kent saved it from being unbundled in 1.1) #4038 [Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/protocol')
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb | 15 | ||||
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb | 4 |
2 files changed, 15 insertions, 4 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 b36e029669..fa917ad4a5 100644 --- a/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb @@ -32,7 +32,9 @@ module ActionWebService end def ruby_to_soap(obj) - SOAP::Mapping.obj2soap(obj, @registry) + soap = SOAP::Mapping.obj2soap(obj, @registry) + soap.elename = XSD::QName.new if SOAP::Version >= "1.5.5" && soap.elename == XSD::QName::EMPTY + soap end def register_type(type) @@ -63,12 +65,21 @@ module ActionWebService end @type2binding[type] = array_binding ? array_binding : type_binding + + if type.structured? + type.each_member do |m_name, m_type| + register_type(m_type) + end + end + @type2binding[type] end alias :lookup_type :register_type def annotate_arrays(binding, value) - if binding.type.array? + if value.nil? + return + elsif binding.type.array? mark_typed_array(value, binding.element_binding.qname) if binding.element_binding.type.custom? value.each do |element| diff --git a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb index 53b67ced4c..64992e7754 100644 --- a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +++ b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb @@ -50,10 +50,10 @@ module ActionWebService # :nodoc: end def encode_response(method_name, return_value, return_type, protocol_options={}) - return_value = true if return_value.nil? - if return_type + if return_value && return_type return_value = value_to_xmlrpc_wire_format(return_value, return_type) end + return_value = false if return_value.nil? raw_response = XMLRPC::Marshal.dump_response(return_value) Response.new(raw_response, 'text/xml', return_value) end |