Convert this XML request to a proper Savon request

后端 未结 1 1910
终归单人心
终归单人心 2021-01-26 05:45

Can somebody convert this:



        
相关标签:
1条回答
  • 2021-01-26 06: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
    
    0 讨论(0)
提交回复
热议问题