Webservices and submitting object with associations


#1

Hi - is there an easy way to submit an object with its associations as
an :expects parameter to a AWS webservice?

I know I could first create a webservice method for the object, and then
call - in a loop - another webservice for each of my association
objects.

Is there an easier more elegant way, so that I don’t have to make so
many expensive webservice calls?

I was thinking creating my own XML document for this, and passing it
into a :string or a :base64 :expects parameter. Sound reasonable?

Thanks
Joerg


#2

Hi Joerg,

Hi - is there an easy way to submit an object with its associations as
an :expects parameter to a AWS webservice?

Is it possible to use an ActionWebService::Struct in an :expects? You
can
certainly use it in a :returns. So something like:

class AwsTree < ActionWebService::Struct
    member :id,   :int
    member :name, :string
end

class TreeApi < ActionWebService::API::Base
    api_method :get_tree_by_struct,
               :expects => [[AwsTree]],
               :returns => [{:treeid => :int}]
end

class Tree < ActionWebService::Base
    web_service_api TreeApi
end

HTH,

  • Andrew