Convert this XML request to a proper Savon request

纵饮孤独 提交于 2019-12-02 09:41:34

You need to set the additional namespace. The SOAP action has to be in quotes to match yours.

The script could look like this:

#!ruby

require "savon"

Savon.configure do |c|
  c.pretty_print_xml = true
  c.env_namespace = :soapenv
end

client = Savon::Client.new do
  wsdl.namespace = "http://test.org"
  wsdl.endpoint = "http://localhost"
end

resp = client.request :tem, 'Authenticate' do
  soap.namespaces["xmlns:hon"] = "http://schemas.datacontract.org/2004/08/TEST.RVU.Entity"
  soap.body = { "tem:authenticationDet" => 
                { "hon:AccountType" => 0,
                  "hon:Password" => "bacon",
                  "hon:UserName" => "smith" }
              }
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!