I’m trying to connect to a SOAP interface using Rails and I’m running
into a snag. I’m relatively new to Rails at this point and am in the
very beginning stages of understanding how the system works. Currently
I’m running into a error that looks like this:
Missing API definition file in apis/amazon_api.rb
Now, the main issue here is that this file does exist in the app/apis
directory, but it looks almost as if it is looking for it relative to
the base directory. The reason I say this is that later on in the error
screen I get this:
|This error occured while loading the following files:
./script/…/config/…/app/controllers/store_controller.rb
|amazon|_api.rb
|--------------------------------------------
This leads me to believe that the first file is being called relative to
that directory, but the second is being called from inside the base
directory. Now my question is, could it be possible that the
environmental variable for the location of the APIs is messed up some
how? If so, how can I fix this?
Forgive me, I am very new to this whole language and am still getting
used to the structure of things. I’m hoping that this is an easy fix.
Also, if anyone has any pointers on setting up a SOAP interface to pull
down data, that would be great. Currently I’m trying to port an
application from PHP to Rails (for purely educational reasons) and can’t
seem to get past this hump.
Here’s my controller definition:
class StoreController < ApplicationController
web_client_api :amazon,
:soap,
“http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl”,
{:Service => 'AWSECommerceService'}
def index
end
end
I know its bare, but I haven’t been able to get past the error screen
from before to start fleshing thing out. Here’s the API file:
class AmazonApi < ActionWebService::API::Base
api_method :find
end
That’s about all I have. I’ve been tearing out my hair for hours.
Thanks in advance for any help that anyone can offer. Please, let me
know if I’m close or if I’m way off base.
~Drew