SOAP and XML-RPC Web Service Servers
Rails comes with a component called ActionWebService (often referred to as AWS) that makes hosting SOAP and XML-RPC web services simple and efficient. ActionWebService allows you to make SOAP and XML-RPC methods available by binding your web service to controllers in your Rails application. It takes care of almost all the technical details for you: parsing the XML request, creating the XML response, and even creating the appropriate WSDL file for your SOAP service. This all means you're free to focus on your business logic, without having to worry about all the protocol specifics.
To update your version of ActionWebService, or to install it
independently of Rails, use the gem
command:
gem install actionwebservice
AWS supports many of the common Rails tools to speed up the
development cycle. It includes a web_service_scaffold
method and a script to
generate the base files, code, and some functional tests:
script/generate web_service YOURSERVICE YOURMETHOD1 YOURMETHOD2
All of this makes building web services with AWS very easy—though we will skip the use of these convenience tools in order to give a more detailed explanation of
the steps involved in creating your servers. There are only three simple steps you need to follow:
Determine which dispatching mode fits your needs (Direct, Delegated, or Layered).
Create your Application Programming Interface (API), providing the details about the methods you'll make available.
Create your methods (either in controllers ...
Get Web Services on Rails now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.