diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-04-02 22:05:16 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-04-02 22:05:16 +0000 |
commit | 353497458b460d03114905e001f782c6f0b463fa (patch) | |
tree | df91ae2f8c6b5361165dba30d0d7baf528c09852 /actionwebservice/lib/action_web_service/protocol | |
parent | aaea48fe9826b9e5d2d5b92795a297b8f238c58d (diff) | |
download | rails-353497458b460d03114905e001f782c6f0b463fa.tar.gz rails-353497458b460d03114905e001f782c6f0b463fa.tar.bz2 rails-353497458b460d03114905e001f782c6f0b463fa.zip |
filter out embedded nil values for XML-RPC
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/protocol')
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb index de6c8c8a30..ed7ba5c512 100644 --- a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +++ b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb @@ -51,11 +51,18 @@ module ActionWebService # :nodoc: if value.is_a?(ActionWebService::Struct) struct = {} value.class.members.each do |name, type| - struct[name.to_s] = value_to_xmlrpc_wire_format(value[name], type) + member_value = value[name] + next if member_value.nil? + struct[name.to_s] = value_to_xmlrpc_wire_format(member_value, type) end struct elsif value.is_a?(ActiveRecord::Base) - value.attributes.dup + struct = {} + value.attributes.each do |key, member_value| + next if member_value.nil? + struct[key.to_s] = member_value + end + struct elsif value.is_a?(Exception) && !value.is_a?(XMLRPC::FaultException) XMLRPC::FaultException.new(2, value.message) else |