# Uninitialized constant

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant/174344>\
**Category:** Rails\
**Created:** [August 25, 2009, 11:54am UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344 "2009-08-25T11:54:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [August 25, 2009, 11:54am UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/1 "2009-08-25T11:54:07Z")

</div>

API-\> hello\_message\_api.rb.

class HelloMessageApi \< ActionWebService::API::Base  
api\_method :hello\_message, :expects =\> [{:firstname=\>:string},  
{:lastname=\>:string}], :returns =\> [:string]

end

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

but it givesthe following error  
" uninitialized constant HelloMessageController::HelloMessageApi "  
plz  
help me out ???

---

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [August 25, 2009, 12:12pm UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/2 "2009-08-25T12:12:34Z")

</div>

Where is the class HelloMessageApi located ?You will need to include it  
inside the controller before being able to use it.

Thanks & Regards,  
Dhruva S…

Jonathan  
Swift[http://www.brainyquote.com/quotes/authors/j/jonathan\_swift.html](http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html)

- “May you live every day of your life.”

On Tue, Aug 25, 2009 at 3:24 PM, Sushrut S. \<

---

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [September 6, 2009, 2:51pm UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/3 "2009-09-06T14:51:37Z")

</div>

I get the same error… Any solution?

---

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [September 6, 2009, 4:00pm UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/4 "2009-09-06T16:00:06Z")

</div>

2009/9/6 Phylroy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I get the same error… Any solution?

I think the solution, as Dhruva S. pointed out is possibly to  
include the rb file in the controller.

Colin

---

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [September 29, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/5 "2009-09-29T16:05:30Z")

</div>

Here it is:

[http://adityakircon.blogsome.com/2009/05/07/how-to-install-actionwebservice-in-rails-2/](http://adityakircon.blogsome.com/2009/05/07/how-to-install-actionwebservice-in-rails-2/)

On Aug 25, 5:54 am, Sushrut S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![sushrut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@sushrut](https://www.ruby-forum.com/u/sushrut)\
**Post date:** [September 29, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/uninitialized-constant/174344/6 "2009-09-29T16:05:30Z")

</div>

I am running into issues as well. I believe this is due to the fact  
that Rails stopped providing SOAP support at 2.0 and doesn’t do any  
longer the ‘behind the scenes’ thing it used to do for SOAP. I found a  
post that explains how to get ActionWebService to work again with SOAP  
but I lost the link. I’m also working on it so I’ll let you know if I  
find it.

On Aug 25, 5:54 am, Sushrut S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
