Consume Soap Service with Basic Authentication

Discussion in 'Ruby' started by Chris Gunnels, Dec 8, 2010.

  1. 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?

    --
    Posted via http://www.ruby-forum.com/.
     
    Chris Gunnels, Dec 8, 2010
    #1
    1. Advertising

  2. Chris Gunnels

    Tony Arcieri Guest

    [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/

    On Wed, Dec 8, 2010 at 10:42 AM, Chris Gunnels <> wrote:

    > 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?
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >



    --
    Tony Arcieri
    Medioh! Kudelski
     
    Tony Arcieri, Dec 8, 2010
    #2
    1. Advertising

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

    --
    Posted via http://www.ruby-forum.com/.
     
    Chris Gunnels, Dec 8, 2010
    #3
  4. Chris Gunnels

    Tony Arcieri Guest

    [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

    On Wed, Dec 8, 2010 at 10:59 AM, Chris Gunnels <> wrote:

    > 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.
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >



    --
    Tony Arcieri
    Medioh! Kudelski
     
    Tony Arcieri, Dec 8, 2010
    #4
  5. [Note: parts of this message were removed to make it a legal post.]

    Good Morning,

    On Wed, Dec 8, 2010 at 9:42 AM, Chris Gunnels <> wrote:

    > 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
     
    John W Higgins, Dec 8, 2010
    #5
  6. @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/.
     
    Chris Gunnels, Dec 8, 2010
    #6
  7. On Dec 8, 2010, at 3:11 PM, Chris Gunnels 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 Biedenharn
    http://AgileConsultingLLC.com/
    http://GaslightSoftware.com/
     
    Rob Biedenharn, Dec 8, 2010
    #7
  8. Chris Gunnels

    Tony Arcieri Guest

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

    On Wed, Dec 8, 2010 at 1:11 PM, Chris Gunnels <> 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?

    --
    Tony Arcieri
    Medioh! Kudelski
     
    Tony Arcieri, Dec 8, 2010
    #8
  9. 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.

    --
    Posted via http://www.ruby-forum.com/.
     
    Chris Gunnels, Dec 8, 2010
    #9
  10. 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.

    --
    Posted via http://www.ruby-forum.com/.
     
    Chris Gunnels, Dec 8, 2010
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msnews.microsoft.com
    Replies:
    2
    Views:
    1,159
    =?Utf-8?B?R2FyeQ==?=
    May 19, 2004
  2. Jorge Luzarraga Castro

    Is it possible to consume a Web Service from an ASP Client?

    Jorge Luzarraga Castro, Nov 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    408
    S.M. Altaf [MVP]
    Nov 3, 2005
  3. mohit
    Replies:
    2
    Views:
    820
    Simon Brunning
    Jan 12, 2007
  4. Mullin Yu
    Replies:
    0
    Views:
    223
    Mullin Yu
    Oct 8, 2003
  5. dgleeson422111

    consume local web service -ok consume remote service - Not OK

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    1,613
    dgleeson422111
    Jan 31, 2010
Loading...

Share This Page