This chapter demonstrates how to build an XML-RPC service in Rails using ActionWebService. Like the rest of this book, this chapter won’t simply drive through the mechanics of setting up a service. Building on Chapters 11 and 12, you’ll learn not only how to make a Rails app communicate with another Rails app—that’s easy—but also how to build an infrastructure for services that makes your application enterprise-solid. That involves properly abstracting your database schema—the physical data model—from your logical model. Enterprise-solid also means knowing where to put all of your service code so that your application remains coherent. But first, you need to get set up with ActionWebService, which can be tricky in Rails 2.0.
As noted before, in Rails 2.0, ActionWebService was relegated from the core to plugin status. As of this writing, simply installing the ActionWebService gem does not work as expected with the following:
gem install ActionWebService
You may want to try installing the gem like this anyway. The warning signs that the plugins are still not fully integrated are errors such as “Uninitialized constant ActionWebService”. If you want to wait until you’ve got some ActionWebService code in place before hacking up your installation, feel free to come back to this section later. In any case, rest assured that the following steps will get you going with ActionWebService in no time. Note that this procedure assumes ...