我在 Savon v1 中有这段代码:
client = Savon.client("http://www.server.com:9191/soapserver?wsdl")
service = client.request :get_authentication do
client.http.headers["username"] = "myuser"
client.http.headers["password"] = "mypass"
end
更新到 savon v2.3.0 后,我无法重新翻译。它应该是这样的
client = Savon.client do
wsdl "http://www.shab.ch:9191/soapserver?wsdl
end
service = client.call(:get_authentication, {username: "myuser", password: "mypass"})`
但service = client.call(...
“行不通。知道吗?