moneshchary
moneshchary

Reputation: 13

how to create web service Api in rails 4?

can anyone help me how to create a web service API in rails 4. I know how create web service API in ruby 1.8.7 and rails 2.3.5 with action web service gem. When I am trying to use https://github.com/datanoise/actionwebservice gem in rails 4, I am getting deprecated errors.I want to upgrade my web service app. Please help me.

Upvotes: 0

Views: 1410

Answers (2)

nathanvda
nathanvda

Reputation: 50057

Actionwebservice is long deprecated, in favour of REST API's. At my previous job we used a fork of actionwebservice in a rails 3 project.

Since there is no maintainer anymore for the actionwebservice gem, that fork never got merged back. If you check the fork history, a lot of people are fixing and partially updating it, but it is scattered all over the place.

Afaik none of the forks were updated to use rails 4. But using a rails 3 fork might just work.

If you really need to build a SOAP API server with Rails, imho your best option is to take a look at Wash-out, but you will have to re-write your API code.

Upvotes: 0

Inhan
Inhan

Reputation: 526

Rails-API looks promising, because it will be part of Rails core in Rails 5.

Rails-API

Rails-API is a subset of a normal Rails application, because API only applications don't require all functionality that a complete Rails application provides. so, it compatible well with old Rails versions. I don't know compatibility exactly, but I'm using it with Rails 3.2.x

There are another proper framework for this purpose, for example, Sinatra, Grape, but If you familiar with Rails, Rails-API will be the best choice.

Upvotes: 1

Related Questions