web services and associations

Hi guys, I'm exploring the realm of web services and I can't work out if this is
possible.

If I return a Questionnaire object from an action, the relevant part of the SOAP
response looks like

      <return n2:arrayType="n1:Questionnaire[1]"
          xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
          xsi:type="n2:Array">
        <item>
          <id xsi:type="xsd:int">1</id>
          <name xsi:type="xsd:string">Desserts</name>
          <description xsi:type="xsd:string">A survey designed to observe
current preferences for dessert foods</description>
          <rubric xsi:type="xsd:string"></rubric>
        </item>
      </return>

Now, a Questionnaire intrinsically has_many :questions (Question objects), and
I'd like to be able to pass those in the same request - I don't think that SOAP
requires <item>s to be single depth, surely it would be a bit useless using XML
in that case.

Ideally I would like a way to get the response looking something like the
following (or whatever Rails would require)

      <return n2:arrayType="n1:Questionnaire[1]"
          xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
          xsi:type="n2:Array">
        <item>
          <id xsi:type="xsd:int">1</id>
          <name xsi:type="xsd:string">Kyanmedia Desserts</name>
          <description xsi:type="xsd:string">A survey designed to observe
current preferences for dessert foods</description>
          <rubric xsi:type="xsd:string"></rubric>
          <questions>
            <item>
              <id xsi:type="xsd:int">1</id>
              <!-- more Question data -->
            </item>
          </questions>
        </item>
      </return>

Similarly, would the same be possible with arguments to API functions (i.e.
passing in nested data from the remote point)?

Any references you can point me to would be appreciated :slight_smile:

Gareth

Gareth Adams <gareth.adams@...> writes:

[...]

Now, a Questionnaire intrinsically has_many :questions (Question objects), and
I'd like to be able to pass those in the same request - I don't think that SOAP
requires <item>s to be single depth, surely it would be a bit useless using XML
in that case.

[...]

I guess I'm asking if I can put anything in an API definition similar to
:include in ActiveRecord