I'm trying to consume a RESTful WCF service in a Rails app using ActiveResource.
My ActiveResource class is:
class PartReferenceService < ActiveResource::Base
self.site = "http://localhost:1234/"
end
The WCF URL is
http://localhost:1234/PartReferenceService.svc/
and it returns XML like:
<ArrayOfReferenceDataModel xmlns="http://schemas.datacontract.org/2004/07/RemoteService.Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReferenceDataModel>
<Description>0460-0054</Description>
<Id>147</Id>
</ReferenceDataModel>
<ReferenceDataModel>
<Description>0960-0095</Description>
<Id>145</Id>
</ReferenceDataModel>
</ArrayOfReferenceDataModel>
I'm getting a 404 when I do:
PartReferenceService.find(:all)
I also can't find the URL that is being requested in my development.log file.
Any suggestions on where I may be going wrong? I'm fairly new to ActiveResource, and WCF for that matter, but my guess is that ActiveResource is creating a url like,
http://localhost:1234/part_reference_service/
but as I can't see anything in the logs I'm flying blind.
I'm in control of both ends so am able to make any changes needed.
Any help is much appreciated.