# Creating xml in controller and send to Web Service

**URL:** <https://www.ruby-forum.com/t/creating-xml-in-controller-and-send-to-web-service/166765>\
**Category:** Rails\
**Created:** [April 29, 2009, 10:56am UTC](https://www.ruby-forum.com/t/creating-xml-in-controller-and-send-to-web-service/166765 "2009-04-29T10:56:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhargavi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@bhargavi](https://www.ruby-forum.com/u/bhargavi)\
**Post date:** [April 29, 2009, 10:56am UTC](https://www.ruby-forum.com/t/creating-xml-in-controller-and-send-to-web-service/166765/1 "2009-04-29T10:56:27Z")

</div>

Hi All,

I have a question regarding creating xml in controller class… I am  
designing a rails application, which is a client for java REST based Web  
services. in my rails client part, in my view, I have a simple  
index.html.erb which consists of 2 strings ‘source’ , ‘destination’ . I  
will take the input from user and send those to controller class. with  
those 2 inputs i need to create a xml file in controller and send that  
to REST based web service…  
My question is,

1. How to create xml consisting of those 2 values.  
if possible, can anyone tell me How can I send that to REST WS ? As I  
am very new to Ruby, I don’t have much knowledge on this…

your help is highly appreciated…

Thanks,  
Bhargavi.
