I'm using wash-out gem (https://github.com/inossidabile/wash_out) for exposing a SOAP service.
Sample usage of wash-out documentation goes something like this:
# Params from XML attributes;
# e.g. for a request to the 'AddCircle' action:
# <soapenv:Envelope>
# <soapenv:Body>
# <AddCircle>
# <Circle radius="5.0">
# <Center x="10" y="12" />
# </Circle>
# </AddCircle>
# </soapenv:Body>
# </soapenv:Envelope>
soap_action "AddCircle",
:args => { :circle => { :center => { :@x => :integer,
:@y => :integer },
:@radius => :double } },
:return => nil, # [] for wash_out below 0.3.0
:to => :add_circle
def add_circle
circle = params[:circle]
Circle.new(circle[:center][:x], circle[:center][:y], circle[:radius])
render :soap => nil
end
But my XML request has many nested arguments and I don't want to define mappings (:args) for each XML attribute. Is there any way to map the XML request (XSD) to a ruby hash into a form which is required as :args for the soap action.