# Web Service: REST or SOAP?

**URL:** <https://www.ruby-forum.com/t/web-service-rest-or-soap/162573>\
**Category:** Rails\
**Created:** [March 11, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573 "2009-03-11T14:54:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [March 11, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573/1 "2009-03-11T14:54:59Z")

</div>

Hi, i’ve a rails app and i’d like to add a web service to permit of get  
data from external.  
What should i use to do this? I’ve seen that for create a web service  
there is rest and soap, which is better?  
I’m already using rest for the normal using of the web app, should i  
stay stick with it?  
I know that with soap exist wsdl and other stuff, what should i need for  
rest?  
Do you have any link that expain better this? i’ve googled, but a lot of  
stuff are useless ☹  
thank you

---

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [March 11, 2009, 3:34pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573/2 "2009-03-11T15:34:45Z")

</div>

Hi,  
Refer to the links, they are straight forward and gives you reasons to  
make  
a choice based on your requirements.

[http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html](http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html)

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries

On Wed, Mar 11, 2009 at 3:54 PM, Xdmx X.  
\<removed\_email\_address@domain.invalid

> wrote:

> ## stuff are useless ☹ thank you
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

## –

Thanks & Regards,  
Sumanth Krishna. A  
+358 40 3276564

Blogs:  
TwinclingCommunity:

> **[TechSavvy](http://sumanthtechsavvy.blogspot.com/)**
>
> Technical Blog

[http://www.twincling.org/node/227](http://www.twincling.org/node/227)

[http://yourway2health.blogspot.com/](http://yourway2health.blogspot.com/)  
[http://www.osef.twincling.org](http://www.osef.twincling.org)

---

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [March 11, 2009, 3:35pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573/3 "2009-03-11T15:35:55Z")

</div>

Hi,  
Refer to the links, they are straight forward and gives you reasons  
to make a choice based on your requirements.

[http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html](http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html)

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries

On Mar 11, 3:54 pm, Xdmx X. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [March 11, 2009, 3:53pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573/4 "2009-03-11T15:53:16Z")

</div>

Sumanth Krishna wrote:

> Hi,  
> Refer to the links, they are straight forward and gives you reasons  
> to make a choice based on your requirements.
> 
> [IBM Developer](http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html)  
> [DATANOISE.COM](http://www.datanoise.com/articles/2008/7/2/actionwebservice-is-back)
> 
> On Mar 11, 3:54ï¿½pm, Xdmx X. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thank you Sumanth, i think i’ll go with rest, it seems easier and  
lighter… do you know if wadl is needed? or is it possible to give just  
the xml as response (as is doing with other requests)?

p.s. actually i don’t know the requirements, i’m just looking on which  
is the best practice to develop a web service 🙂

---

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [March 11, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/web-service-rest-or-soap/162573/5 "2009-03-11T20:01:06Z")

</div>

Xdmx X. wrote:

> Thank you Sumanth, i think i’ll go with rest, it seems easier and  
> lighter… do you know if wadl is needed? or is it possible to give just  
> the xml as response (as is doing with other requests)?

I’m just going to say it, “You’ve made the correct decision with REST.”  
Just forget that you every heard the term SOAP and you’ll live a much  
happier life.

No you do not need a WSDL with REST. Just send the PO-XML, JSON, Atom,  
RSS or whatever other “standard” response format that make sense for  
your action. Also, be sure to take advantage of the HTTP response codes  
to inform your consumers of any errors that may occur. Basically, all  
the stuff you should already be doing with your Rails 2.x application.

My recommendation would be to take a look at some good existing REST  
services such as those provided by applications like Lighthouse, Github,  
Highrise, etc. If you can learn how to consume one of those, then it  
should help in implementing your services.

[http://lighthouseapp.com/api](http://lighthouseapp.com/api)  
[http://github.com/guides/the-github-api](http://github.com/guides/the-github-api)

> **[GitHub - basecamp/highrise-api: Official API documentation for Highrise](https://github.com/basecamp/highrise-api)**
>
> Official API documentation for Highrise. Contribute to basecamp/highrise-api development by creating an account on GitHub.

P.S. Obviously, this is a personal opinion, but it does follow the  
opinion of Rails.
