提交 35349745 编写于 作者: L Leon Breedt

filter out embedded nil values for XML-RPC

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 aaea48fe
......@@ -51,11 +51,18 @@ def value_to_xmlrpc_wire_format(value, value_type)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册