# SOAP4R Error in Rails

**URL:** <https://www.ruby-forum.com/t/soap4r-error-in-rails/83753>\
**Category:** Rails\
**Created:** [January 29, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/soap4r-error-in-rails/83753 "2007-01-29T15:02:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexamat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/bc8723/32.png) [@alexamat](https://www.ruby-forum.com/u/alexamat)\
**Post date:** [January 29, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/soap4r-error-in-rails/83753/1 "2007-01-29T15:02:32Z")

</div>

Hi all

I have a ruby script that calls a web service which works just fine,  
However when i try to use the same code from a rails model I get the  
following error:

uninitialized constant SOAP::Mapping::EncodedRegistry

I have tried to load the gem soap4r from both the model and the  
config/environment.rb files but i still get the same error

Any ideas on what I’m doing wrong ???

Thanks

---

<div class="post-metadata">

**Author:** ![alexamat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/bc8723/32.png) [@alexamat](https://www.ruby-forum.com/u/alexamat)\
**Post date:** [February 1, 2007, 12:02pm UTC](https://www.ruby-forum.com/t/soap4r-error-in-rails/83753/2 "2007-02-01T12:02:02Z")

</div>

Hi  
Try posting your question on [refwell.com](http://refwell.com) You might get your answer  
there

On Jan 29, 3:02 pm, Alex A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![alexamat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/bc8723/32.png) [@alexamat](https://www.ruby-forum.com/u/alexamat)\
**Post date:** [March 17, 2007, 10:43pm UTC](https://www.ruby-forum.com/t/soap4r-error-in-rails/83753/3 "2007-03-17T22:43:07Z")

</div>

Hello,

It seems that when you ‘require’ soap4r, it conflicts with Ruby’s soap  
library and Rails tries to use Ruby’s soap library instead of soap4r.

Copy the folder \ruby\gems\1.8\gems\soap4r-1.5.5.20061022\lib\soap to  
\ruby\lib\ruby\1.8\soap and try again. It worked for me.

Hope this helps
