gpt4 book ai didi

ruby - Savon 2 如何将属性添加到 message_tag

转载 作者:太空宇宙 更新时间:2023-11-03 17:35:22 24 4
gpt4 key购买 nike

在 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' })

关于ruby - Savon 2 如何将属性添加到 message_tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18691670/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com