在 Savon 1 中,我可以使用 soap.input
添加 xmlns
,如下所示:
soap_client = Savon.client("http://pathtowsdl.com/a.svc?wsdl")
response = soap_client.request "AnAction" do
http.headers["soapAction"] = "AnAction"
soap.input = ["AnAction", {"xmlns" => "http://apathtosomething.com"}]
soap.body = {
"SomeAttribute" => "SomeValue"
}
end
在 Savon 2 中,我可以执行 client.call(:authenticate, message_tag:::authenticationRequest)
但是如何将 xmlns
添加到 authenticationRequest
标签中呢?
您必须将属性添加到调用中,例如。
client.call('CreateRequest', :attributes => { 'xmlns' => 'xyz' })
我是一名优秀的程序员,十分优秀!