# Bizare soap4r problem

**URL:** <https://www.ruby-forum.com/t/bizare-soap4r-problem/112060>\
**Category:** Rails\
**Created:** [August 14, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/bizare-soap4r-problem/112060 "2007-08-14T20:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [August 14, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/bizare-soap4r-problem/112060/1 "2007-08-14T20:56:37Z")

</div>

Hey chaps

I am using classes I generated from wsdl2ruby, and they work like a  
charm when running somthing like:

ruby -d path/to/file.rb

and i get the result I expect. However, when I use them within rails,  
the actual xml it puts together is different. Using wire dump i see that  
(and this is a key part of the web service) looks like:

```
  <n1:inRecipientIDs xsi:type="n1:ArrayOfString">
    <n1:string>badger2005</n1:string>
  </n1:inRecipientIDs>

```

But when using in rails it looks like:

n1:inRecipientIDsbadger2005\</n1:inRecipientIDs\>

So my question is how can the same class generate differing output? Is  
it somehow not using soap4r? Is there anyway to explicitally load it and  
make it not use the stdlib ones?

Cheers for any help

Tim

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [August 14, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/bizare-soap4r-problem/112060/2 "2007-08-14T21:45:00Z")

</div>

Hi Tim,

The first thing I would check is to see if the libraries that are being  
loaded are different in one instance over another. I’ve seen several  
instances where SOAP gets messed up by an instance of htaccess2 being  
loaded. The libraries are written to use htaccess2 if they find it but  
otherwise fall back on htaccess. This will give you different behavior,  
and  
could be loaded by all kinds or extensions (the most assinign being Hoe,  
which your probably not even using at all but gets loaded because  
someone  
used to to package their gem). The best way I know of to do this is to  
use  
$LOADED\_FEATURES in irb and then again in script/console. It takes some  
going through, but it may lead you to an answer.

Good Luck,  
Rob

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [August 17, 2007, 12:31am UTC](https://www.ruby-forum.com/t/bizare-soap4r-problem/112060/3 "2007-08-17T00:31:00Z")

</div>

Cheers for the tip Rob, much apprecited 🙂

It seems the problem was to do with the SOAP implementation in stdlib  
messing things up! It was actually a simple fix to be honest, i just  
needed to do “gem soap4r” in boot.rb - for some reason, loading it any  
other way - like in RAILS\_ROOT/vendor for example - just doesnt cut the  
mustard!!

Cheers

Tim
