Consume Soap Service with Basic Authentication

C

Chris Gunnels

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?
 
T

Tony Arcieri

[Note: parts of this message were removed to make it a legal post.]

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

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

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?
 
C

Chris Gunnels

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.
 
T

Tony Arcieri

[Note: parts of this message were removed to make it a legal post.]

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

John W Higgins

[Note: parts of this message were removed to make it a legal post.]

Good Morning,

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."

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

John
 
C

Chris Gunnels

@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.
 
R

Rob Biedenharn

@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.

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 Biedenharn
(e-mail address removed) http://AgileConsultingLLC.com/
(e-mail address removed) http://GaslightSoftware.com/
 
T

Tony Arcieri

[Note: parts of this message were removed to make it a legal post.]

@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?
 
C

Chris Gunnels

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.
 
C

Chris Gunnels

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top