下面的代码,生成下面的 xml。
您可能会看到较小/较大的符号未显示为“<”或“>”,并且服务器对此不满意。
任何提示/建议表示赞赏。谢谢!
<env:Body>
<find>
<filter><and><equal name="foo" value="1"/></and></filter>
</find>
</env:Body>
def find
s_xml = Builder::XmlMarkup.new
s_xml.and do
s_xml.equal(:name => "foo", :value => 1)
end
body = {
:filter => [s_xml.target!],
}
_send_query :find, body
end
def _send_query method, body, server=@primary_server
client = Savon::client do
wsdl.endpoint = server
wsdl.namespace = server
end
client.config.pretty_print_xml = true
response = client.request method do
soap.body = body
end
return response.to_hash
end