# Customizing XML response with Web services implementation using AWS

**URL:** <https://www.ruby-forum.com/t/customizing-xml-response-with-web-services-implementation-using-aws/162378>\
**Category:** Rails\
**Created:** [March 9, 2009, 12:00pm UTC](https://www.ruby-forum.com/t/customizing-xml-response-with-web-services-implementation-using-aws/162378 "2009-03-09T12:00:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piyush\_with\_Rails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@Piyush\_with\_Rails](https://www.ruby-forum.com/u/Piyush_with_Rails)\
**Post date:** [March 9, 2009, 12:00pm UTC](https://www.ruby-forum.com/t/customizing-xml-response-with-web-services-implementation-using-aws/162378/1 "2009-03-09T12:00:13Z")

</div>

Hi All,

I am using Action web service’s layered dispatching to implement web  
service apis in rails.

I want to know that how can we customize the XML response generated by  
AWS as the response for API Call.

For an example take below thing in consideration.

## API Method signature

class ProductAuthApi \< ActionWebService::API::Base

api\_method :find\_all\_products,  
:expects =\> [:string}],  
:returns =\> [[Product]]

end

## Product Struct class

class Product \< ActionWebService::Struct

member :id, :integer  
member :name, :string  
end

Now if we implement API service and return the array of structure type  
Product and  
invoke the service,In the response we will get the Array of Product  
class object.

But if we look at the response XML generated by AWS for this API  
request, there are many tag generated to represent different  
array elements.

now if we need to cusomize the name of these node with some  
specific name as in response xml then how can we do that ?

and also if we need to add the attribute to these nodes for uniquely  
identifying them then how can we do that?

Thanks in advance.

Thanks,  
Piyush.
