3

I am trying to use a SOAP service that insists on HTTPS for credentials being passed to their :login.

Using Savon, I am not seeing how to setup for HTTPS and therefore it is failing. Can someone kindly point out how to use Savon to do calls over HTTPS.

/Users/fizz/.rvm/gems/ruby-1.9.3-p194/gems/savon-1.1.0/lib/savon/soap/response.rb:107:in           `raise_errors': (soap:Server) Server was unable to process request. ---> Credentials can only be passed over secure connections (HTTPS) (Savon::SOAP::Fault)
from /Users/fizz/.rvm/gems/ruby-1.9.3-p194/gems/savon-1.1.0/lib/savon/soap/response.rb:18:in `initialize'
from /Users/fizz/.rvm/gems/ruby-1.9.3-p194/gems/savon-1.1.0/lib/savon/soap/request.rb:35:in `new'
from /Users/fizz/.rvm/gems/ruby-1.9.3-p194/gems/savon-1.1.0/lib/savon/soap/request.rb:35:in `response'
from /Users/fizz/.rvm/gems/ruby-1.9.3-p194/gems/savon-1.1.0/lib/savon/client.rb:84:in `request'
from ./soap.rb:14:in `<main>'
David Lazar
  • 10,865
  • 3
  • 25
  • 38

1 Answers1

1

Savon uses HTTPI for HTTP requests. You should be able to provide HTTP credentials like this:

client = Savon.client("http://v1.example.com?wsdl")

# HTTP basic auth
client.http.auth.basic("username", "password")

# HTTP digest auth
client.http.auth.digest("username", "password")
rubiii
  • 6,903
  • 2
  • 38
  • 51
  • The problem is not presenting credentials, it is presenting the credentials with HTTPS. Nothing in setting up the client credentials enforces the use HTTPS. – David Lazar Aug 16 '12 at 21:46
  • 1
    Are you passing the location of the WSDL or the SOAP endpoint as a secure URL (e.g. "https://")? Also, which HTTPI adapter are you using? As this seems to require a little more debugging, you might consider to post to the mailing list instead. – rubiii Aug 20 '12 at 10:31