From 7f32666924493fb21a72ad56fb2cf4091aad4141 Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Sat, 16 Apr 2005 19:29:42 +0000 Subject: Remove a cause of casting failure for XML-RPC by ignoring structure members not defined in the target type, and perform more sanity checks to make more obvious what the resolution should be when neglecting to provide a valid signature or failing to attach an API to a service implementation class. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionwebservice/lib/action_web_service/casting.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionwebservice/lib/action_web_service/casting.rb') diff --git a/actionwebservice/lib/action_web_service/casting.rb b/actionwebservice/lib/action_web_service/casting.rb index 88462d8cc9..b30de2d4c4 100644 --- a/actionwebservice/lib/action_web_service/casting.rb +++ b/actionwebservice/lib/action_web_service/casting.rb @@ -93,12 +93,12 @@ module ActionWebService # :nodoc: value.each_pair do |name, val| type = klass.respond_to?(:member_type) ? klass.member_type(name) : nil val = cast(val, type) if type - obj.__send__("#{name}=", val) + obj.__send__("#{name}=", val) if obj.respond_to?(name) end elsif value.respond_to?(:attributes) signature_type.each_member do |name, type| val = value.__send__(name) - obj.__send__("#{name}=", cast(val, type)) + obj.__send__("#{name}=", cast(val, type)) if obj.respond_to?(name) end else raise CastingError, "Don't know how to cast #{value.class} to #{signature_type.type_class}" -- cgit v1.2.3