3

我正在尝试使用坚持使用 HTTPS 的 SOAP 服务将凭据传递给他们的 :login。

使用 Savon,我没有看到如何设置 HTTPS,因此它失败了。有人可以指出如何使用 Savon 通过 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>'
4

1 回答 1

1

Savon使用HTTPI处理 HTTP 请求。您应该能够像这样提供 HTTP 凭据:

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")
于 2012-08-16T20:21:36.287 回答