我正在使用 savon 2.11.1
gem 在我的 Rails 应用程序中获取 SOAP 请求和响应。我正在使用
Savon.client(wsdl: "sample_url", ssl_verify_mode: :none)
并调用
client.call(:method_name, hash)
当我调用 call 方法时,我从 savon 收到此错误。
HTTPError(302)
当我尝试使用 Chrome Soap 客户端扩展中的 URL 时,我得到了成功的响应。
任何人都可以帮我解决这个问题吗?
提前致谢
最佳答案
最后我解决了这个问题,并考虑发布答案,因为它可能会对某人有所帮助。
我们只需要在 Savon 客户端对象中使用全局选项“follow_redirects: true”。它就像一个魅力。
The code is: Savon.client(wsdl: "sample_url", ssl_verify_mode: :none, follow_redirects: true)
谢谢。
关于ruby-on-rails - savon httperror 302 Rails 3.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39011045/