Forum: Ruby on Rails HELP!! - Problem with AWS and subclasses

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8b6f3bdd655ba2a19cda645e2150f34d?d=identicon&s=25 Dirk Breuer (samwise23)
on 2006-01-11 10:16
Hi,

I'm quite new to Rails and have a problem with the use of AWS.

The Problem is, that I have a class which provides some basic attributes
and some subclasses of this with more specific attributes. I want to
send objects of those classes through SOAP by a remote client, but if I
specify just the base class in the method signature of my API definition
the generated WSDL file will just include the attributes of the base
class.

Is there any way to change this behavior? Because it is possible. The
Apache AXIS tools for example will generate a WSDL containing the class
inheritance so that remote callers are aware of this feature.

Thanks for your help.

Dirk

-----

Here is an example of what I mean for better illustration:

class Shape < ActionWebService::Struct
  member :color, :string
end

class Square < Shape
  member :length, :int
end

class Circle < Shape
  member :radius, :int
end

class Rectangle < Square
  member :height, :int
end


class ShapeApi < ActionWebService::API::Base
  api_method :store_shape,
             :expects => [Shape]
end


WSDL:

...
<xsd:complexType name="Shape">
  <xsd:all>
    <xsd:element name="color_id" type="xsd:string"/>
  </xsd:all>
</xsd:complexType>
...
This topic is locked and can not be replied to.