Hi, Holden,
> From: Holden Glova [mailto:dsafari@xtra.co.nz]
> Sent: Friday, March 22, 2002 4:02 PM
> class Proxy
>
> def initialize(attributes)
> attributes.each do |attribute|
> name = attribute.id2name
>
> instance_eval(<<-EOS)
> class << self
> attr_accessor :#{name}
> end
> EOS
> end
> end
>
> end
Hmm. Instance of Proxy is created by SOAP4R unmarshaller,
isn't it? The SOAP4R unmarshaller allocates new object
without calling user's initialize and set its instance
variables. Your Proxy#initialize is not called. So the
method 'name' is not on your method list.
Workaround: you can retrieve instance variables like;
name = obj.instance_eval { @name }
Other solutions:
1. SOAP4R creates proxy object when it encount unknown
klass. Remove Proxy class definition then your code will
work.
2. Can you send back Hash instead of Proxy class from
server?
3. Can you send back explicitly typed object?
Regards,
// NaHi