Child pages
  • Ruby on Rails Client Sample Code
Skip to end of metadata
Go to start of metadata

Ruby on Rails Client Sample Code

1. Explore the attached sample code (thank you Matt Harris!)

This package includes working client code for connecting to a variety of UW web services. It has been tested with Rails 2.3.5 but should work with any current 2.x variant of Ruby on Rails.

The code will interact with three "types" of web services at UW:

  • Services that return XML that the built-in ActiveResource library can interact without any special configuration. This includes the Student Web Service for now.
  • Services that use XHTML that ActiveResource can't understand, like the idCard photo service and the Groups Service. The code includes a class called "NonstandardWebServiceResult" that mimics an ActiveResource-style object (sort of).
  • The UW Calendar service, which provides its own xml format and interface.

In order to integrate this code into your Rails app, put the files in the appropriate places and follow these steps:

  1. Update config/web_services.yml with your info
  2. Put your cert and key files into config/certs, matching the names specified in step #1
  3. Update the GROUP_STEM in app/models/uw_web_services/group_resource.rb to match your group stem.
  4. Update the view templates in app/views/web_services/group to use the proper values when creating and updating groups with the UW Groups Service.

2. Contribute your own samples!

  • No labels