Lately I've been working on validating an architectural design idea using Rails ActiveResource as a client and a WCF restful service as a server. I have the WCF service running on Windows Vista in a bootcamp partition on a Macintosh hosted in VMWare Fusion (self hosted mode). When I call the service from the Mac in a browser, I do indeed get the correct xml response from the virtual server. This is done by getting the ip address from the Vista server and using it in the uri.
http://168.192.243.128/WCFTestService/ContextService.svc/dtree/14
This service returns an instance of a class called "Context" with three DataMember attributes exposed (id = 14). I want to use the class name "DTree" in the Rails (2.3.2) client so I define the following:
class DTree < ActiveResource::Base
self.site = 'http://168.192.243.128/WCFTestService/ContextService.svc/'
end
The issue that I'm experiencing may have little to do with this setup though.
When I startup the console at the test project root in Rails and type the following:
DTree.find(14)
I get: NameError: uninitialized constant DTree (...)
The fine art of googling doesn't seem to turn up anything of real use, which sometimes tells me that my issue is a no-brainer and why would someone post an answer to this type of issue. From all I can tell and from other examples my active resource class should be at least recognized in the rails console with no more than defining the class. Another error would be fine.