How do I override the soap4r version in the Ruby standard library with v1.5.8 gem?

23 views
Skip to first unread message

Matt

unread,
Nov 10, 2009, 5:39:58 PM11/10/09
to soap4r
I installed the soap4r 1.5.8 gem, generated a driver using <gemdir>/
soap4r-1.5.8/bin/wsdl2ruby.rb and successfully called my service.

Once I had the sample working, I tried calling the wsdl2ruby.rb again
with the --module_path option to put everything into a 'My::Module'
namespace, but the generated source is the same, i.e. no module
definitions around the generated classes. It turns out that the
version of wsdl/soap/wsdl2ruby.rb loaded by <gemdir>/soap4r-1.5.8/bin/
wsdl2ruby is from the standard library, and not the gem. The version
of soap4r in the standard library does not support the --module_path
option (the wsdl2ruby.rb in the gem does, so it didn't complain about
the unknown option).

My version information is:
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-linux]
gem 1.3.1
Fedora Core 10

Any help would be appreciated.

Thanks,
Matt

zenChild

unread,
Nov 10, 2009, 6:09:58 PM11/10/09
to soap4r
For ruby code you need to add the following,
require 'rubygems'
gem 'soap4r'

... but it sounds like your issue is more of a pathing issue. When
calling wsdl2ruby.rb make sure the gem bin is in the path first:
export PATH=`gem env gemdir`/bin:$PATH

Cheers!

Matt

unread,
Nov 12, 2009, 8:17:24 PM11/12/09
to soap4r
Doing a bit more investigation, I'm finding that it's definitely a
path issue.

What I'm finding is that on Fedora, $: includes /usr/lib/ruby/1.8 as
the last entry, and on Ubuntu $: includes /usr/lib/ruby/1.8 at the
*first* entry. When I use the usual "require 'rubygems'" "gem
'soap4r'" commands, the soap4r gem library path shows up in the
modified $: in the exact same location in the path set on both
systems. Unfortuately, since /usr/lib/ruby/1.8 is at the start of the
list on Ubuntu, the system version of soap4r is always found first.

I've confirmed the path ordering on two versions of Ubuntu (Ruby 1.8.5
on 7.04 and Ruby 1.8.7 on 9.04).

Is there a config file where the default order for the load path is
set? I've google'd just about every combination I can think of and
can't seem to find an answer.

Thanks again for any advice,
Matt
> > Matt- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages