Nick S. wrote:
On Fri, Jun 19, 2009 at 4:31 AM, Marco D. [email protected] wrote:
uninitialized constant ActionWebService
My question to all of you is: Do you know any descriptions how to get jruby
working with actionwebservice? Or do you have any hints where I made a
mistake?
Can you show us an example piece of code for what you’re doing? Using
ActionWebService outside of a Rails app might require extra hoops
(requires,
etc.).
/Nick
Hi Nick,
I try to ue ActionWebService inside of a Rails application. I did’n to
very much until now. I created a “hello_message_api” in app/apis
class HelloMessageApi < ActionWebService::API::Base
api_method :hello_message, :expects => [{:firstname=>:string},
{:lastname=>:string}], :returns => [:string]
end
and I created a hello_message_controller:
class HelloMessageController < ApplicationController
web_service_api HelloMessageApi
web_service_dispatching_mode :direct
wsdl_service_name ‘hello_message’
web_service_scaffold :invoke
def hello_message(firstname, lastname)
return "Hello “+ firstname +” "+lastname
end
end
at least I added some lines to my environment.rb:
before the Rails::Initializer block
class Rails::Configuration
attr_accessor :action_web_service
end
in this block
config.action_web_service = Rails::OrderedOptions.new
config.load_paths += %W(
#{RAILS_ROOT}/app/apis
)
After a restarting the server and looking up for
http://localhost:3000/hello_message/wsdl I get the message:
uninitialized constant ActionWebService
I hope the description is precise enough.
Thanks so far!