Consume Soap Service with Basic Authentication

I have been searching and trying different gems to get this to work, but
can’t. I need to consume a soap service that’s protected with Basic
Authentication. I have tried the following:

wsdl = “https://soapservice.com
client = SOAP::WSDLDriverFactory.new(wsdl)
soap = client.create_rpc_driver

soap.options['protocol.http.basic_auth'] << [wsdl, 'my_user_name',

‘my_pass’]

with this i get “basic_auth is not supported under soap4r + net/http.”

So I tried Savon gem but its dependencies are severely out dated.

Anybody have any ideas?

You might try gem install savon --pre to get the latest version.
Documentation is available at:

http://rubiii.github.com/savon/

the problem is that savon requires old dependencies. i have the latest
version but the dependencies are to old for my app to work with.

What dependencies are you talking about? Savon’s only dependencies are
builder, crack, and httpi

@tony all those dependencies you listed all have new versions.
@john, i saw that but i didn’t want to have to use httpclient because i
didn’t know if I could trust it and if it is going to be maintained. The
reason i thought this is because I couldn’t find it on rubygems.org or
rubyforge.

On Dec 8, 2010, at 3:11 PM, Chris G. wrote:

@tony all those dependencies you listed all have new versions.
@john, i saw that but i didn’t want to have to use httpclient
because i
didn’t know if I could trust it and if it is going to be maintained.
The
reason i thought this is because I couldn’t find it on rubygems.org or
rubyforge.


Posted via http://www.ruby-forum.com/.

Because it’s been around for a long time. Look on RAA

http://raa.ruby-lang.org/project/httpclient/2.1.5.2

Back when I had to use Soap4R on a project, httpclient was just fine
and even without much (English) documentation (which can be common on
older ruby code that was born in Japan), I was able to add a little
capability to it so I could remember and restore a cookiejar from the
database (as a YAML string). [My application needed to act as a client
to a SOAP service during a request.]

Sometimes “not updated recently” means “hasn’t had any reported bugs”
rather than “unmaintained”.

-Rob

Rob B.
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.com/

On Wed, Dec 8, 2010 at 1:11 PM, Chris G. [email protected] wrote:

@tony all those dependencies you listed all have new versions.

Are you using Builder 3.0 or something? Other than that what version
conflicts are you having?

Good Morning,

On Wed, Dec 8, 2010 at 9:42 AM, Chris G. [email protected] wrote:

with this i get “basic_auth is not supported under soap4r + net/http.”

You need the httpclient gem. It’s the Soap4R’s preferred client as
opposed
to net/http

John

I decided to go with Savon. What I ended up doing was just setting the
version of actionpack to 3.0.3 in my Gemfile. This prevented all the
other gems from being removed by bundler.

I use bundler so when i install savon bundler removes these gem
versions:

abstract-1.0.0.gem
actionpack-3.0.3.gem
activemodel-3.0.3.gem
builder-2.1.2.gem
erubis-2.6.6.gem
i18n-0.5.0.gem
rack-mount-0.6.13.gem
tzinfo-0.3.23.gem

and installs these:
actionpack-1.4.0.gem
builder-3.0.0.gem

It seems as though that my builder is outdated.